This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Track the API boundary using a thread_local variable.
ClosedPublic

Authored by JDevlieghere on Dec 7 2020, 8:45 PM.

Details

Summary

The reproducers currently use a static variable to track the API boundary. This is obviously incorrect when the SB API is used concurrently. While I do not plan to support that use-case (right now), I do want to avoid us crashing. As a first step, correctly track API boundaries across multiple threads.

Before this patch SB API calls made by the embedded script interpreter would be considered "behind the API boundary" and correctly ignored. After this patch, we need to tell the reproducers to ignore the scripting thread as a "private thread".

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Dec 7 2020, 8:45 PM
JDevlieghere created this revision.
friss accepted this revision.Dec 9 2020, 8:48 AM

This LGTM. I like that it's way easier than what we have discussed offline.

This revision is now accepted and ready to land.Dec 9 2020, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 9 2020, 8:58 AM