[RFA/DWARF v2] Fix breakpoint add on inlined function using function name.

Joel Brobecker brobecker@adacore.com
Fri Dec 22 02:59:00 GMT 2017

> Why doesn't the same happen in the Ada case?  The debug info in the Ada
> program looks similar, so a partial symbol should be created for this DIE:
>  <1><77b>: Abbrev Number: 2 (DW_TAG_subprogram)
>     <77c>   DW_AT_external    : 1
>     <77c>   DW_AT_name        : (indirect string, offset: 0xae3):
> b__read_small
>     <780>   DW_AT_decl_file   : 2
>     <781>   DW_AT_decl_line   : 3
>     <782>   DW_AT_inline      : 3       (declared as inline and inlined)
> Then, when we set the breakpoint, I would expect GDB to find the partial
> symbol for read_small in this objfile, expand it to full symbols, and then
> find the inlined instance, just as it does for C.  That's the difference I
> don't get.

That's the abstract instance of the inlined subprogram. You might
notice that it has a DW_AT_inline attribute, and nothing else.
This DIE is there as the parent for the DIE(s) that represent
the instance(s) where the function was actually inlined:

 <2><1547>: Abbrev Number: 4 (DW_TAG_inlined_subroutine)
    <1548>   DW_AT_abstract_origin: <0x1526>
    <154c>   DW_AT_low_pc      : 0x402552
    <1554>   DW_AT_high_pc     : 0x2b
    <155c>   DW_AT_call_file   : 1
    <155d>   DW_AT_call_line   : 5

This DIE is the one that represents one concrete instance
of the inlined function. You can see that it has a
DW_AT_abstract_origin attribute which points to the abstract
instance (so we can "inherit" some of the attributes that
are common to all concrete instances), and then the attributes
specific to this inlined instance, such as location, and
more important of all, the low/high_pc.


More information about the Gdb-patches mailing list