Re: [PATCH] Fix setting-breakpoints regression on PPC64 (function descriptors)

Pedro Alves
2017-12-08T11:34:59Z

On 12/08/2017 09:44 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> @@ -4309,22 +4309,16 @@ minsym_found (struct linespec_state *self, struct objfile *objfile,
>> struct minimal_symbol *msymbol,
>> std::vector<symtab_and_line> *result)
>> {
>> - struct gdbarch *gdbarch = get_objfile_arch (objfile);
>> - CORE_ADDR pc;
>> struct symtab_and_line sal;
>>
>> - if (msymbol_is_text (msymbol))
>> - {
>> - sal = find_pc_sect_line (MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
>> - (struct obj_section *) 0, 0);
>> - sal.section = MSYMBOL_OBJ_SECTION (objfile, msymbol);
>
> This line is removed, so that sal.section can be null. It causes
> PR 22567. How is the patch below?

That's fine with me. I guess we end up with the wrong section
in the function descriptor / PPC64 case (".opd" instead of some kind
of ".text" where the resolved function lives), but it shouldn't
matter, since the old code did that as well, AFAICT.

(I noticed that get_sal_arch doesn't consider sal.objfile, probably
because it predates addition of the 'obfile' field. We could probably
fill in / use that field more, but we don't need to do that now.)

Pedro Alves