Issue 76193
Summary DWARF with -gmlt and -flto is missing name-mangled C++ symbol names for inlined functions
Labels new issue
Assignees
Reporter bhamiltoncx
    This is part of https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 (DWARF symbols are missing the full C++ name-mangled info when built with `-gmlt`).

I initially fixed https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 by falling back to the STABS table (which has the full C++ name-mangled version of the symbol) when the symbol name stored in DWARF doesn't match the STABS name:

https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4453650

However, that technique doesn't work for inlined functions — they have no entry in the STABS table, so the name-mangled C++ information is simply missing, causing all sorts of challenges e.g. with clustering symbolicated crash traces (you have to handle both the fully name-mangled C++ version as well as the minimal C-style symbol name which is missing namespace and type information).

Here's a repro:

https://gist.github.com/bhamiltoncx/83895a77882c96c081d200cf37505036

You can see the symbol information for `foo::f()` is present in the STABS (since it's marked `noinline`), but `foo::g()` and `foo::h()` are not present in STABS.

In addition, the minimal DWARF information is missing the namespace and type info for `foo::g()` and `foo::h()`:

```
0x00000043:   DW_TAG_subprogram
                DW_AT_name	("g")
                DW_AT_inline	(DW_INL_inlined)

0x00000049:   DW_TAG_subprogram
                DW_AT_name	("h")
                DW_AT_inline	(DW_INL_inlined)

0x00000060:     DW_TAG_inlined_subroutine
                  DW_AT_abstract_origin	(0x0000000000000049 "h")
                  DW_AT_low_pc	(0x0000000100003f80)
                  DW_AT_high_pc	(0x0000000100003f84)
                  DW_AT_call_file	("/Users/benhamilton/test.cc")
                  DW_AT_call_line	(21)
                  DW_AT_call_column	(0x03)

0x00000074:       DW_TAG_inlined_subroutine
                    DW_AT_abstract_origin	(0x0000000000000043 "g")
                    DW_AT_low_pc	(0x0000000100003f80)
                    DW_AT_high_pc	(0x0000000100003f84)
                    DW_AT_call_file	("/Users/benhamilton/test.cc")
                    DW_AT_call_line	(15)
                    DW_AT_call_column	(0x03)
```

I think we'll need to use the name-mangled symbol for inlined functions, since there's no representation of the symbol in the STABS to fall back on in this case.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to