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
160 stars 13 forks source link

add failover to naive location assumptions #508

Closed JakeHillion closed 1 week ago

JakeHillion commented 3 weeks ago

The current hacked together location API we added to drgn works extremely poorly with modern C++ compilers. It largely works with the clang-12 compiler on CircleCI, but works very poorly with clang 15/16/17/18 in Nix or when updating the CircleCI compiler to clang-15.

This change adds a backup mechanism for locating arguments when drgn has failed. The mechanism is extremely naive and makes several assumptions which are often not correct. Currently, however, it drastically reduces the number of tests that must be skipped in the Nix CI.

Test plan:

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 60.70%. Comparing base (b7b9ac1) to head (15ce4e3).

Files Patch % Lines
oi/arch/x86_64.cpp 0.00% 16 Missing :warning:
oi/Descs.cpp 25.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #508 +/- ## ========================================== - Coverage 60.80% 60.70% -0.10% ========================================== Files 127 127 Lines 12498 12516 +18 Branches 2014 2015 +1 ========================================== - Hits 7599 7598 -1 - Misses 3942 3961 +19 Partials 957 957 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JakeHillion commented 1 week ago

I think we had a docs link to add for the x86_64 register conventions but we can add that later.