-
Couldn't load subscription status.
- Fork 15k
SBDebugger: Add new APIs AddDestroyCallback and RemoveDestroyCallback
#89868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
079a550
771b527
d1f13ca
f536124
661dc1c
b295e0d
4ac92de
e5bf620
1206762
d7e8b8d
192b00e
1e02efc
7ec1346
54f3d8d
496dec6
7ebac23
15aa770
b938b2e
7544606
e556caf
25a51ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
|
|
||
| #include <memory> | ||
| #include <optional> | ||
| #include <unordered_map> | ||
royitaqi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| #include <vector> | ||
|
|
||
| #include "lldb/Core/DebuggerEvents.h" | ||
|
|
@@ -568,10 +569,22 @@ class Debugger : public std::enable_shared_from_this<Debugger>, | |
|
|
||
| static void ReportSymbolChange(const ModuleSpec &module_spec); | ||
|
|
||
| void | ||
| /// DEPRECATED. Use AddDestroyCallback and RemoveDestroyCallback instead. | ||
| /// Clear all previously added callbacks and only add the given one. | ||
royitaqi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| lldb_private::DebuggerDestroyCallbackToken | ||
| SetDestroyCallback(lldb_private::DebuggerDestroyCallback destroy_callback, | ||
| void *baton); | ||
|
|
||
| /// Add a callback for when the debugger is destroyed. Return a token, which | ||
| /// can be used to remove said callback. Multiple callbacks can be added by | ||
| /// calling this function multiple times. | ||
| lldb_private::DebuggerDestroyCallbackToken | ||
| AddDestroyCallback(lldb_private::DebuggerDestroyCallback destroy_callback, | ||
| void *baton); | ||
|
|
||
| /// Remove the specified callback. Return true if successful. | ||
| bool RemoveDestroyCallback(lldb_private::DebuggerDestroyCallbackToken token); | ||
|
|
||
| /// Manually start the global event handler thread. It is useful to plugins | ||
| /// that directly use the \a lldb_private namespace and want to use the | ||
| /// debugger's default event handler thread instead of defining their own. | ||
|
|
@@ -731,8 +744,11 @@ class Debugger : public std::enable_shared_from_this<Debugger>, | |
| lldb::TargetSP m_dummy_target_sp; | ||
| Diagnostics::CallbackID m_diagnostics_callback_id; | ||
|
|
||
| lldb_private::DebuggerDestroyCallback m_destroy_callback = nullptr; | ||
| void *m_destroy_callback_baton = nullptr; | ||
| std::recursive_mutex m_destroy_callback_mutex; | ||
|
||
| lldb_private::DebuggerDestroyCallbackToken m_destroy_callback_next_token = 0; | ||
| std::unordered_map<lldb_private::DebuggerDestroyCallbackToken, | ||
| std::pair<lldb_private::DebuggerDestroyCallback, void *>> | ||
| m_destroy_callback_and_baton; | ||
|
|
||
| uint32_t m_interrupt_requested = 0; ///< Tracks interrupt requests | ||
| std::mutex m_interrupt_mutex; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.