diff options
author | Tom Tromey <tromey@redhat.com> | 2013-10-08 19:56:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-10-08 19:56:15 +0000 |
commit | dc294be54c96414035eed7d53dafdea0a6f31a72 (patch) | |
tree | e2ec6dd2f5754858a562b4b7105ab16fd5b302af /gdb/Makefile.in | |
parent | 5bb7df2edfeb80282ce424bc0d32f07713e24220 (diff) | |
download | binutils-dc294be54c96414035eed7d53dafdea0a6f31a72.zip binutils-dc294be54c96414035eed7d53dafdea0a6f31a72.tar.gz binutils-dc294be54c96414035eed7d53dafdea0a6f31a72.tar.bz2 |
fix PR symtab/15597
This patch fixes gdb PR symtab/15597.
The bug is that the .gnu_debugaltlink section includes the build-id of
the alt file, but gdb does not use it.
This patch fixes the problem by changing gdb to do what it ought to
always have done: verify the build id of the file found using the
filename in .gnu_debugaltlink; and if that does not match, try to find
the correct debug file using the build-id and debug-file-directory.
This patch touches BFD. Previously, gdb had its own code for parsing
.gnu_debugaltlink; I changed it to use the BFD functions after those
were introduced. However, the BFD functions are incorrect -- they
assume that .gnu_debugaltlink is formatted like .gnu_debuglink.
However, it it is not. Instead, it consists of a file name followed
by the build-id -- no alignment, and the build-id is not a CRC.
Fixing this properly is a bit of a pain. But, because
separate_alt_debug_file_exists just has a FIXME for the build-id case,
I did not fix it properly. Instead I introduced a hack. This leaves
BFD working just as well as it did before my patch.
I'm willing to do something better here but I could use some guidance
as to what. It seems that the build-id code in BFD is largely punted
on.
FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of
BFD itself.
I moved the build-id logic out of elfread.c and into a new file.
This seemed cleanest to me.
Writing a test case was a bit of a pain. I added a couple new
features to the DWARF assembler to handle this.
Built and regtested on x86-64 Fedora 18.
* bfd-in2.h: Rebuild.
* opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
parameter. Change type of buildid_out. Update.
(get_alt_debug_link_info_shim): New function.
(bfd_follow_gnu_debuglink): Use it.
* Makefile.in (SFILES): Add build-id.c.
(HFILES_NO_SRCDIR): Add build-id.h.
* build-id.c: New file, largely from elfread.c. Modified
most functions.
* build-id.h: New file.
* dwarf2read.c (dwarf2_get_dwz_file): Update for change to
bfd_get_alt_debug_link_info. Verify dwz file's build-id.
Search for dwz file using build-id.
* elfread.c (build_id_bfd_get, build_id_verify)
(build_id_to_debug_filename, find_separate_debug_file): Remove.
* gdb.dwarf2/dwzbuildid.exp: New file.
* lib/dwarf.exp (Dwarf::_section): Add "flags" and "type"
parameters.
(Dwarf::_defer_output): Change "section" parameter to
"section_spec"; update.
(Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New
procs.
Diffstat (limited to 'gdb/Makefile.in')
-rw-r--r-- | gdb/Makefile.in | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 6b8927a..2aa8134 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -717,7 +717,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ bfd-target.c \ block.c blockframe.c \ breakpoint.c break-catch-sig.c break-catch-throw.c \ - buildsym.c \ + build-id.c buildsym.c \ c-exp.y c-lang.c c-typeprint.c c-valprint.c \ charset.c cleanups.c cli-out.c coffread.c coff-pe-read.c \ complaints.c completer.c continuations.c corefile.c corelow.c \ @@ -814,7 +814,8 @@ tui/tui-file.h tui/tui-command.h tui/tui-disasm.h tui/tui-wingeneral.h \ tui/tui-windata.h tui/tui-data.h tui/tui-win.h tui/tui-stack.h \ tui/tui-winsource.h tui/tui-regs.h tui/tui-io.h tui/tui-layout.h \ tui/tui-source.h sol2-tdep.h gregset.h sh-tdep.h sh64-tdep.h \ -expression.h score-tdep.h gdb_select.h ser-tcp.h buildsym.h valprint.h \ +expression.h score-tdep.h gdb_select.h ser-tcp.h \ +build-id.h buildsym.h valprint.h \ typeprint.h mi/mi-getopt.h mi/mi-parse.h mi/mi-console.h \ mi/mi-out.h mi/mi-main.h mi/mi-common.h mi/mi-cmds.h linux-nat.h \ complaints.h gdb_proc_service.h gdb_regex.h xtensa-tdep.h inf-loop.h \ @@ -911,7 +912,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ event-loop.o event-top.o inf-loop.o completer.o \ gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o gdb_obstack.o \ osabi.o copying.o \ - memattr.o mem-break.o target.o parse.o language.o buildsym.o \ + memattr.o mem-break.o target.o parse.o language.o \ + build-id.o buildsym.o \ findcmd.o \ std-regs.o \ signals.o \ |