This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/dwarf2] Fix name of include psymtabs, avoid duplicates
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 28 Nov 2004 21:07:47 -0500
- Subject: Re: [RFA/dwarf2] Fix name of include psymtabs, avoid duplicates
- References: <20041017010238.GD20779@gnat.com><20041101194801.GI27334@gnat.com>
Joel Brobecker writes:
> > % gcc -gdwarf-2 -o main foo/main.c
> >
> > When GDB scans the dwarf2 data to create the psymtabs, it scans
> > the linetable for each CU and create "include psymtabs" for it.
> > These psymtabs correspond to the files included from that CU
> > (see call to dwarf2_build_include_psymtabs at the end of
> > dwarf2_build_psymtabs_hard).
> >
> > Unfortunately, a little omission in my part lead to a bug:
> >
> > (gdb) file main
> > (gdb) info sources
> > [...]
> > Source files for which symbols will be read in on demand:
> > [...], main.c, /home/brobecke/tmp/dup/foo/main.c, [...]
This seems easy to add to the testsuite. Just create a subdirectory in
gdb.dwarf2, and issue the above commands.
> > 2004-10-16 Joel Brobecker <brobecker@gnat.com>
> >
> > * dwarf2read.c (dwarf_decode_lines): Use the complete filename
> > when creating include psymtabs.
> >
> > Tested on x86-linux, no regression.
> > OK to apply?
Yes, after you add the test, which should fail before and pass after
your patch.