Better handle resolution of safe object frames with empty object paths

This commit is contained in:
Jeremy Rifkin 2024-08-18 13:38:06 -05:00
parent 0e2c3a130d
commit 64e0210449
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -161,6 +161,14 @@ namespace detail {
} }
object_frame resolve_safe_object_frame(const safe_object_frame& frame) { object_frame resolve_safe_object_frame(const safe_object_frame& frame) {
std::string object_path = frame.object_path;
if(object_path.empty()) {
return {
frame.raw_address,
0,
""
};
}
auto base = get_module_image_base(frame.object_path); auto base = get_module_image_base(frame.object_path);
if(base.is_error()) { if(base.is_error()) {
throw base.unwrap_error(); // This throw is intentional throw base.unwrap_error(); // This throw is intentional
@ -168,7 +176,7 @@ namespace detail {
return { return {
frame.raw_address, frame.raw_address,
frame.address_relative_to_object_start + base.unwrap_value(), frame.address_relative_to_object_start + base.unwrap_value(),
frame.object_path std::move(object_path)
}; };
} }
} }