Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: iam ahal <hal9000ed2k@gmail.com>
Cc: Tom Tromey <tromey@redhat.com>, Doug Evans <dje@google.com>,
	       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)
Date: Tue, 06 Dec 2011 23:02:00 -0000	[thread overview]
Message-ID: <20111206230045.GA23413@host2.jankratochvil.net> (raw)
In-Reply-To: <CAA18ubLKqCCsH6H7mj-nK3cjWKS1g_rbJr9EbG8COY3S+GChxQ@mail.gmail.com>

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 ...
    <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 ...
    <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


  parent reply	other threads:[~2011-12-06 23:01 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-26 20:00 iam ahal
2011-06-26 20:49 ` Phil Muldoon
2011-06-27 16:00   ` Joel Brobecker
2011-06-27 16:18     ` Phil Muldoon
2011-06-28 20:08     ` Tom Tromey
2011-06-28 22:36       ` Phil Muldoon
2011-07-03 18:12         ` iam ahal
2011-07-03 21:13           ` Eli Zaretskii
2011-07-04 11:26             ` iam ahal
2011-07-04 12:05               ` Eli Zaretskii
2011-07-04 21:47                 ` Joel Brobecker
2011-07-05  4:35                   ` Eli Zaretskii
2011-07-19 14:43                     ` Pedro Alves
2011-07-05  8:38                   ` iam ahal
2011-07-19 14:19                   ` Pedro Alves
2011-07-17 19:24                 ` iam ahal
2011-07-19 13:28                   ` iam ahal
2011-07-19 17:04                     ` Eli Zaretskii
2011-07-24 21:12                       ` iam ahal
2011-07-26 14:17                         ` iam ahal
2011-07-28 15:34                         ` Tom Tromey
2011-07-28 15:57                           ` Tom Tromey
2011-07-28 16:36                             ` Joel Brobecker
2011-07-28 17:39                               ` Tom Tromey
2011-07-28 17:51                           ` Tom Tromey
2011-07-29 12:01                             ` Joel Brobecker
2011-07-29 12:36                             ` Eli Zaretskii
2011-08-02 19:41                           ` iam ahal
2011-08-03 17:45                             ` Tom Tromey
2011-10-30 19:52                               ` iam ahal
2011-11-02 19:06                                 ` Tom Tromey
2011-11-02 22:53                                 ` Doug Evans
2011-12-04 15:52                                   ` iam ahal
2011-12-04 16:55                                     ` Eli Zaretskii
2011-12-04 18:41                                       ` iam ahal
2011-12-04 19:01                                         ` Pedro Alves
2011-12-04 19:56                                           ` Eli Zaretskii
2011-12-04 21:00                                             ` Pedro Alves
2011-12-05  3:54                                               ` Eli Zaretskii
2011-12-05  5:17                                                 ` Eli Zaretskii
2011-12-06 13:03                                                   ` Pedro Alves
2011-12-06 14:04                                                     ` Eli Zaretskii
2011-12-06 18:00                                                       ` Doug Evans
2011-12-06 20:45                                                       ` Tom Tromey
2011-12-07  8:00                                                         ` Eli Zaretskii
2012-03-10 20:15                                                           ` iam ahal
2012-03-11  1:22                                                             ` asmwarrior
2012-03-12 13:10                                                               ` iam ahal
2012-03-14 16:11                                                             ` Tom Tromey
2012-03-14 16:27                                                             ` Jan Kratochvil
2012-03-14 17:40                                                             ` Eli Zaretskii
2012-03-15 22:46                                                             ` Jan Kratochvil
2012-03-18 18:30                                                               ` iam ahal
2012-03-18 18:35                                                                 ` Jan Kratochvil
2012-04-06 14:22                                                                   ` Jan Kratochvil
2012-03-18 20:46                                                                 ` Eli Zaretskii
2012-03-25 19:27                                                                   ` iam ahal
2012-03-25 19:31                                                                     ` Jan Kratochvil
2012-03-25 21:23                                                                     ` Eli Zaretskii
2011-12-06 12:50                                                 ` Pedro Alves
2011-12-06 20:40                                     ` Tom Tromey
2011-12-06 23:02                                     ` Jan Kratochvil [this message]
2011-07-29 13:35                         ` Jan Kratochvil
2011-08-01 18:04                           ` Tom Tromey
2011-06-29 10:09       ` Andrew Burgess
2011-06-29 16:06       ` Joel Brobecker
2011-07-03 18:15     ` Daniel Jacobowitz
2011-06-28 20:08   ` Tom Tromey
2012-04-09 15:39 ` 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=20111206230045.GA23413@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=dje@google.com \
    --cc=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hal9000ed2k@gmail.com \
    --cc=pedro@codesourcery.com \
    --cc=pmuldoon@redhat.com \
    --cc=tromey@redhat.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