binutils-gdb/gdb/dwarf2
Tom de Vries 1c33af7764 [gdb] Fix segv in "maint print symbols" for ada exec
When using the executable from test-case gdb.ada/access_to_packed_array.exp
(read-in using -readnow) and printing the symbols using "maint print symbols",
we run into a segv:
...
$ gdb -readnow -batch access_to_packed_array/foo -ex "maint print symbols"
   ...
     info: array (<>) of character; computed at runtime
     ptr: range 0 .. 2147483647; computed at runtime
Aborted (core dumped)
...

What happens is that dwarf2_evaluate_property gets called and sets the local
frame variable to the current frame, which happens to be NULL.  Subsequently
the PROP_LOCLIST handling code is executed, where get_frame_address_in_block
gets called with argument NULL, and the segv is triggered.

Fix this by handling a NULL frame in the PROP_LOCLIST handling code in
dwarf2_evaluate_property.

Build and reg-tested on x86_64-linux.

gdb/ChangeLog:

2020-03-11  Tom de Vries  <tdevries@suse.de>

	* dwarf2/loc.c (dwarf2_evaluate_property): Handle NULL frame in
	PROP_LOCLIST handling code.

gdb/testsuite/ChangeLog:

2020-03-11  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/access_to_packed_array.exp: Test printing of expanded
	symtabs.
2020-03-11 00:30:54 +01:00
..
abbrev.c
abbrev.h
attribute.c
attribute.h
comp-unit.c
comp-unit.h
expr.c
expr.h
frame-tailcall.c
frame-tailcall.h
frame.c Find tailcall frames before inline frames 2020-03-03 15:27:04 -07:00
frame.h
index-cache.c
index-cache.h
index-common.c
index-common.h
index-write.c Remove casts from dwarf2/index-write.c 2020-02-26 15:49:50 -07:00
index-write.h
leb.c
leb.h
line-header.c
line-header.h
loc.c [gdb] Fix segv in "maint print symbols" for ada exec 2020-03-11 00:30:54 +01:00
loc.h Move more declarations from dwarf2/loc.h to dwarf2/read.h 2020-02-26 09:36:44 -05:00
read.c gdb: Add support for tracking the DWARF line table is-stmt field 2020-03-10 22:32:07 +00:00
read.h Move more declarations from dwarf2/loc.h to dwarf2/read.h 2020-02-26 09:36:44 -05:00
section.c
section.h