[Lldb-commits] [PATCH] D115494: Add support to lldb for reading a "load binary" LC_NOTE with Mach-O corefiles

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 10 18:34:10 PST 2021


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


================
Comment at: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:7005
+  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
   if (image_infos.IsValid()) {
     for (const MachOCorefileImageEntry &image : image_infos.all_image_infos) {
----------------
DavidSpickett wrote:
> Maybe not for this change but if you made this early return you could dedent all the following by one level.
> ```
> if (!image_infos.IsValid())
>   return added_images;
> ```
Oh yes, nice.



================
Comment at: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:7035
+                image.filename.c_str(), uuidstr.c_str());
+          }
+          for (auto name_vmaddr_tuple : image.segment_load_addresses) {
----------------
DavidSpickett wrote:
> You can use the `LLDB_LOGF` to do the `if (log)` for you I think. Then do `image.uuid.GetAsString().c_str()` directly as one of the parameters.
Oh that's clever, but I prefer the Printf method so I'll do it this way.


================
Comment at: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:7065
+                "ObjectFileMachO::LoadCoreFileImages adding binary '%s' "
+                "UUID %s with slide address 0x%" PRIx64,
+                image.filename.c_str(), uuidstr.c_str(), image.slide);
----------------
DavidSpickett wrote:
> Is the slide address the amount you slide the load address *by* or is it an address all to itself? My assumption was the former.
> (which makes the log message a bit odd since it's a distance not an amount)
Yeah, I was banging out these log messages past bedtime trying to wrap it up, and wasn't as clear as I meant to be.  Cleaned these up, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115494



More information about the lldb-commits mailing list