libdebugger: Fix #12914.
DwarfImageDebugInfo: - While computing return value locations, we need to re-evaluate the availability of debug information as we're forced to traverse around images to resolve the location of a function call. Otherwise, we may crash as one of the called functions may belong to an image that wasn't compiled with debug info.
This commit is contained in:
@@ -1201,6 +1201,11 @@ DwarfImageDebugInfo::_CreateReturnValues(ReturnValueInfoList* returnValueInfos,
|
||||
|
||||
status_t result = B_OK;
|
||||
ImageDebugInfo* imageInfo = targetImage->GetImageDebugInfo();
|
||||
if (imageInfo == NULL) {
|
||||
// the subroutine may have resolved to a different image
|
||||
// that doesn't have debug information available.
|
||||
continue;
|
||||
}
|
||||
|
||||
FunctionInstance* targetFunction;
|
||||
if (imageInfo->GetAddressSectionType(subroutineAddress)
|
||||
@@ -1218,6 +1223,14 @@ DwarfImageDebugInfo::_CreateReturnValues(ReturnValueInfoList* returnValueInfos,
|
||||
if (targetImage == NULL)
|
||||
continue;
|
||||
imageInfo = targetImage->GetImageDebugInfo();
|
||||
if (imageInfo == NULL) {
|
||||
// As above, since the indirection here may have
|
||||
// landed us in an entirely different image, there is
|
||||
// no guarantee that debug info is available,
|
||||
// depending on which image it was.
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user