[Lldb-commits] [lldb] walter/fix (PR #71455)

via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 6 15:00:30 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Walter Erquinigo (walter-erquinigo)

<details>
<summary>Changes</summary>

- [LLDB][easy] Fix a bug in DummySyntheticFrontEnd
- [LLDB] Don't forcefully initialize the process trace plugin


---
Full diff: https://github.com/llvm/llvm-project/pull/71455.diff


3 Files Affected:

- (modified) lldb/source/API/SystemInitializerFull.cpp (-3) 
- (modified) lldb/source/Core/ValueObjectSyntheticFilter.cpp (+1-1) 
- (modified) lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp (+5-4) 


``````````diff
diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp
index 27319debc858288..c48466f25ede81b 100644
--- a/lldb/source/API/SystemInitializerFull.cpp
+++ b/lldb/source/API/SystemInitializerFull.cpp
@@ -68,9 +68,6 @@ llvm::Error SystemInitializerFull::Initialize() {
 #define LLDB_PLUGIN(p) LLDB_PLUGIN_INITIALIZE(p);
 #include "Plugins/Plugins.def"
 
-  // Initialize plug-ins in core LLDB
-  ProcessTrace::Initialize();
-
   // Scan for any system or user LLDB plug-ins
   PluginManager::Initialize();
 
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index 59ed780b654f3af..43bc532c4a0410b 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -41,7 +41,7 @@ class DummySyntheticFrontEnd : public SyntheticChildrenFrontEnd {
     return m_backend.GetIndexOfChildWithName(name);
   }
 
-  bool MightHaveChildren() override { return true; }
+  bool MightHaveChildren() override { return m_backend.MightHaveChildren(); }
 
   bool Update() override { return false; }
 };
diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp
index 6bed78fd83f0b70..bd9cca675f2d747 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp
@@ -103,10 +103,11 @@ TraceIntelPTBundleLoader::CreateEmptyProcess(lldb::pid_t pid,
   ParsedProcess parsed_process;
   parsed_process.target_sp = target_sp;
 
-  ProcessSP process_sp = target_sp->CreateProcess(
-      /*listener*/ nullptr, "trace",
-      /*crash_file*/ nullptr,
-      /*can_connect*/ false);
+  // 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);
 
   process_sp->SetID(static_cast<lldb::pid_t>(pid));
 

``````````

</details>


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


More information about the lldb-commits mailing list