[Lldb-commits] [lldb] [lldb] Fix Intel PT plugin compile errors (PR #77252)

Nicholas Mosier via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 8 08:00:52 PST 2024


================
@@ -103,12 +103,10 @@ TraceIntelPTBundleLoader::CreateEmptyProcess(lldb::pid_t pid,
   ParsedProcess parsed_process;
   parsed_process.target_sp = target_sp;
 
-  // This should instead try to directly create an instance of ProcessTrace.
-  // ProcessSP process_sp = target_sp->CreateProcess(
-  //    /*listener*/ nullptr, "trace",
-  //    /*crash_file*/ nullptr,
-  //    /*can_connect*/ false);
-
+  ProcessSP process_sp = target_sp->CreateProcess(
+      /*listener*/ nullptr, "trace",
+      /*crash_file*/ nullptr,
+      /*can_connect*/ false);
----------------
nmosier wrote:

I double-checked, and looks like commit 555a71be457fo3 commented out these four lines. Here's the commit message:
```
commit 555a71be457f351411b89c6a6a66aeecf7ca5291
Author: Walter Erquinigo <a20012251 at gmail.com>
Date:   Mon Nov 6 19:45:52 2023 -0500

    [LLDB] Don't forcefully initialize the process trace plugin (#71455)
    
    This was causing some process to wrongfully be handled by ProcessTrace.
    
    The only place this was being used is in the intel pt plugin, but it
    doesn't even build anymore, so I'm sure no one is using it.
```
I think the commit author meant to comment out the following line, `process_sp->SetID(static_cast<lldb::pid_t>(pid));`; however, they didn't catch the compile error because apparently the Intel PT plugin wasn't compiling back then anyway.

I updated my patch to keep those four lines plus the following two commented out. I verified that LLDB's Intel PT plugin still works just fine.

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


More information about the lldb-commits mailing list