From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7574 invoked by alias); 6 Dec 2011 23:01:42 -0000 Received: (qmail 7565 invoked by uid 22791); 6 Dec 2011 23:01:41 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Tue, 06 Dec 2011 23:01:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pB6N0r2N025131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Dec 2011 18:00:53 -0500 Received: from host2.jankratochvil.net (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pB6N0kYf030636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 6 Dec 2011 18:00:49 -0500 Date: Tue, 06 Dec 2011 23:02:00 -0000 From: Jan Kratochvil To: iam ahal Cc: Tom Tromey , Doug Evans , gdb-patches@sourceware.org, eliz@gnu.org, pmuldoon@redhat.com, brobecker@adacore.com, pedro@codesourcery.com, drow@false.org Subject: Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename) Message-ID: <20111206230045.GA23413@host2.jankratochvil.net> References: <83bowq6x7f.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-12/txt/msg00208.txt.bz2 Hi Eldar, I really miss a testcase here as I had no clue what the settings print in fact. Also I expect you have a compiler producing: <11> DW_AT_name : (indirect string, offset: 0x4d): /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c <15> DW_AT_comp_dir : (indirect string, offset: 0x4d): /home/jkratoch/redhat/gdb-clean/gdb in some case but I do not see how to get such DWARF from Fedora 16 GCC. Therefore to test all the DWARF cases one needs a gdb.dwarf2/ testcase for it. I will write one if you do not want to. One may easily break the behavior with future changes otherwise. The doc should also IMO contain some samples, what is "full filename". I would assume it means /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c but apparently it does not. Test commands expects ./gdb-clean to be FSF GDB HEAD and ./gdb patched gdb. for d in "" $PWD/;do rm -rf 35 35.c 35d 35l.so;mkdir 35d;echo 'extern void f (void); int main (void) { f (); return 0; }' >35.c;echo 'void f (void) {}' >35d/35l.c;gcc -o 35l.so -Wl,-soname,./35l.so -shared -fPIC -Wall -g ${d}35d/35l.c; gcc -o 35 35.c -Wall -g ./35l.so;./gdb-clean -ex 'set break pend on' -q -nx ./35 -ex 'b f' -ex r -ex 'bt' -ex c -ex q | grep ' f ';for i in basename full without-compilation-directory;do echo ---$i;./gdb -ex "set backtrace filename-display $i" -ex 'set break pend on' -q -nx ./35 -ex 'b f' -ex r -ex 'bt' -ex c -ex q | grep ' f ';done;readelf -wi 35l.so|grep -E 'DW_AT_(producer|name|comp_dir)';done gcc 35d/35l.c ... DW_AT_producer : (indirect string, offset: 0x0): GNU C 4.6.2 20111027 (Red Hat 4.6.2-1) -mtune=generic -march=x86-64 -g -fPIC <11> DW_AT_name : (indirect string, offset: 0x71): 35d/35l.c <15> DW_AT_comp_dir : (indirect string, offset: 0x4d): /home/jkratoch/redhat/gdb-clean/gdb - FSF GDB HEAD: #0 f () at 35d/35l.c:1 - set backtrace filename-display basename #0 f () at 35l.c:1 - set backtrace filename-display full #0 f () at 35d/35l.c:1 - set backtrace filename-display without-compilation-directory #0 f () at 35d/35l.c:1 gcc $PWD/35d/35l.c ... DW_AT_producer : (indirect string, offset: 0x0): GNU C 4.6.2 20111027 (Red Hat 4.6.2-1) -mtune=generic -march=x86-64 -g -fPIC <11> DW_AT_name : (indirect string, offset: 0x4d): /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c - FSF GDB HEAD #0 f () at /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c:1 - set backtrace filename-display basename #0 f () at 35l.c:1 - set backtrace filename-display full #0 f () at /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c:1 - set backtrace filename-display without-compilation-directory #0 f () at 35l.c:1 I miss there an option to print the output of symtab_to_fullname which was requested by Red Hat desktop developers, therefore to print: #0 f () at /home/jkratoch/redhat/gdb-clean/gdb/35d/35l.c:1 even if it was compiled as 35d/35l.c and not $PWD/35d/35l.c. Thanks, Jan