[Lldb-commits] [PATCH] D147462: Use kernel's global variable indicating how many bits are used in addressing when loading Darwin xnu kernel
Jason Molenda via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 3 13:49:17 PDT 2023
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
More information about the lldb-commits
mailing list