binutils-gdb/gdb/testsuite/lib
Tom Tromey a7308ce01e Avoid crash on missing dwz file
If DWARF contains a reference to a "dwz" file, but there is no
.gnu_debugaltlink section, then gdb will crash.  This happens because
dwarf2_get_dwz_file will return NULL, but some callers do not expect
this.

This patch changes dwarf2_get_dwz_file so that callers can require a
dwz file.  Then, it updates the callers that are attempting to process
references to the dwz file to require one.

This includes a new testcase.  The dwarf.exp changes don't handle the
new forms exactly correctly -- they are only handled well enough to
let this test case complete.

gdb/ChangeLog
2021-03-06  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.h (dwarf2_get_dwz_file): Add 'require' parameter.
	* dwarf2/read.c (dwarf2_get_dwz_file): Add 'require' parameter.
	(get_abbrev_section_for_cu, read_attribute_value)
	(get_debug_line_section): Update.
	* dwarf2/macro.c (dwarf_decode_macro_bytes): Update.

gdb/testsuite/ChangeLog
2021-03-06  Tom Tromey  <tom@tromey.com>

	* lib/dwarf.exp (_handle_DW_FORM): Treat DW_FORM_GNU_ref_alt and
	DW_FORM_GNU_strp_alt like DW_FORM_sec_offset.
	* gdb.dwarf2/dwznolink.exp: New file.
2021-03-06 09:26:39 -07:00
..
ada.exp
append_gdb_boards_dir.exp
attributes.h
build-piece.exp
cache.exp
check-test-names.exp
cl_util.c
cl_util.h
compile-support.exp
compiler.c
compiler.cc
completion-support.exp
cp-support.exp
d-support.exp
data-structures.exp
dtrace.exp
dwarf.exp Avoid crash on missing dwz file 2021-03-06 09:26:39 -07:00
fortran.exp
future.exp
gdb-guile.exp
gdb-python.exp
gdb-utils.exp
gdb.exp testsuite: extend nopie handling to add -fno-pie to compiler flags 2021-03-03 09:07:49 +01:00
gdbserver-support.exp
gen-perf-test.exp
gnat_debug_info_test.adb
go.exp
jit-elf-helpers.exp
memory.exp
mi-support.exp
my-syscalls.h
my-syscalls.S
objc.exp
opencl_hostapp.c
opencl_kernel.cl
opencl.exp
pascal.exp
pdtrace.in
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c
rust-support.exp
selftest-support.exp
set_unbuffered_mode.c
sym-info-cmds.exp
trace-support.exp
tuiterm.exp
unbuffer_output.c
valgrind.exp Make valgrind tests more robust by adding --wait=1 to vgdb invocation 2021-03-06 02:51:04 +01:00