binutils-gdb/gdb/dwarf2
Caroline Tice 56d467f4ee gdb: handle relative paths to DWO files
DWARF allows .dwo file paths to be relative rather than absolute.

When they are relative, DWARF uses DW_AT_comp_dir to find the .dwo
file.  DW_AT_comp_dir can also be relative, making the entire search
patch for the .dwo file relative.

In this case, GDB currently searches relative to its current working
directory, i.e. the directory from which the debugger was launched,
but not relative to the directory containing the built binary.  This
cannot be right, as the compiler, when generating the relative paths,
knows where it's building the binary but can have no idea where the
debugger will be launched.

The correct thing is to add the directory containing the binary to the
search paths used for resolving relative locations of dwo files. That
is what this patch does.

gdb/ChangeLog:

	* dwarf2/read.c (try_open_dwop_file): Add path for the binary to
	the search paths used resolve relative location of .dwo file.

gdb/testsuite/ChangeLog:

	* gdb.dwarf2/fission-relative-dwo.c: New file.
	* gdb.dwarf2/fission-relative-dwo.exp: New file.
2021-04-07 11:41:50 +01:00
..
abbrev.c
abbrev.h
attribute.c
attribute.h
comp-unit.c Reimplement dwarf_unit_type_name 2021-03-18 12:08:41 -06:00
comp-unit.h
die.h
dwz.c
dwz.h
expr.c
expr.h
frame-tailcall.c
frame-tailcall.h
frame.c Introduce dwarf2/public.h 2021-03-20 17:23:40 -06:00
frame.h
index-cache.c
index-cache.h
index-common.c
index-common.h
index-write.c Change how DWARF index writer finds address map 2021-03-20 17:23:43 -06:00
index-write.h Introduce dwarf2/public.h 2021-03-20 17:23:40 -06:00
leb.c
leb.h
line-header.c
line-header.h
loc.c
loc.h
macro.c
macro.h
public.h Simplify DWARF reader initialization 2021-03-28 10:43:15 -06:00
read.c gdb: handle relative paths to DWO files 2021-04-07 11:41:50 +01:00
read.h gdb: pass objfile_per_bfd_storage instead of objfile to partial_symtab 2021-04-02 11:45:37 -04:00
sect-names.h
section.c gdb: Handle missing .debug_str section 2021-04-07 11:31:30 +01:00
section.h
stringify.c Reimplement dwarf_unit_type_name 2021-03-18 12:08:41 -06:00
stringify.h Fix typo in dwarf2/stringify.h 2021-03-31 09:48:56 -06:00