This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: -file-list-exec-source-files
- From: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- To: bob at brasko dot net, schwab at suse dot de
- Cc: eliz at gnu dot org, ezannoni at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Tue, 29 Jun 2004 00:57:14 -0400 (EDT)
- Subject: Re: -file-list-exec-source-files
bob> The patch below checks symtab_to_fullname's return value against NULL.
bob> Even though this is the "trivial" fix, I believe it is the correct
bob> patch. When I added these calls recently, I blindly changed the old call
bob> to symtab_to_fullname, and the old call did not return NULL.
First, I had a formatting problem with the patch. By the time
I got it, the patch had no tabs, and it looked like the tabs
were expanded to 4 spaces each (instead of 8 spaces). No big deal,
I just applied the changes by hand.
I ran this patch in my test bed and it fixed the problem for me. It
also has no regressions in any other tests.
As usual, my test bed is: native i686-pc-linux-gnu, red hat 8.0,
gcc 2.95.3 and gcc 3.3.3, dwarf-2 and stabs+.
I discovered a subtle interaction between my testbed, selftest.exp,
and this bug. Unlike most people, I don't run the test suite in
the build directory. My script runs the test suite in a fresh
'test' directory for each run. The 'test' directory has a fresh
copy of the build/gdb/testsuite directory (which is actually just
a framework), but it does not have build/gdb itself. And indeed
I remove everything in the build/ tree except for the testsuite/
subtree to save space.
When I make that removal, I get the crash. No removal, no crash.
I think that's why symtab_to_fullname returns NULL for me. I don't have
any more objfiles for gdb itself. And it happens only in selftest.exp,
because selftest.exp is special.
I'm not qualified to say whether this is the *right* fix but it
fixes the problem for me.
Michael C
===
2004-06-28 Bob Rossi <bob@brasko.net>
* symtab.c (lookup_symtab): check return value of symtab_to_fullname