mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 09:00:27 +02:00
LazDebuggerFp: more nil handling safety
git-svn-id: trunk@59608 -
This commit is contained in:
parent
96fdbb9d93
commit
d241c5e016
@ -1553,9 +1553,14 @@ var
|
||||
ClassNameAddr: TDBGPtr;
|
||||
b: byte;
|
||||
begin
|
||||
Result := '';
|
||||
// Read address of the vmt
|
||||
ReadAddress(AnAddr, VMTAddr);
|
||||
if VMTAddr = 0 then
|
||||
exit;
|
||||
ReadAddress(VMTAddr+3*DBGPTRSIZE[FDbgController.CurrentProcess.Mode], ClassNameAddr);
|
||||
if ClassNameAddr = 0 then
|
||||
exit;
|
||||
// read classname (as shortstring)
|
||||
ReadData(ClassNameAddr, 1, b);
|
||||
setlength(result,b);
|
||||
@ -1621,8 +1626,12 @@ begin
|
||||
|
||||
AnExceptionLocation:=GetLocationRec(FDbgController.CurrentThread.RegisterValueList.FindRegisterByDwarfIndex(RegDxDwarfIndex).NumValue);
|
||||
AnExceptionObjectLocation:=FDbgController.CurrentThread.RegisterValueList.FindRegisterByDwarfIndex(0).NumValue;
|
||||
ExceptionClass := GetClassInstanceName(AnExceptionObjectLocation);
|
||||
ExceptionMessage := ReadAnsiString(AnExceptionObjectLocation+DBGPTRSIZE[FDbgController.CurrentProcess.Mode]);
|
||||
ExceptionClass := '';
|
||||
ExceptionMessage := '';
|
||||
if AnExceptionObjectLocation <> 0 then begin
|
||||
ExceptionClass := GetClassInstanceName(AnExceptionObjectLocation);
|
||||
ExceptionMessage := ReadAnsiString(AnExceptionObjectLocation+DBGPTRSIZE[FDbgController.CurrentProcess.Mode]);
|
||||
end;
|
||||
|
||||
DoException(deInternal, ExceptionClass, AnExceptionLocation, ExceptionMessage, continue);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user