From: Benjamin Gilbert <bgilbert@backtick.net>
To: gdb@sourceware.org
Cc: jon.turney@dronecode.org.uk
Subject: Trying to get GDB to find PE symbol file via build-id
Date: Sun, 08 Mar 2015 22:57:00 -0000 [thread overview]
Message-ID: <CAFKqAcSMNCqZ8cu80XTXkysw_8GZcPvMoSCFu=D=YU49o7zEMw@mail.gmail.com> (raw)
[re-sent due to Gmail HTMLification]
Hi all,
I'm trying to build a Win32 DLL with separate debug symbols, but I
can't seem to get GDB to automatically load a symbol file using the PE
build-id support added in ld 2.25. I'm running on Fedora 21 x86_64,
with a gdb built from binutils-gdb HEAD (3e95021) and configured with
"--target=i686-w64-mingw32".
What I'm doing:
1. Cross-build the DLL with MinGW-w64 and LDFLAGS="-Wl,--build-id".
2. Create stripped DLL with "i686-w64-mingw32-objcopy -S
unstripped.dll stripped.dll".
3. Create symbol file with "i686-w64-mingw32-objcopy
--only-keep-debug unstripped.dll debug/.build-id/MM/NNNN.debug", where
"MMNNNN" is the hex string returned by "i686-w64-mingw32-objdump -p
unstripped.dll | grep signature".
4. In i686-w64-mingw32-gdb, run "set debug-file-directory debug" and
"file stripped.dll".
Result: "Reading symbols from stripped.dll...(no debugging symbols
found)...done."
An strace of the gdb process shows that it doesn't try to access any
.debug files in debug/, so the problem isn't that I used the wrong
filename. Manually loading the symbol file with "symbol-file
debug/.build-id/MM/NNNN.debug" does work.
Advice? Am I going about this wrong?
Thanks,
--Benjamin Gilbert
next reply other threads:[~2015-03-08 22:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-08 22:57 Benjamin Gilbert [this message]
[not found] <CAFKqAcT3qbRGNrczTyPpVW7vrm2GhVUbWVuhupn1YYwEQCOomA@mail.gmail.com>
2015-03-09 16:44 ` Jon TURNEY
2015-03-16 15:41 ` Jon TURNEY
2015-03-19 5:05 ` Benjamin Gilbert
2015-03-19 6:31 ` asmwarrior
2015-03-19 6:53 ` asmwarrior
2015-03-19 12:23 ` Jon TURNEY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFKqAcSMNCqZ8cu80XTXkysw_8GZcPvMoSCFu=D=YU49o7zEMw@mail.gmail.com' \
--to=bgilbert@backtick.net \
--cc=gdb@sourceware.org \
--cc=jon.turney@dronecode.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).