summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp')
-rw-r--r--lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
index 5e1dd27e8c2..e459268f544 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -1405,6 +1405,20 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
EnableNow();
}
+// -----------------------------------------------------------------------------
+// public destructor
+// -----------------------------------------------------------------------------
+
+StructuredDataDarwinLog::~StructuredDataDarwinLog() {
+ if (m_breakpoint_id != LLDB_INVALID_BREAK_ID) {
+ ProcessSP process_sp(GetProcess());
+ if (process_sp) {
+ process_sp->GetTarget().RemoveBreakpointByID(m_breakpoint_id);
+ m_breakpoint_id = LLDB_INVALID_BREAK_ID;
+ }
+ }
+}
+
#pragma mark -
#pragma mark Private instance methods
@@ -1415,7 +1429,8 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp)
: StructuredDataPlugin(process_wp), m_recorded_first_timestamp(false),
m_first_timestamp_seen(0), m_is_enabled(false),
- m_added_breakpoint_mutex(), m_added_breakpoint() {}
+ m_added_breakpoint_mutex(), m_added_breakpoint(),
+ m_breakpoint_id(LLDB_INVALID_BREAK_ID) {}
// -----------------------------------------------------------------------------
// Private static methods
@@ -1734,6 +1749,7 @@ void StructuredDataDarwinLog::AddInitCompletionHook(Process &process) {
// Set our callback.
breakpoint_sp->SetCallback(InitCompletionHookCallback, nullptr);
+ m_breakpoint_id = breakpoint_sp->GetID();
if (log)
log->Printf("StructuredDataDarwinLog::%s() breakpoint set in module %s,"
"function %s (process uid %u)",
OpenPOWER on IntegriCloud