[gdb/symtab] Support DW_AT_main_subprogram with -readnow.

DW_AT_main_subprogram is supported in normal mode in read_partial_die, but not
in -readnow mode.

Fix this by adding support for DW_AT_main_subprogram in read_func_scope.

Tested on x86_64-linux with native and RFC target board readnow (
https://sourceware.org/ml/gdb-patches/2019-05/msg00073.html ).

gdb/ChangeLog:

2019-06-10  Tom de Vries  <tdevries@suse.de>

	PR symtab/16264
	PR symtab/24517
	* dwarf2read.c (read_func_scope): Handle DW_AT_main_subprogram.
This commit is contained in:
Tom de Vries 2019-06-10 09:28:30 +02:00
parent a72f8c4ce3
commit 81873cc81e
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-06-10 Tom de Vries <tdevries@suse.de>
PR symtab/16264
PR symtab/24517
* dwarf2read.c (read_func_scope): Handle DW_AT_main_subprogram.
2019-06-06 Руслан Ижбулатов <lrn1986@gmail.com>
* source.c (find_and_open_source): Also rewrite relative file

View File

@ -13746,6 +13746,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
newobj->name = new_symbol (die, read_type_die (die, cu), cu,
(struct symbol *) templ_func);
if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu))
set_objfile_main_name (objfile, SYMBOL_LINKAGE_NAME (newobj->name),
cu->language);
/* If there is a location expression for DW_AT_frame_base, record
it. */
attr = dwarf2_attr (die, DW_AT_frame_base, cu);