[Lldb-commits] [PATCH] D133534: Complete support of loading a darwin kernel over a live gdb-remote connection given the address of a mach-o fileset

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 9 14:44:28 PDT 2022


jasonmolenda marked 2 inline comments as done.
jasonmolenda added inline comments.


================
Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp:924
+                                           addr_t input_addr) {
+  Status error;
+  WritableDataBufferSP header_data(new DataBufferHeap(512, 0));
----------------
JDevlieghere wrote:
> Looks like we're never checking this status below. Is there any chance that `ReadMemory` succeeds but the status is set to an error? If not, should we add an assert? 
Good point.  `Process::ReadMemoryFromInferior` returns the number of bytes read, and a Status object.  So if were were only able to read part of the mach header object, this would not return an error condition.  (and we'd have uninitialized fields and could try to read too many load commands or something)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133534/new/

https://reviews.llvm.org/D133534



More information about the lldb-commits mailing list