[Lldb-commits] [lldb] 0c8444b - [lldb] Fix Clang modules build after D101329

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 10 04:11:55 PDT 2021


Author: Raphael Isemann
Date: 2021-09-10T13:10:19+02:00
New Revision: 0c8444bd3462a3d05c8ac637a554e1a368dee0ac

URL: https://github.com/llvm/llvm-project/commit/0c8444bd3462a3d05c8ac637a554e1a368dee0ac
DIFF: https://github.com/llvm/llvm-project/commit/0c8444bd3462a3d05c8ac637a554e1a368dee0ac.diff

LOG: [lldb] Fix Clang modules build after D101329

D101329 introduces the Process:SaveCore function returning a
`llvm::Expected<bool>`. That function causes that Clang with -fmodules crashes
while compiling LLDB's PythonDataObjects.cpp. With enabled asserts Clang fails
because of:

    Assertion failed: (CachedFieldIndex && "failed to find field in parent")

Crash can be reproduced by building via -DLLVM_ENABLE_MODULES=On with Clang
12.0.1 and then building PythonDataObjects.cpp.o .

Clang bug is tracked at rdar://82901462

Added: 
    

Modified: 
    lldb/include/lldb/Target/Process.h
    lldb/source/Target/Process.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index eb7ad99d5adf3..741c9e1021cc6 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -695,9 +695,7 @@ class Process : public std::enable_shared_from_this<Process>,
   /// \return
   ///     true if saved successfully, false if saving the core dump
   ///     is not supported by the plugin, error otherwise.
-  virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile) {
-    return false;
-  }
+  virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile);
 
 protected:
   virtual JITLoaderList &GetJITLoaders();

diff  --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 5ae37d062581d..540f58d2ebc9e 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2650,6 +2650,10 @@ DynamicLoader *Process::GetDynamicLoader() {
 
 DataExtractor Process::GetAuxvData() { return DataExtractor(); }
 
+llvm::Expected<bool> Process::SaveCore(llvm::StringRef outfile) {
+  return false;
+}
+
 JITLoaderList &Process::GetJITLoaders() {
   if (!m_jit_loaders_up) {
     m_jit_loaders_up = std::make_unique<JITLoaderList>();


        


More information about the lldb-commits mailing list