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

Daniel Jacobowitz
2008-07-03T16:01:38Z

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.
> As you have to be aware of such solution it may have some drawbacks.
>
> (It does not solve the multiple minimal symbols with the same name as was in:
> http://sourceware.org/ml/gdb-patches/2008-05/msg00190.html
> )

I can't see how this works, unless you're getting lucky. 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.

I think Apple kept a list of inlined instances attached to the main
symbol entry for the function. That's probably the way to go, but it
requires support for functions in the symbol table that don't have any
associated block (in case no copy is emitted out of line). I tried
that once and got tangled up; crashes everywhere.

--
Daniel Jacobowitz
CodeSourcery