From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22358 invoked by alias); 17 Oct 2012 18:25:27 -0000 Received: (qmail 22317 invoked by uid 22791); 17 Oct 2012 18:25:25 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Oct 2012 18:25:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HIPA6A028340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Oct 2012 14:25:11 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9HICWcH003926; Wed, 17 Oct 2012 14:12:33 -0400 Message-ID: <507EF510.2050000@redhat.com> Date: Wed, 17 Oct 2012 18:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0 MIME-Version: 1.0 To: Andrew Burgess CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Display full file path in MI style disassembly listing References: <506DB4B8.5030001@broadcom.com> In-Reply-To: <506DB4B8.5030001@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-10/txt/msg00296.txt.bz2 On 10/04/2012 05:09 PM, Andrew Burgess wrote: > When producing an MI style disassembly listing we use the shorted symtab filename, rather than computing the fullname. This can make it harder for an MI consumer to figure out which file to open. > > The patch below tries to use the fullname when it can, and falls back to the shorter name if it can't figure out the full name. > > Ok to apply? At least with breakpoints, we leave "file" to whatever is recorded in the symtab, and output a "fullname" MI field in addition, with whatever GDB resolves as the file's path in the filesystem using its current source location rules: b main &"b main\n" ~"Breakpoint 6 at 0x457ceb: file ../../src/gdb/gdb.c, line 29.\n" =breakpoint-created,bkpt={number="6",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000457ceb",func="main",file="../../src/gdb/gdb.c",fullname="/home/pedro/gdb/mygit/src/gdb/gdb.c",line="29",times="0",original-location="main"} I'd think it better to be consistent here. > > Thanks, > Andrew > > gdb/ChangeLog > > 2012-10-04 Andrew Burhess > > * source.c (print_source_lines_base): Display full file name when > producing MI style disassembly listings. > > diff --git a/gdb/source.c b/gdb/source.c > index 31e104f..2a02382 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -1298,9 +1298,19 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror) > } > else > { > + char *filename; > + > + filename = s->fullname; > + if (filename == NULL) > + { > + filename = symtab_to_fullname (s); > + if (filename == NULL) > + filename = s->filename; > + } > + > ui_out_field_int (uiout, "line", line); > ui_out_text (uiout, "\tin "); > - ui_out_field_string (uiout, "file", s->filename); > + ui_out_field_string (uiout, "file", filename); > ui_out_text (uiout, "\n"); > } > > -- Pedro Alves