mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 06:20:17 +02:00
MWE: + Added initial signal and exception handling
git-svn-id: trunk@3130 -
This commit is contained in:
parent
9b2aa2ff7e
commit
129560e5f4
@ -63,6 +63,7 @@ type
|
|||||||
FExceptionBreakID: Integer;
|
FExceptionBreakID: Integer;
|
||||||
FVersion: String;
|
FVersion: String;
|
||||||
FPauseWaitState: TGDBMIPauseWaitState;
|
FPauseWaitState: TGDBMIPauseWaitState;
|
||||||
|
FInExecuteCount: Integer;
|
||||||
// Implementation of external functions
|
// Implementation of external functions
|
||||||
function GDBEvaluate(const AExpression: String; var AResult: String): Boolean;
|
function GDBEvaluate(const AExpression: String; var AResult: String): Boolean;
|
||||||
function GDBRun: Boolean;
|
function GDBRun: Boolean;
|
||||||
@ -469,8 +470,9 @@ begin
|
|||||||
// If we are here we can process the command directly
|
// If we are here we can process the command directly
|
||||||
Result := True;
|
Result := True;
|
||||||
FirstCmd := True;
|
FirstCmd := True;
|
||||||
FPauseWaitState := pwsNone;
|
|
||||||
repeat
|
repeat
|
||||||
|
Inc(FInExecuteCount);
|
||||||
|
try
|
||||||
ResultValues := '';
|
ResultValues := '';
|
||||||
ResultState := dsNone;
|
ResultState := dsNone;
|
||||||
|
|
||||||
@ -494,6 +496,9 @@ begin
|
|||||||
if ResultState = dsRun
|
if ResultState = dsRun
|
||||||
then R := ProcessRunning(StoppedParams);
|
then R := ProcessRunning(StoppedParams);
|
||||||
|
|
||||||
|
// Delete command first to allow GDB access while processing stopped
|
||||||
|
FCommandQueue.Delete(0);
|
||||||
|
|
||||||
if StoppedParams <> ''
|
if StoppedParams <> ''
|
||||||
then ProcessStopped(StoppedParams, FPauseWaitState = pwsInternal);
|
then ProcessStopped(StoppedParams, FPauseWaitState = pwsInternal);
|
||||||
|
|
||||||
@ -501,7 +506,6 @@ begin
|
|||||||
then CmdInfo^.Callback(ResultState, ResultValues, 0);
|
then CmdInfo^.Callback(ResultState, ResultValues, 0);
|
||||||
|
|
||||||
Dispose(CmdInfo);
|
Dispose(CmdInfo);
|
||||||
FCommandQueue.Delete(0);
|
|
||||||
|
|
||||||
if FirstCmd
|
if FirstCmd
|
||||||
then begin
|
then begin
|
||||||
@ -509,10 +513,14 @@ begin
|
|||||||
AResultValues := ResultValues;
|
AResultValues := ResultValues;
|
||||||
AResultState := ResultState;
|
AResultState := ResultState;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
Dec(FInExecuteCount);
|
||||||
|
end;
|
||||||
|
|
||||||
if FCommandQueue.Count = 0
|
if FCommandQueue.Count = 0
|
||||||
then begin
|
then begin
|
||||||
if (FPauseWaitState = pwsInternal)
|
if (FInExecuteCount = 0)
|
||||||
|
and (FPauseWaitState = pwsInternal)
|
||||||
and (State = dsRun)
|
and (State = dsRun)
|
||||||
then begin
|
then begin
|
||||||
// reset state
|
// reset state
|
||||||
@ -749,6 +757,9 @@ procedure TGDBMIDebugger.Init;
|
|||||||
var
|
var
|
||||||
Line, S: String;
|
Line, S: String;
|
||||||
begin
|
begin
|
||||||
|
FPauseWaitState := pwsNone;
|
||||||
|
FInExecuteCount := 0;
|
||||||
|
|
||||||
if CreateDebugProcess('-silent -i mi')
|
if CreateDebugProcess('-silent -i mi')
|
||||||
then begin
|
then begin
|
||||||
// Get initial debugger lines
|
// Get initial debugger lines
|
||||||
@ -992,6 +1003,13 @@ function TGDBMIDebugger.ProcessStopped(const AParams: String; const AIgnoreSigIn
|
|||||||
ResultList.Free;
|
ResultList.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// check if we should ignore this exception
|
||||||
|
if Exceptions.Find(ExceptionName) <> nil
|
||||||
|
then begin
|
||||||
|
ExecuteCommand('-exec-continue', []);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
if CompactMode
|
if CompactMode
|
||||||
then begin
|
then begin
|
||||||
ExceptionMessage := GetText('^^Exception($fp+8)^^.FMessage', []);
|
ExceptionMessage := GetText('^^Exception($fp+8)^^.FMessage', []);
|
||||||
@ -1942,6 +1960,9 @@ end;
|
|||||||
end.
|
end.
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.30 2003/06/13 19:21:31 marc
|
||||||
|
MWE: + Added initial signal and exception handling
|
||||||
|
|
||||||
Revision 1.29 2003/06/10 23:48:26 marc
|
Revision 1.29 2003/06/10 23:48:26 marc
|
||||||
MWE: * Enabled modification of breakpoints while running
|
MWE: * Enabled modification of breakpoints while running
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user