[Lldb-commits] [lldb] [LLDB][Telemetry]Define TargetInfo for collecting data about a target (PR #127834)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 13 03:08:21 PDT 2025


================
@@ -1559,10 +1560,29 @@ void Target::DidExec() {
 
 void Target::SetExecutableModule(ModuleSP &executable_sp,
                                  LoadDependentFiles load_dependent_files) {
+  telemetry::ScopedDispatcher<telemetry::ExecModuleInfo> helper(&m_debugger);
   Log *log = GetLog(LLDBLog::Target);
   ClearModules(false);
 
   if (executable_sp) {
+    m_current_exec_mod_uuid = executable_sp->GetUUID();
+    lldb::pid_t pid;
+    if (ProcessSP proc = GetProcessSP())
+      pid = proc->GetID();
+    helper.DispatchNow([&](telemetry::ExecModuleInfo *info) {
+      info->exec_mod = executable_sp;
+      info->exec_uuid = m_current_exec_mod_uuid;
+      info->pid = pid;
+      info->arch_name = executable_sp->GetArchitecture().GetArchitectureName();
----------------
labath wrote:

I think this is unnecessarily depriving you of potentially useful information. With just the architecture name, you wouldn't be able to tell a (local?) x86_64 linux debug session from a (remote) x86_64 darwin/freebsd/etc. session. Consider replacing this with `executable_sp->GetArchitecture()->GetTriple().getTriple()`

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


More information about the lldb-commits mailing list