Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: markus.t.metzger@intel.com
To: jan.kratochvil@redhat.com
Cc: gdb-patches@sourceware.org, markus.t.metzger@gmail.com,
	       Markus Metzger <markus.t.metzger@intel.com>
Subject: [PATCH 2/3] record-btrace, disas: omit pc prefix
Date: Mon, 25 Feb 2013 16:16:00 -0000	[thread overview]
Message-ID: <1361808917-16934-3-git-send-email-markus.t.metzger@intel.com> (raw)
In-Reply-To: <1361808917-16934-1-git-send-email-markus.t.metzger@intel.com>

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


  parent reply	other threads:[~2013-02-25 16:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 16:15 [PATCH 0/3] target record-btrace markus.t.metzger
2013-02-25 16:16 ` [PATCH 3/3] doc, record: document record changes markus.t.metzger
2013-02-26 17:24   ` Eli Zaretskii
2013-03-01 14:07     ` Metzger, Markus T
2013-03-01 14:26       ` Eli Zaretskii
2013-03-01 14:48         ` Metzger, Markus T
2013-03-01 15:12           ` Eli Zaretskii
2013-03-01 15:21             ` Metzger, Markus T
2013-03-02  9:46               ` Eli Zaretskii
2013-02-25 16:16 ` [PATCH 1/3] record, btrace: add record-btrace target markus.t.metzger
2013-02-27  7:38   ` Jan Kratochvil
2013-02-27 19:43     ` Jan Kratochvil
2013-02-28 17:17     ` Metzger, Markus T
2013-03-01  9:26       ` Jan Kratochvil
2013-02-25 16:16 ` markus.t.metzger [this message]
2013-02-27  7:59   ` [PATCH 2/3] record-btrace, disas: omit pc prefix Jan Kratochvil
2013-02-28  7:45     ` Metzger, Markus T
2013-02-28  7:56       ` Jan Kratochvil
2013-02-28  8:45         ` Metzger, Markus T
2013-02-28  8:54           ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361808917-16934-3-git-send-email-markus.t.metzger@intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=markus.t.metzger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox