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 {
134
134
// Default implementation returns the read value as is.
135
135
return RemoteAbsolutePointer (" " , readValue);
136
136
}
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
+
138
144
// / Attempt to read and resolve a pointer value at the given remote address.
139
145
llvm::Optional<RemoteAbsolutePointer> readPointer (RemoteAddress address,
140
146
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
+
141
152
auto result = readBytes (address, pointerSize);
142
153
if (!result)
143
154
return llvm::None;
You can’t perform that action at this time.
0 commit comments