Message ID | 047d7bfeb318a3caf305195d7da8@google.com |
---|---|
State | New |
Headers | show |
On Thu, 25 Jun 2015 22:30:14 +0200, Doug Evans wrote: > Jan Kratochvil writes: > > On Tue, 23 Jun 2015 22:35:01 +0200, Jan Kratochvil wrote: > > > On Tue, 23 Jun 2015 01:46:08 +0200, Doug Evans wrote: > > > > but it doesn't update sal.section nor sal.line. > > > > > > OK, I agree that seems wrong. > > > > I do not agree, it seems correct to me. > > I was wondering if things were correct, not stating they weren't. Fine with that, just you have convinced me initially there is really a bug. > Fortunately, I think there's a better way: instead of setting > locations_valid check the language at the place where we care. I am sure fine with that. > Ok with this change. Just there is now also [patchv2]. Thanks, Jan
diff --git a/gdb/linespec.c b/gdb/linespec.c index d2089b5..71bab61 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3454,7 +3454,23 @@ minsym_found (struct linespec_state *self, struct objfile *objfile, sal = find_pc_sect_line (pc, NULL, 0); if (self->funfirstline) - skip_prologue_sal (&sal); + { + if (sal.symtab != NULL + && (COMPUNIT_LOCATIONS_VALID (SYMTAB_COMPUNIT (sal.symtab)) + || SYMTAB_LANGUAGE (sal.symtab) == language_asm)) + { + /* If gdbarch_convert_from_func_ptr_addr does not apply then + sal.SECTION, sal.LINE&co. will stay correct from above. + If gdbarch_convert_from_func_ptr_addr applies then + sal.SECTION is cleared from above and sal.LINE&co. will + stay correct from the last find_pc_sect_line above. */ + sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol); + sal.pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, + ¤t_target); + } + else + skip_prologue_sal (&sal); + } if (maybe_add_address (self->addr_set, objfile->pspace, sal.pc))