From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Firefox/1.0.2 Fedora/1.0.2-3
Description of problem:
This bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19769
[4.0 Regression] GCC produces wrong dwarf2 output that breaks gdb
- or something with the same symptom - is making it impossible for me to debug natively-built Java code. Please could you apply the fix given in the above PR, assuming you haven't applied it already.
Version-Release number of selected component (if applicable):
gcc-java-4.0.0-0.38
How reproducible:
Always
Steps to Reproduce:
1. Try to debug Java code built with the above version of gcc-java, in gdb.
Actual Results: ../../gdb-6.3/gdb/dwarf2read.c:5446: internal-error: could not find partial DIE in cache
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y
../../gdb-6.3/gdb/dwarf2read.c:5446: internal-error: could not find partial DIE in cache
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Expected Results: No error
Additional info:
gdb-6.3.0.0-0.29

PR19769 is fixed in 4.0.0-0.36 and above (and 4.0.0-0.30 .. -0.35 had a
workaround in the headers).
I can debug Java compiled programs just fine with 4.0.0-0.39, you'll need
to be more specific on what exactly you compiled and what you are doing in
the debugger.

I am hitting it with both Java and C++ programs. Here's an easy example: install
firefox and firefox-debuginfo from rawhide. Then edit /usr/bin/firefox and change
MOZARGS=
to
MOZARGS=-g
Run firefox, click Run in ddd, and observe that gdb crashes (usually with this
DWARF error, although sometimes it just aborts.)
This is on fc4test1.

So I ran
strace -e trace=file -p `pidof gdb`
and I found that gdb is consistently crashing after it reads the file
/usr/lib/debug//usr/lib/firefox-1.0.2/components/libxpconnect.so.debug (see
attachment)

And sure enough, it is that file. (The build date for firefox-1.0.2-3 is given
as Mon 28 Mar 2005 21:22:05 BST, by the way.)
# gdb /usr/lib/firefox-1.0.2/components/libxpconnect.so
GNU gdb Red Hat Linux (6.3.0.0-1.10rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
../../gdb-6.3/gdb/dwarf2read.c:5446: internal-error: could not find partial DIE
in cache
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y
../../gdb-6.3/gdb/dwarf2read.c:5446: internal-error: could not find partial DIE
in cache
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n