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 Minor simplification in abbrev_table::read 2020-02-08 13:43:24 -07:00
abbrev.h Use htab_up in abbrev_table 2020-02-08 13:43:24 -07:00
attribute.c Change attr_form_is_block to be a method 2020-02-08 13:40:57 -07:00
attribute.h Change attr_form_is_block to be a method 2020-02-08 13:40:57 -07:00
comp-unit.c Convert read_address to a method on comp_unit_head 2020-02-08 13:43:24 -07:00
comp-unit.h Convert read_address to a method on comp_unit_head 2020-02-08 13:43:24 -07:00
expr.c Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
expr.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
frame-tailcall.c Return unique_xmalloc_ptr from call_site_find_chain 2020-02-14 12:38:04 -07:00
frame-tailcall.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
frame.c Find tailcall frames before inline frames 2020-03-03 15:27:04 -07:00
frame.h Don't forward-declare struct objfile in dwarf2/frame.h 2020-02-11 17:57:46 -07:00
index-cache.c Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-cache.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-common.c Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-common.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
index-write.c Remove casts from dwarf2/index-write.c 2020-02-26 15:49:50 -07:00
index-write.h Move DWARF code to dwarf2/ subdirectory 2020-02-08 13:40:59 -07:00
leb.c Move read_offset_1 to leb.c 2020-02-08 13:43:24 -07:00
leb.h Move two more functions to dwarf2/leb.h 2020-02-08 13:43:24 -07:00
line-header.c Move DWARF line_header to new file 2020-02-08 13:43:24 -07:00
line-header.h Move DWARF line_header to new file 2020-02-08 13:43:24 -07:00
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 Change section functions to be methods of dwarf2_section_info 2020-02-08 13:40:55 -07:00
section.h Convert dwarf2_section_size to a method 2020-02-08 13:43:24 -07:00