aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-12-08 15:43:49 +0000
committerYao Qi <yao.qi@linaro.org>2017-12-08 15:43:49 +0000
commit6b05c8bd437152d7a3ecfc19074ab243ee6c92f2 (patch)
tree2f46f8b9f29f503f2fd54909b560336b7db9f625 /gdb/linespec.c
parent336ef6d22a5dba921eed85eb4fa75ed22a02a633 (diff)
downloadgdb-6b05c8bd437152d7a3ecfc19074ab243ee6c92f2.zip
gdb-6b05c8bd437152d7a3ecfc19074ab243ee6c92f2.tar.gz
gdb-6b05c8bd437152d7a3ecfc19074ab243ee6c92f2.tar.bz2
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 <yao.qi@linaro.org> PR breakpionts/22567 * linespec.c (minsym_found): Set sal.section.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c3
1 files changed, 2 insertions, 1 deletions
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);
}