[Lldb-commits] [lldb] Allow multiple destroy callbacks in `SBDebugger::SetDestroyCallback()` (PR #89868)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 25 13:47:24 PDT 2024


royitaqi wrote:

Hi @jimingham ,

I have updated the code. Now we have `Add` and `Remove` (with tokens as you suggested). `Set` clears everything then add the given one (also returns a token).

Thread-safety is done through a `std::lock_guard<std::recursive_mutex>`. This is consistent with some of the other functions/fields.

Didn't understand one of your comment about "one destroy callback can add/remove others" and how that relates to the code. See my reply in the above.

Another thing I am not sure is, in python API test, how do I make concurrent calls to these APIs. Do you know if this should be tested (e.g. if other existing functions has similar tests)? If the answer is "yes", do you happen to know what existing test I can see as examples?


Thanks for your reviews so far. Hope this PR is getting better as we converse.

Best,
Roy

https://github.com/llvm/llvm-project/pull/89868


More information about the lldb-commits mailing list