binutils-gdb/gdb/dwarf2
Simon Marchi 0bc2e38dd7 gdb: fix logic of find_comp_unit and set_comp_unit
The logic in find_comp_unit and set_comp_unit is reversed.  When the BFD
requires relocation, we want to put the comp_unit structure in the
map where the comp_unit objects are not shared, that is the one indexed
by objfile.  If the BFD does not require relocation, then, we can share
a single comp_unit structure for all users of that BFD, so we want to
put it in the BFD-indexed map.  The comments on top of
dwarf2_frame_bfd_data and dwarf2_frame_objfile_data make that clear.

Fix it by swapping the two in find_comp_unit and set_comp_unit.

I don't have a test for this, because I don't see how to write one in a
reasonable amount of time.

gdb/ChangeLog:

	PR gdb/26876
	* dwarf2/frame.c (find_comp_unit, set_comp_unit): Reverse use of
	dwarf2_frame_bfd_data and dwarf2_frame_objfile_data.

Change-Id: I80c1ee7ad8425fa4947de65b170973d05f5a52ec
2020-12-03 15:47:56 -05:00
..
abbrev.c Remove objfile parameter from abbrev_table::read 2020-11-05 18:27:43 -07:00
abbrev.h Remove objfile parameter from abbrev_table::read 2020-11-05 18:27:43 -07:00
attribute.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
attribute.h
comp-unit.c
comp-unit.h
die.h
dwz.c
dwz.h
expr.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
expr.h
frame-tailcall.c
frame-tailcall.h
frame.c gdb: fix logic of find_comp_unit and set_comp_unit 2020-12-03 15:47:56 -05:00
frame.h
index-cache.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
index-cache.h
index-common.c
index-common.h
index-write.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
index-write.h
leb.c
leb.h Rewrite leb.h:read_3_bytes 2020-11-04 08:22:05 -07:00
line-header.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
line-header.h
loc.c [gdb/symtab] Fix gdb.base/vla-optimized-out.exp with clang 2020-11-30 13:50:26 +01:00
loc.h
macro.c gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
macro.h
read.c Search for DWZ files in debug-file-directories as well 2020-12-01 22:03:18 -05:00
read.h gdb, gdbserver, gdbsupport: fix leading space vs tabs issues 2020-11-02 10:28:45 -05:00
section.c
section.h
stringify.c
stringify.h