[Bug binutils/29192] New: addr2line suspected incompatibility with DWARF5

2022-05-27 Thread ofekshilon at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29192

Bug ID: 29192
   Summary: addr2line suspected incompatibility with DWARF5
   Product: binutils
   Version: 2.38
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ofekshilon at gmail dot com
  Target Milestone: ---

==Example:
$ cat toy.cpp
#include 
int main() {
std::cout << "hello world";
return 0;
}
$ clang-14 -g -stdlib=libc++ -lc++ -I/usr/lib/llvm-14/include/c++/v1 toy.cpp -o
toy14
$ addr2line -fe ./toy 0x1234
addr2line: DWARF error: invalid or unhandled FORM value: 0x25
main
??:?
=end example

According to the dwarf5 spec (https://dwarfstd.org/doc/DWARF5.pdf), section
7.5.6 page 221, 0x25 is a valid DW_FORM value:

  DW_FORM_strx1 ‡ 0x25 string.


In other cases (not yet reduced to a small repro) we see:
  addr2line: Dwarf Error: Could not find abbrev number 127

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/29192] addr2line suspected incompatibility with DWARF5

2022-05-27 Thread ofekshilon at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29192

--- Comment #1 from Ofek Shilon  ---
(1) Sorry, typo in the example -
instead of
$ addr2line -fe ./toy 0x1234
should be -
$ addr2line -fe ./toy14 0x1234

Also, just verified that if I build with `-fdebug-default-version=4` the error
disappears and lines are displayed properly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/32408] New: C++filt fails to demangle some gcc-generated template mangled names

2024-12-03 Thread ofekshilon at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=32408

Bug ID: 32408
   Summary: C++filt fails to demangle some gcc-generated template
mangled names
   Product: binutils
   Version: 2.42
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ofekshilon at gmail dot com
  Target Milestone: ---

`fun` from this c++ snippet:
```
#include 
#include 

template 
void fun(I i)
{
std::puts("foo()");
}
```

is mangled by gcc to `_Z3funITkSt8integralcEvT_`, and c++filt fails to demangle
it:

   $ c++filt _Z3funITkSt8integralcEvT_
   _Z3funITkSt8integralcEvT_


godbolt link: https://godbolt.org/z/hcdh67Y5x


BTW when such a template is a specialization of a more general one, the mangled
name has an additional suffix (but c++filt still fails to demangle it). Here:
https://godbolt.org/z/4jMKqjcnc , the mangled name is
_Z3funITkSt8integralcEvT_.isra.0

Raised by @SirWalrus on the compiler-explorer discord:
https://discord.com/channels/763778740345765900/764131312117743656/1312754780875128872

-- 
You are receiving this mail because:
You are on the CC list for the bug.