summaryrefslogtreecommitdiff
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2025-05-07 15:02:21 +0200
committerGitHub <noreply@github.com>2025-05-07 15:02:21 +0200
commit21501d1cf290a63760904fb125e77b432db49933 (patch)
treeae26ab1c459dcfc1327ec585444818570e1ed8a5 /lldb/source/Target/Target.cpp
parent0db040576d4ccb313fc58a90e1b4149f7589cc8c (diff)
[lldb] Fix dynamic type resolutions for core files (#138698)
We're reading from the object's vtable to determine the pointer to the full object. The vtable is normally in the "rodata" section of the executable, which is often not included in the core file because it's not supposed to change and the debugger can extrapolate its contents from the executable file. We weren't doing that. This patch changes the read operation to use the target class (which falls back onto the executable module as expected) and adds the missing ReadSignedIntegerFromMemory API. The fix is tested by creating a core (minidump) file which deliberately omits the vtable pointer.
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index e90e748191a7..7f61f8689fb9 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2270,6 +2270,17 @@ size_t Target::ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_si
return 0;
}
+int64_t Target::ReadSignedIntegerFromMemory(const Address &addr,
+ size_t integer_byte_size,
+ int64_t fail_value, Status &error,
+ bool force_live_memory) {
+ Scalar scalar;
+ if (ReadScalarIntegerFromMemory(addr, integer_byte_size, false, scalar, error,
+ force_live_memory))
+ return scalar.SLongLong(fail_value);
+ return fail_value;
+}
+
uint64_t Target::ReadUnsignedIntegerFromMemory(const Address &addr,
size_t integer_byte_size,
uint64_t fail_value, Status &error,