This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Dexter tests for -debug-info-kind=constructor
AcceptedPublic

Authored by jmorse on Nov 17 2020, 11:16 AM.

Details

Summary

While mucking about with the new -debug-info-kind=constructor build type, I figured it would be worth adding some integration tests to ensure that complete types can still be found by debuggers in the built programs.

There are two tests here: one simply checks the "foo" type can be examined in a different translation unit. The second checks that when we have partial type information for "foo" because of inlined elements from it (under DWARF at least) in main.o, debuggers can still find the complete type definition. This test is also run with -O2 -flto.

Each test examines fields in "bar" when stepped onto the output line, that we can step into the asString() method, and that the fields are still examinable there.

This test format requires multiple translation units; the empty "test.cfg" file reminds Dexter that it should be treating this as a whole directory test, not a single file test.

Diff Detail

Event Timeline

jmorse created this revision.Nov 17 2020, 11:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 11:16 AM
jmorse requested review of this revision.Nov 17 2020, 11:16 AM
akhuang accepted this revision.Nov 17 2020, 7:33 PM

thanks for writing tests for this! I think it looks good.

I tried running this patch on my machine though and the tests always pass (using llvm-lit) even if I change numbers, so I don't know if something's going on with the directory test format?

This revision is now accepted and ready to land.Nov 17 2020, 7:33 PM
jmorse updated this revision to Diff 306198.Nov 18 2020, 1:44 PM

I tried running this patch on my machine though and the tests always pass (using llvm-lit) even if I change numbers, so I don't know if something's going on with the directory test format?

Hmmmmmm, I tried to apply the patch locally too, and "patch" seemingly omitted the empty test.cfg files. I've given them a non-empty body now, so perhaps they'll survive better.

Other tweaks:

  • Duplicated test-runner files, one for unix one for Windows and cdb/dbgeng. (Using the same RUN lines is still a work-in-progress with Dexter, alas)
  • dllexport'd the main symbol, as dbgeng has a problem setting a breakpoint there for some reason
  • Disabled the LTO test on Windows -- using WinDbg I can't find any locals in the compiled code (saved with --save-temps). Not clear to me why -- CodeView is alien to me.
  • DbgEng test runs relies on D91737 for a fix

Will land this without objection in a couple of days, once D91737 is in.