Subject: Re: [Gdb-discuss] Dwarf Error: Cannot find referent at offset XXXXXX
To: Sachidananda Swain <sachidananda@kyocera-wireless.com>
From: Jim Blandy <jimb@redhat.com>
List: port-arm
Date: 09/08/2004 11:26:26
Sachidananda Swain <sachidananda@kyocera-wireless.com> writes:
> I am working on GDB for debugging. Tried with all gdb version and in all
> cases I am getting Dwarf error. Please tell me how to overcome this error.
> What I feel that there may be mismatching of dwarf format between ads
> compiler and gdb. I saw so many numbers of people facing this problem. So
> tell be very frankly that this problem can be solved or not; otherwise I
> have to close this project because I am in a deadline. If any where I am
> doing mistake please tell me how to do this. Once I can able to communicate
> >From host with all commands then I will start writing gdb-stub for target
> side. I will be waiting for u r reply.

I'm not familiar with the ADS compiler; it may be generating Dwarf 2
information that GDB cannot handle.  The Dwarf 2 information in an
executable's .debug_info section is divided into a series of
"compilation units".  Each compilation unit is a tree of "DIEs"
(Debugging Information Entries)".  Dwarf 2 allows dies in one
compilation unit to point to dies in other compilation units, but GDB
does not support this yet.

You might try running 'readelf -wi' on your executable, and looking at
the die for the variable you're trying to print.  If it includes a
reference printed as '<#number>' instead of '<number>', then that is
an inter-compilation-unit reference.

If that is the case, then you might check out the GDB branch
"drow_intercu-20040221-branch" and try that debugger.  Follow the
instructions to login on this page:

  http://sources.redhat.com/gdb/current

and then check out the sources using this command:

  cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/src co -r drow_intercu-20040221-branch gdb+dejagnu

I'd be interested to see the output from 'readelf -wi'; if it's not
too huge, could you post it here?