jasonmolenda created this revision.
jasonmolenda added reviewers: JDevlieghere, mib.
jasonmolenda added a project: LLDB.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.

`ProcessMachCore::DoLoadCore` has an error check that if it found no thread 
contexts (`LC_THREAD`s), it is an improperly formed corefile and will be 
rejected.  We have a group that is creating memory-only corefiles, and will 
provide threads from an operating system or scripted process python plugin that 
they write.  This removes the error handling from DoLoadCore -- I can't 
remember this catching problems with corrupt corefiles in real world use.

I haven't cooked up a test for it at this point; it would be possible to run a 
user process, `process save-core` it, write a utility program that rewrites the 
corefiles to remove the LC_THREAD load commands, loads it into lldb, and 
confirms that memory can still be examined.  But given the simplicity of the 
change, I don't feel super motivated to write all that.  I'm open to it though, 
if other people feel it would be a good addition to our test coverage.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142662

Files:
  lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp


Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
===================================================================
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -483,13 +483,6 @@
     return error;
   }
 
-  if (core_objfile->GetNumThreadContexts() == 0) {
-    error.SetErrorString("core file doesn't contain any LC_THREAD load "
-                         "commands, or the LC_THREAD architecture is not "
-                         "supported in this lldb");
-    return error;
-  }
-
   SetCanJIT(false);
 
   // The corefile's architecture is our best starting point.


Index: lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
===================================================================
--- lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -483,13 +483,6 @@
     return error;
   }
 
-  if (core_objfile->GetNumThreadContexts() == 0) {
-    error.SetErrorString("core file doesn't contain any LC_THREAD load "
-                         "commands, or the LC_THREAD architecture is not "
-                         "supported in this lldb");
-    return error;
-  }
-
   SetCanJIT(false);
 
   // The corefile's architecture is our best starting point.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH]... Jason Molenda via Phabricator via lldb-commits

Reply via email to