jasonmolenda added a comment.

Yeah, I agree that messing with the global setting of addressable bits here is 
not ideal, but at this point in time the fact that we probably have an 
un-set/invalid value means it won't make things worse.



================
Comment at: 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:1094-1097
+        const size_t sym_bytesize = 8; // size of gT1Sz value
+        uint64_t sym_value =
+            m_process->GetTarget().ReadUnsignedIntegerFromMemory(
+                symbol->GetAddress(), sym_bytesize, 0, error);
----------------
JDevlieghere wrote:
> Why not use `symbol->GetByteSize()` too? Maybe add an 
> `assert(symbol->GetByteSize() == 8)`
We're trying to handle the case (it has happened in the past) where we have an 
inaccurate byte size because lldb is running on a stripped kernel binary, this 
is specifically working around the case where the symbol byte size is not 8.

(Symbols synthesize their size by looking at the next nearest symbol, so when 
you have a stripped binary you may have sizes that are larger than reality when 
some symbols have been stripped)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147462

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to