This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Prevent crash when adding a stop hook with --shlib
ClosedPublic

Authored by JDevlieghere on Apr 13 2022, 5:03 PM.

Details

Summary

Currently, lldb crashes when adding a stop hook with --shlib because we unconditionally use the target in SymbolContextSpecifier::AddSpecification. Avoid the crash and add a little test.

rdar://68524781

Diff Detail

Event Timeline

JDevlieghere created this revision.Apr 13 2022, 5:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 5:03 PM
JDevlieghere requested review of this revision.Apr 13 2022, 5:03 PM
mib accepted this revision.Apr 13 2022, 5:04 PM
This revision is now accepted and ready to land.Apr 13 2022, 5:04 PM

This is fine, though the fact that it crashed when you tried to specify the shared library means we don't have any tests that the shared library gets copied over from the dummy target correctly. Might be nice to extend the test to have a "file not_called_test" and "break set -n main" and "run" to make sure the stop hook doesn't fire.

Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 11:00 AM