File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,21 @@ class MemoryReader {
134134 // Default implementation returns the read value as is.
135135 return RemoteAbsolutePointer (" " , readValue);
136136 }
137-
137+
138+ // / Atempt to resolve the pointer to a symbol for the given remote address.
139+ virtual llvm::Optional<RemoteAbsolutePointer>
140+ resolvePointerAsSymbol (RemoteAddress address) {
141+ return llvm::None;
142+ }
143+
138144 // / Attempt to read and resolve a pointer value at the given remote address.
139145 llvm::Optional<RemoteAbsolutePointer> readPointer (RemoteAddress address,
140146 unsigned pointerSize) {
147+ // Try to resolve the pointer as a symbol first, as reading memory
148+ // may potentially be expensive.
149+ if (auto symbolPointer = resolvePointerAsSymbol (address))
150+ return symbolPointer;
151+
141152 auto result = readBytes (address, pointerSize);
142153 if (!result)
143154 return llvm::None;
You can’t perform that action at this time.
0 commit comments