facebookexperimental / object-introspection

Object Introspection (OI) enables on-demand, hierarchical profiling of objects in arbitrary C/C++ programs with no recompilation.
Apache License 2.0
164 stars 14 forks source link

Add support for Simple Template Names #428

Closed ttreyer closed 10 months ago

ttreyer commented 10 months ago

Summary

The .debug_string table can get very large for massive programs. If it grows larger than 4GiB, DWARF is unable to address any string beyond the limit, as it uses uint32_t to store an offset within the table. But the table also has lots of duplication: every templated types' name contains all the template parameters too. Knowing that, the option -gsimple-template-names saves space by only storing the template type's name, without its template parameters. The complete name can then be reconstructed by traversing the DIEs for the template parameters, so that no information is lost.

This PR imports Omar's work on drgn to add support for Simple Template Names.

Test plan

$ make test
facebook-github-bot commented 10 months ago

@JakeHillion has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.