This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/3] record-btrace, disas: omit pc prefix


From: Markus Metzger <markus.t.metzger@intel.com>

Add a disassembly flag to omit the pc prefix and use it in the "record
instruction-history" command of record-btrace.

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

2013-02-25 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.


---
 gdb/disasm.c        |    4 +++-
 gdb/disasm.h        |    1 +
 gdb/record-btrace.c |    3 +++
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gdb/disasm.c b/gdb/disasm.c
index 9d61379..e643c2d 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -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,
diff --git a/gdb/disasm.h b/gdb/disasm.h
index 20ceb2b..3743ccc 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -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;
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index e43b687..0e0e976 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -415,6 +415,9 @@ btrace_insn_history (struct btrace_thread_info *btinfo, struct ui_out *uiout,
 
   gdbarch = target_gdbarch ();
 
+  /* We don't want to print the pc prefix in the branch trace.  */
+  flags |= DISASSEMBLY_OMIT_PC;
+
   for (idx = begin; idx < end; ++idx)
     {
       struct btrace_inst *inst;
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]