summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/StructuredData
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/StructuredData')
-rw-r--r--lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp18
-rw-r--r--lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h3
2 files changed, 20 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)",
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
index 91bd7a6a58c..7eaab127c3f 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
@@ -74,6 +74,8 @@ public:
void ModulesDidLoad(Process &process, ModuleList &module_list) override;
+ ~StructuredDataDarwinLog();
+
private:
// -------------------------------------------------------------------------
// Private constructors
@@ -129,6 +131,7 @@ private:
bool m_is_enabled;
std::mutex m_added_breakpoint_mutex;
bool m_added_breakpoint;
+ lldb::user_id_t m_breakpoint_id;
};
}
OpenPOWER on IntegriCloud