This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Print the backtrace for all threads if the test breakpoint can't be hit
AcceptedPublic

Authored by teemperor on Jun 1 2021, 12:27 AM.

Details

Summary

At the moment if a test fails to hits the breakpoint we set in run_to_source_breakpoint
the test suite just prints:

AssertionError: 0 != 1 : Expected 1 thread to stop at breakpoint, 0 did

Often these errors happen because the debuggee crashed before that breakpoint is being
hit or the process failed to launch but it's hard to tell what happened from the current error.

This patch adds that we now print the backtrace of all threads in case the test failed
because we didn't hit the right breakpoint

Diff Detail

Event Timeline

teemperor requested review of this revision.Jun 1 2021, 12:27 AM
teemperor created this revision.
mib accepted this revision.Jun 1 2021, 6:27 AM
mib added a subscriber: mib.

LGTM!

This revision is now accepted and ready to land.Jun 1 2021, 6:27 AM
augusto2112 accepted this revision.Jun 1 2021, 9:09 AM
augusto2112 added a subscriber: augusto2112.

LGTM

JDevlieghere accepted this revision.Jun 1 2021, 9:51 AM

LGTM. Are there other places where we check this, either in lldbutil or maybe more generally a pattern in the tests that could be extracted into a helper?

LGTM. Are there other places where we check this, either in lldbutil or maybe more generally a pattern in the tests that could be extracted into a helper?

From what I can see all our lldbutil functions that run to a breakpoint end up calling this function so this should cover everything beside the tests that manually do stuff like "continue" and so on. But there might be some utility function for going to the next breakpoint that are missing this. I'll check, thanks!

LGTM. Are there other places where we check this, either in lldbutil or maybe more generally a pattern in the tests that could be extracted into a helper?

From what I can see all our lldbutil functions that run to a breakpoint end up calling this function so this should cover everything beside the tests that manually do stuff like "continue" and so on. But there might be some utility function for going to the next breakpoint that are missing this. I'll check, thanks!

You probably also want to do this to "lldbutil.continue_to_breakpoint", except that doesn't actually do any tests. It should really be rewritten to take a TestBase and do the assert's in the function, it is inconvenient to use as currently written.