diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-06-21 15:18:51 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2007-06-21 15:18:51 +0000 |
commit | a4642986412fbd22873bf4f64e4d3ee7c5aeabac (patch) | |
tree | c8fe96b2363a3a8d803409dd965e8094f154958d /gdb/printcmd.c | |
parent | ade28716408576549d6f1998d6baf0d2c5c74b91 (diff) | |
download | gdb-a4642986412fbd22873bf4f64e4d3ee7c5aeabac.zip gdb-a4642986412fbd22873bf4f64e4d3ee7c5aeabac.tar.gz gdb-a4642986412fbd22873bf4f64e4d3ee7c5aeabac.tar.bz2 |
gdb/:
* disasm.c (gdb_print_insn): Return the number of branch delay
slot instructions too.
* disasm.h (gdb_print_insn): Update prototype.
* printcmd.c (branch_delay_insns): New variable to record the
number of delay slot instructions after disassembling a branch.
(print_formatted): Record the number of branch delay slot
instructions.
(do_examine): When disassembling, if the last instruction
disassembled has any branch delay slots, then bump the count so
that they get disassembled too.
* tui/tui-disasm.c (tui_disassemble): Update the call to
gdb_print_insn().
* NEWS: Document the new behaviour.
gdb/doc/:
* gdb.texinfo (Examining Memory): Document the new behaviour.
gdb/gdbtk/:
* generic/gdbtk-cmds.c (gdbtk_load_asm): Update the call to
gdb_print_insn().
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index b03c65e..45d7e8a 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -70,6 +70,10 @@ static char last_size = 'w'; 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; @@ -277,8 +281,9 @@ print_formatted (struct value *val, int format, int size, /* 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: @@ -800,6 +805,10 @@ do_examine (struct format_data fmt, CORE_ADDR addr) 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); |