From: Yao Qi Date: Fri, 8 Dec 2017 15:43:49 +0000 (+0000) Subject: Fix PR 22567: set SAL .section in minsym_found X-Git-Tag: gdb-8.1-release~214 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b05c8bd437152d7a3ecfc19074ab243ee6c92f2;p=external%2Fbinutils.git Fix PR 22567: set SAL .section in minsym_found PR 22567 is that breakpoint location can't correct gdbarch from SAL, because its fields .section and .symtab is NULL. We use to have code setting .section, but was removed by 4024cf2 - if (msymbol_is_text (msymbol)) + CORE_ADDR func_addr; + if (msymbol_is_function (objfile, msymbol, &func_addr)) { - sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol), - (struct obj_section *) 0, 0); - sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol); this patch adds this back by moving it to the common place at the bottom of the function. gdb: 2017-12-08 Yao Qi PR breakpionts/22567 * linespec.c (minsym_found): Set sal.section. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c96636..56acf30 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-12-08 Yao Qi + + PR breakpionts/22567 + * linespec.c (minsym_found): Set sal.section. + 2017-12-08 Andreas Arnez * configure.tgt (s390*-*-linux*): Add symfile-mem.o. diff --git a/gdb/linespec.c b/gdb/linespec.c index 09758762..8c36f2a 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -4365,9 +4365,10 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, sal.objfile = objfile; sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol); sal.pspace = current_program_space; - sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol); } + sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol); + if (maybe_add_address (self->addr_set, objfile->pspace, sal.pc)) add_sal_to_sals (self, result, &sal, MSYMBOL_NATURAL_NAME (msymbol), 0); }