mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 21:39:12 +02:00
DebuggerGDBMI: Improve getting exception message
git-svn-id: trunk@47384 -
This commit is contained in:
parent
9739fd651e
commit
aea48ebd14
@ -5592,6 +5592,15 @@ function TGDBMIDebuggerCommandExecute.ProcessStopped(const AParams: String;
|
|||||||
if tfExceptionIsPointer in TargetInfo^.TargetFlags
|
if tfExceptionIsPointer in TargetInfo^.TargetFlags
|
||||||
then ExceptionMessage := GetText('Exception(%s).FMessage', [ExceptInfo.ObjAddr])
|
then ExceptionMessage := GetText('Exception(%s).FMessage', [ExceptInfo.ObjAddr])
|
||||||
else ExceptionMessage := GetText('^Exception(%s)^.FMessage', [ExceptInfo.ObjAddr]);
|
else ExceptionMessage := GetText('^Exception(%s)^.FMessage', [ExceptInfo.ObjAddr]);
|
||||||
|
if FLastExecResult.State = dsError then begin
|
||||||
|
if tfExceptionIsPointer in TargetInfo^.TargetFlags then begin
|
||||||
|
ExceptionMessage := GetText('^Exception(%s).FMessage', [ExceptInfo.ObjAddr]);
|
||||||
|
if FLastExecResult.State <> dsError then
|
||||||
|
Exclude(TargetInfo^.TargetFlags, tfExceptionIsPointer);
|
||||||
|
end;
|
||||||
|
if FLastExecResult.State = dsError then
|
||||||
|
ExceptionMessage := GetText('^^char(^%s(%s)+1)^', [PointerTypeCast, ExceptInfo.ObjAddr]);
|
||||||
|
end;
|
||||||
//ExceptionMessage := GetText('^^Exception($fp+8)^^.FMessage', []);
|
//ExceptionMessage := GetText('^^Exception($fp+8)^^.FMessage', []);
|
||||||
end else begin
|
end else begin
|
||||||
// Only works if Exception class is not changed. FMessage must be first member
|
// Only works if Exception class is not changed. FMessage must be first member
|
||||||
@ -10898,6 +10907,7 @@ begin
|
|||||||
if not ExecuteCommand('x/s ' + AExpression, AValues, R, [],
|
if not ExecuteCommand('x/s ' + AExpression, AValues, R, [],
|
||||||
DebuggerProperties.TimeoutForEval)
|
DebuggerProperties.TimeoutForEval)
|
||||||
then begin
|
then begin
|
||||||
|
FLastExecResult.State := dsError;
|
||||||
Result := '';
|
Result := '';
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -10911,6 +10921,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if not ExecuteCommand('x/c ' + AExpression, AValues, R)
|
if not ExecuteCommand('x/c ' + AExpression, AValues, R)
|
||||||
then begin
|
then begin
|
||||||
|
FLastExecResult.State := dsError;
|
||||||
Result := '';
|
Result := '';
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user