static CORE_ADDR next_address;
+/* Number of delay instructions following current disassembled insn. */
+
+static int branch_delay_insns;
+
/* Last address examined. */
static CORE_ADDR last_examine_address;
/* We often wrap here if there are long symbolic names. */
wrap_here (" ");
- next_address = VALUE_ADDRESS (val)
- + gdb_print_insn (VALUE_ADDRESS (val), stream);
+ next_address = (VALUE_ADDRESS (val)
+ + gdb_print_insn (VALUE_ADDRESS (val), stream,
+ &branch_delay_insns));
break;
default:
/* If the value is a pointer, and pointers and addresses are not the
same, then at this point, the value's length (in target bytes) is
- TARGET_ADDR_BIT/TARGET_CHAR_BIT, not TYPE_LENGTH (type). */
+ gdbarch_addr_bit/TARGET_CHAR_BIT, not TYPE_LENGTH (type). */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- len = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
+ len = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT;
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
fputs_filtered (paddress (addr), stream);
else
{
- int addr_bit = TARGET_ADDR_BIT;
+ int addr_bit = gdbarch_addr_bit (current_gdbarch);
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
release_value (last_examine_value);
print_formatted (last_examine_value, format, size, gdb_stdout);
+
+ /* Display any branch delay slots following the final insn. */
+ if (format == 'i' && count == 1)
+ count += branch_delay_insns;
}
printf_filtered ("\n");
gdb_flush (gdb_stdout);
print_expression (d->exp, gdb_stdout);
annotate_display_expression_end ();
- if (d->format.count != 1)
+ if (d->format.count != 1 || d->format.format == 'i')
printf_filtered ("\n");
else
printf_filtered (" ");