google / bloaty

Bloaty: a size profiler for binaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"bloaty: Data is in new DWARF format we don't understand" for compileunits source

ScoreUnder opened this issue · comments

commented

I used gcc --help=common | perl -lne 'print $1 if /^\s*(-g[^\s<]+) /' to get every possible debug flag from gcc, and did a full rebuild of my project with each one in succession. The -gz option gave bloaty: premature EOF reading fixed-length DWARF data, but every other option (including the absence of a debug option) gave bloaty: Data is in new DWARF format we don't understand. This is on an x86_64 linux system compiling a project written in C using GCC 12.1.0. I haven't had much success with clang either (version 13.0.1).

I am invoking it with bloaty -d compileunits followed by the name of the program. By default I build with -ggdb3, and the other two documented modes bloaty and bloaty -d symbols seem to work fine with that.

Is there a specific maximum version of gcc, or combination of debug parameters, which gets the compileunits option working?

I think gcc 12 defaults to DWARF 5, so using -gdwarf-4 might be what you need.

commented

This still seems to be unrecognised:

$ gcc -gdwarf-4 -o test test.c
$ bloaty -d compileunits ./test
bloaty: Data is in new DWARF format we don't understand

I'm seeing something similar (building using clang 14), but I get the more specific failure "Don't know how to parse DWARF form: 39" (only when using compileunits).

Edit: This is only true for some of my executables, and the ones I'm trying are various test applications for our primary project (a large statically linked library). So, it's probably something that's specifically linked only into the failing executable (like one of our third party dependencies). If I track it down, I'll let you know.

commented

The same for me

$ cd bloaty-1.1/
$ cmake .
$ make -j6
$ ./bloaty bloaty -d compileunits
bloaty: Data is in new DWARF format we don't understand