Merge branch 'fixes-fpdbgrspclasses' into 'main'

Fixes fpdbgrspclasses

See merge request freepascal.org/lazarus/lazarus!269
This commit is contained in:
Martin 2024-02-06 13:34:41 +00:00
commit 69f6fa4ec1

View File

@ -74,6 +74,7 @@ type
FRegArrayLength: integer;
function AnalyseDebugEvent(AThread: TDbgThread): TFPDEvent; override;
function CreateWatchPointData: TFpWatchPointData; override;
procedure InitializeLoaders; override;
// Insert/Delete break points on target
// TODO: if target doesn't support break points or have limited break points
@ -527,7 +528,7 @@ end;
function TDbgRspProcess.Continue(AProcess: TDbgProcess; AThread: TDbgThread; SingleStep: boolean): boolean;
procedure DoLocalStep(TheThread: TDbgThread);
function DoLocalStep(TheThread: TDbgThread): Integer;
var
res: boolean;
s: string;
@ -536,9 +537,12 @@ function TDbgRspProcess.Continue(AProcess: TDbgProcess; AThread: TDbgThread; Sin
TDbgRspThread(TheThread).ResetPauseStates; // So BeforeContinue will not run again
TDbgRspThread(TheThread).FIsPaused := True;
if res then
RspConnection.WaitForSignal(s)
Result := RspConnection.WaitForSignal(s)
else
begin
DebugLn(DBG_WARNINGS, ['Error local single stepping thread ', TheThread.ID]);
Result := -1;
end;
end;
var
@ -572,7 +576,9 @@ begin
ThreadToContinue.BeforeContinue;
if (ThreadToContinue.GetInstructionPointerRegisterValue = PC) then
DoLocalStep(ThreadToContinue);
repeat
FStatus := DoLocalStep(ThreadToContinue);
until (FStatus = -1) or (FStatus = SIGTRAP);
end;
end;
@ -608,14 +614,14 @@ begin
AThread.BeforeContinue;
// In qemu, needs to step over breakpoint for continue command to work
DoLocalStep(AThread);
FStatus := DoLocalStep(AThread);
if not SingleStep then
begin
result := RspConnection.Continue();
TDbgRspThread(AThread).ResetPauseStates;
FStatus := 0; // should update status by calling WaitForSignal
end;
FStatus := 0; // should update status by calling WaitForSignal
end;
if not FThreadMap.HasId(AThread.ID) then
@ -812,6 +818,11 @@ begin
end;
end;
function TDbgRspProcess.CreateWatchPointData: TFpWatchPointData;
begin
Result := TFpRspWatchPointData.Create;
end;
initialization
DBG_VERBOSE := DebugLogger.FindOrRegisterLogGroup('DBG_VERBOSE' {$IFDEF DBG_VERBOSE} , True {$ENDIF} );
DBG_WARNINGS := DebugLogger.FindOrRegisterLogGroup('DBG_WARNINGS' {$IFDEF DBG_WARNINGS} , True {$ENDIF} );