================ @@ -226,13 +227,45 @@ lldb::SBError SBDebugger::InitializeWithErrorHandling() { return error; } +#if LLVM_ENABLE_TELEMETRY +#if ENABLE_BACKTRACES +static void TelemetryHandler(void *) { + // TODO: get the bt into the msg? + // Also need to pre-alloc the memory for this entry? + lldb_private::telemetry::DebuggerInfo entry; + entry.exit_desc = {-1, ""}; + if (auto* instance = lldb_private::telemetry::TelemeryManager::getInstance()) { + if (instance->GetConfig()->EnableTelemetry()) { + instance->AtDebuggerExit(&entry); + } + } +} + +static bool RegisterTelemetryHander() { + sys::AddSignalHandler(TelemetryHandler, nullptr); + return false; +} +#endif +#endif + +static void InstallCrashTelemetryReporter() { +#if LLVM_ENABLE_TELEMETRY + ---------------- oontvoo wrote:
@labath Is this the right place to add the crash-handler? https://github.com/llvm/llvm-project/pull/127696 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits