Re: [FYI] Inlining support, rough patch [break-by-function-name]

Jan Kratochvil
2008-07-12T07:41:09Z

On Thu, 03 Jul 2008 18:01:02 +0200, Daniel Jacobowitz wrote:
> On Thu, Jul 03, 2008 at 01:21:48PM +0200, Jan Kratochvil wrote:
> > On Wed, 02 Jul 2008 21:14:38 +0200, Daniel Jacobowitz wrote:
> > ...
> > > Let's wait on that until the rest of the patch is ready, though.
> > > I'm making good progress.
> >
> > That would be great, while discussing the uncommitted patches here is one on
> > top of it to make `break inlined_function' work with the multi-PC breakpoints.
...
> I can't see how this works, unless you're getting lucky.

The only risk is code in multiple sections - but for non-embedded targets all
the final linked regular code possibly containing inlined concrete instances
is in .text.

> For instance
> here:
> > @@ -5692,7 +5692,7 @@ resolve_sal_pc (struct symtab_and_line *
> > bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab);
> > if (bv != NULL)
> > {
> > - sym = block_linkage_function (b);
> > + sym = block_function (b);
> > if (sym != NULL)
> > {
> > fixup_symbol_section (sym, sal->symtab->objfile);
>
> fixup_symbol_section is a symbol lookup. There has to be a real
> function in the ELF symbol table with the same name, and here that
> may be in a different section entirely.

This problem should be fixed since:
[commit] Handle minimal symbols pointing to function descriptors
http://sourceware.org/ml/gdb-patches/2008-05/msg00120.html
fixup_section():
- if (msym)
+ /* First, check whether a minimal symbol with the same name exists
+ and points to the same address. The address check is required
+ e.g. on PowerPC64, where the minimal symbol for a function will
+ point to the function descriptor, while the debug symbol will
+ point to the actual function code. */
+ if (msym
+ && SYMBOL_VALUE_ADDRESS (msym) == ginfo->value.address)

Which is followed by `ginfo->value.address' lookup in the section table.

Thanks for the problem notice,
Jan