google / bloaty

Bloaty: a size profiler for binaries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bloaty file.elf -d compileunits assert failure in ItaniumDemangle

charles-haynes opened this issue · comments

built bloaty from latest (c47f867) on Ubuntu. Ran it on an elf compiled by xtensa-esp32-elf-g++ for the ESP32 using the command bloaty firmware.elf -d compileunits I get:

Unexpected source: 1
bloaty: /home/haynes/projects/bloaty/src/bloaty.cc:256: std::string bloaty::ItaniumDemangle(absl::string_view, bloaty::DataSource): Assertion `false' failed.
Aborted

This is because DataSource source is equal to DataSource::kCompileUnits

I fixed it by changing ItaniumDemangle to not try to demangle if the source was a compile unit, but don't know enough about how bloaty is structured to know if there isn't some other better fix at a higher level. I can submit a patch and pull but while the change is trivial I don't know enough about the unit tests to write a proper test for this case.

Fixed in #269, thanks for the report!