[Lldb-commits] [lldb] [lldb] Upstream and adopt ReadUnsignedIntegersFromMemory in AppleObjCRuntimeV2 (PR #190564)
Felipe de Azevedo Piovezan via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 7 09:54:06 PDT 2026
================
@@ -759,6 +784,84 @@ ExtractRuntimeGlobalSymbol(Process *process, ConstString name,
return symbol_load_addr;
}
+// Batched version of ExtractRuntimeGlobalSymbol. Resolves symbols and reads
+// their values in a single batch using ReadUnsignedIntegersFromMemory.
+static llvm::SmallVector<RuntimeGlobalSymbolResult, kMaxResults>
+ExtractRuntimeGlobalSymbolsBatched(
+ Process *process, const ModuleSP &module_sp,
+ llvm::ArrayRef<RuntimeGlobalSymbolSpec> specs) {
+ llvm::SmallVector<RuntimeGlobalSymbolResult, kMaxResults> results;
+ results.resize(specs.size());
----------------
felipepiovezan wrote:
Given how `default_avlue` is always the same, this would be more expressive as:
```
RuntimeGlobalSymbolResult fail_value = {LLDB_INVALID_ADDR, false}
llvm::SmallVector<RuntimeGlobalSymbolResult, kMaxResults> results(specs.size(), fail_value);
```
And then everywhere in the code below that is handling an error path, don't repeat the same `results[i] = ...`. In other words, by default, everything starts in a failed state.
https://github.com/llvm/llvm-project/pull/190564
More information about the lldb-commits
mailing list