Add a disassembly flag to omit the pc prefix and use it in the "record
authorMarkus Metzger <mmetzger@sourceware.org>
Mon, 11 Mar 2013 08:53:17 +0000 (08:53 +0000)
committerMarkus Metzger <mmetzger@sourceware.org>
Mon, 11 Mar 2013 08:53:17 +0000 (08:53 +0000)
instruction-history" command of record-btrace.

The pc prefix would appear multiple times in the branch trace disassembly,
which is more confusing than helpful.

gdb/
* record-btrace.c (btrace_insn_history): Omit the pc prefix in
the instruction history disassembly.
* disasm.c (dump_insns): Omit the pc prefix, if requested.
* disasm.h (DISASSEMBLY_OMIT_PC): New.

gdb/ChangeLog
gdb/disasm.c
gdb/disasm.h
gdb/record.c

index f1f4611f1a595d24731941701df4688d54946092..62fd574f3938e971eb2a3087359a8b12168e2f3a 100644 (file)
@@ -1,3 +1,10 @@
+2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * record-btrace.c (btrace_insn_history): Omit the pc prefix in
+       the instruction history disassembly.
+       * disasm.c (dump_insns): Omit the pc prefix, if requested.
+       * disasm.h (DISASSEMBLY_OMIT_PC): New.
+
 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
 
        * Makefile.in (SFILES): Add record-btrace.c
index 9d613796e78cada6cee79754990a3296c678ae04..e643c2d9e30da7a1c54cc1a9db8496af2e638692 100644 (file)
@@ -122,7 +122,9 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
            num_displayed++;
        }
       ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-      ui_out_text (uiout, pc_prefix (pc));
+
+      if ((flags & DISASSEMBLY_OMIT_PC) == 0)
+       ui_out_text (uiout, pc_prefix (pc));
       ui_out_field_core_addr (uiout, "address", gdbarch, pc);
 
       if (!build_address_symbolic (gdbarch, pc, 0, &name, &offset, &filename,
index 20ceb2b8c79865125e3ede3f7867ca0cbe8b6c86..3743ccc916bef631233188d15017df2930f661b5 100644 (file)
@@ -23,6 +23,7 @@
 #define DISASSEMBLY_RAW_INSN   (0x1 << 1)
 #define DISASSEMBLY_OMIT_FNAME (0x1 << 2)
 #define DISASSEMBLY_FILENAME   (0x1 << 3)
+#define DISASSEMBLY_OMIT_PC    (0x1 << 4)
 
 struct ui_out;
 struct ui_file;
index 6ac7a56bcd016df52963cf5881d4ed522f3c87ec..6bc1704a25bafb12ed859481711970d8b596c93e 100644 (file)
@@ -411,6 +411,9 @@ get_insn_history_modifiers (char **arg)
            case 'f':
              modifiers |= DISASSEMBLY_OMIT_FNAME;
              break;
+           case 'p':
+             modifiers |= DISASSEMBLY_OMIT_PC;
+             break;
            default:
              error (_("Invalid modifier: %c."), *args);
            }
@@ -691,6 +694,7 @@ Print disassembled instructions stored in the execution log.\n\
 With a /m modifier, source lines are included (if available).\n\
 With a /r modifier, raw instructions in hex are included.\n\
 With a /f modifier, function names are omitted.\n\
+With a /p modifier, current position markers are omitted.\n\
 With no argument, disassembles ten more instructions after the previous \
 disassembly.\n\
 \"record instruction-history -\" disassembles ten instructions before a \