This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB question
- From: Hendrik Greving <hendrik dot greving dot intel at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb at sourceware dot org
- Date: Fri, 4 Oct 2013 12:55:49 -0700
- Subject: Re: GDB question
- Authentication-results: sourceware.org; auth=none
- References: <CANc4vhqz5=kcW7WcDA+-=zJChPoUqAd14s8K8vjK=E3Oz1YN-g at mail dot gmail dot com> <877gdssy86 dot fsf at fleche dot redhat dot com>
I am using GCC 4.8.1, but the backend is proprietary. I am forcing
dwarf_version==2 and dwarf_strict==1 in the backend (equivalent to
-gdwarf-2 -gstrict-dwarf).
The exact error message was "DW_FORM_strp pointing outside of
.debug_str section".
I just learned that when using -fno-merge-debug-strings throughout
compiling, the error is gone. It looks like something in my tool-chain
was incorrectly merging or compressing .debug_str without properly
adjusting DW_FORM_strp offsets. I am still trying to find out who
screws it up. It is possible that our BFD port is buggy as well.
My (ported!) binutils version is 2.23.2.
On Fri, Oct 4, 2013 at 11:11 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hendrik" == Hendrik Greving <hendrik.greving.intel@gmail.com> writes:
>
> Hendrik> Our (old-) GDB can't read linked executables
> Hendrik> due to DW_FORM_strp offset issues.
>
> It's best to post the exact error message.
>
> Hendrik> a) is there any way to make an old GDB work with DWARF2 generated by a
> Hendrik> new GCC (own backend, but forced to DWARF2). My understanding was that
> Hendrik> as long as we force DWARF2, this should work. It looks like that there
> Hendrik> are e.g. issues with indirect string offsets as described above, is
> Hendrik> this something one can solve or are there old DWARF2 and new DWARF2
> Hendrik> versions that are completely incompatible?
>
> You don't mention how you force this or what version of GCC you are using.
> Make sure you use -gstrict-dwarf, assuming your version has this.
>
> I don't recall a particular bug fix with DW_FORM_strp; but you can
> search the logs.
>
> Hendrik> b) does GDB abort reading the symbol table completely when
> Hendrik> encountering an error? I am wondering why there is no symbol table
> Hendrik> loaded at all (No symbol table is loaded. Use the "file" command.)
>
> Yeah, it pretty much does. And I think in earlier versions it went even
> further and dropped the whole objfile.
>
> Tom