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/disasm.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/disasm.c')
-rw-r--r-- | gdb/disasm.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/disasm.c b/gdb/disasm.c index 168d7ee..ed885c6 100644 --- a/gdb/disasm.c +++ b/gdb/disasm.c @@ -387,11 +387,24 @@ gdb_disassembly (struct ui_out *uiout, } /* Print the instruction at address MEMADDR in debugged memory, - on STREAM. Returns length of the instruction, in bytes. */ + on STREAM. Returns the length of the instruction, in bytes, + and, if requested, the number of branch delay slot instructions. */ int -gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream) +gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream, + int *branch_delay_insns) { - struct disassemble_info di = gdb_disassemble_info (current_gdbarch, stream); - return gdbarch_print_insn (current_gdbarch, memaddr, &di); + struct disassemble_info di; + int length; + + di = gdb_disassemble_info (current_gdbarch, stream); + length = gdbarch_print_insn (current_gdbarch, memaddr, &di); + if (branch_delay_insns) + { + if (di.insn_info_valid) + *branch_delay_insns = di.branch_delay_insns; + else + *branch_delay_insns = 0; + } + return length; } |