diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-10-21 18:02:27 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-10-21 18:02:27 +0000 |
commit | 2b28d209243f5b7b19cd5adb37c535328334d3a0 (patch) | |
tree | b53e3600445973fb6c463a4cd1b6313d5c03ba7b /gdb/printcmd.c | |
parent | b54295a7861979f4c863a11ee4bf0cde32f918c1 (diff) | |
download | gdb-2b28d209243f5b7b19cd5adb37c535328334d3a0.zip gdb-2b28d209243f5b7b19cd5adb37c535328334d3a0.tar.gz gdb-2b28d209243f5b7b19cd5adb37c535328334d3a0.tar.bz2 |
2009-10-21 Paul Pluzhnikov <ppluzhnikov@google.com>
* defs.h (pc_prefix): New prototype.
* disasm.c (dump_insns): Mark current instruction.
* printcmd.c (do_examine): Likewise.
(pc_prefix): New function.
* stack.c (print_frame_info): Disassemble entire current line.
doc/ChangeLog:
2009-10-21 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.texinfo (Machine Code): Mention current pc marker.
(Memory): Likewise.
testsuite/ChangeLog:
2009-10-21 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.base/consecutive.exp: Adjust.
* gdb.base/display.exp: Likewise.
* gdb.base/pc-fp.exp: Likewise.
* gdb.base/sigbpt.exp: Likewise.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 8281341..9be742e 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -725,6 +725,26 @@ print_address (struct gdbarch *gdbarch, print_address_symbolic (addr, stream, asm_demangle, " "); } +/* Return a prefix for instruction address: + "=> " for current instruction, else " ". */ + +const char * +pc_prefix (CORE_ADDR addr) +{ + if (has_stack_frames ()) + { + struct frame_info *frame; + CORE_ADDR pc; + + frame = get_selected_frame (NULL); + pc = get_frame_pc (frame); + + if (pc == addr) + return "=> "; + } + return " "; +} + /* Print address ADDR symbolically on STREAM. Parameter DEMANGLE controls whether to print the symbolic name "raw" or demangled. Global setting "addressprint" controls whether to print hex address @@ -817,6 +837,8 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr) while (count > 0) { QUIT; + if (format == 'i') + fputs_filtered (pc_prefix (next_address), gdb_stdout); print_address (next_gdbarch, next_address, gdb_stdout); printf_filtered (":"); for (i = maxelts; |