[Lldb-commits] [PATCH] D99314: [lldb] Add IsSafeToCallAPI to DynamicLoader

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 25 15:30:06 PDT 2021


JDevlieghere added inline comments.


================
Comment at: lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp:1118
+bool DynamicLoaderMacOSXDYLD::IsSafeToCallAPI() {
+  if (ReadAllImageInfosStructure())
+    return m_dyld_all_image_infos.libSystemInitialized;
----------------
aprantl wrote:
> Out of curiosity: Is this an error when ReadAllImageInfosStructure() returns false? In that case a better API might be one that also bubbles up the error.
It can fail if `m_dyld_all_image_infos_addr` is not known or if we fail to read memory. I guess the latter could be considered an error and something we might want to surface, but probably not from this API. If we don't know the answer to whether it's safe to do so is still no. 


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

https://reviews.llvm.org/D99314



More information about the lldb-commits mailing list