From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31358 invoked by alias); 25 Feb 2013 16:16:23 -0000 Received: (qmail 31346 invoked by uid 22791); 25 Feb 2013 16:16:20 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Feb 2013 16:16:12 +0000 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 25 Feb 2013 08:15:43 -0800 X-ExtLoop1: 1 Received: from swsutil001.isw.intel.com ([10.237.237.11]) by AZSMGA002.ch.intel.com with ESMTP; 25 Feb 2013 08:15:42 -0800 Received: from ulslx001.iul.intel.com (ulslx001.iul.intel.com [172.28.207.63]) by swsutil001.isw.intel.com (8.13.6/8.13.6/MailSET/Hub) with ESMTP id r1PGFdD7021527; Mon, 25 Feb 2013 16:15:40 GMT Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r1PGFdfe017183; Mon, 25 Feb 2013 17:15:39 +0100 Received: (from mmetzger@localhost) by ulslx001.iul.intel.com with id r1PGFdBm017179; Mon, 25 Feb 2013 17:15:39 +0100 From: markus.t.metzger@intel.com To: jan.kratochvil@redhat.com Cc: gdb-patches@sourceware.org, markus.t.metzger@gmail.com, Markus Metzger Subject: [PATCH 2/3] record-btrace, disas: omit pc prefix Date: Mon, 25 Feb 2013 16:16:00 -0000 Message-Id: <1361808917-16934-3-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1361808917-16934-1-git-send-email-markus.t.metzger@intel.com> References: <1361808917-16934-1-git-send-email-markus.t.metzger@intel.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00630.txt.bz2 From: Markus Metzger 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 * 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