Page MenuHomePhabricator

Add some apple-tables lookup tests

Authored by labath on May 18 2018, 6:59 AM.



Now that we are able to parse MachO files everywhere, we can write some
cross-platform tests for handling of apple accelerator tables. This
reruns the same lookup tests we have for manual indexes on MachO files
which will use the accelerator tables instead. This makes sure we return
the same results regardless of the method we used to access the debug

The tests confirm we return the same results for looking up types,
namespaces and variables, but have found an inconsistency in the
treatment of function lookup. In the function case we mis-classify the
method "foo" declared in the local struct sbar (inside function ffbar).
We classify it as a function whereas it really is a method. Preliminary
analysis suggests this is because
DWARFASTParserClang::GetClangDeclContextForDIE returns null when given
the local "struct sbar" DIE. This causes us to get the wrong
CompilerDeclContext when we ask for the context of the inner foo, which
means CompilerDeclContext::ISStructUnionOrClass returns false.

Until this is fixed, I do not include the darwin versions of the "base"
and "method" function lookup tests.

Diff Detail


Event Timeline

labath created this revision.May 18 2018, 6:59 AM
JDevlieghere accepted this revision.May 18 2018, 7:13 AM


17 ↗(On Diff #147500)


This revision is now accepted and ready to land.May 18 2018, 7:13 AM
labath added inline comments.May 18 2018, 7:22 AM
17 ↗(On Diff #147500)

I prefer %t, as that makes the RUN lines below identical to the elf versions (in elf I use %t.o because I need an extra lld step).

clayborg accepted this revision.May 18 2018, 2:34 PM
This revision was automatically updated to reflect the committed changes.