mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 20:00:26 +02:00
FpDebug: Improve Step-over/in when stepping of the last "end" line of a procedure. Always step to next line in caller.
git-svn-id: trunk@63075 -
This commit is contained in:
parent
3fb68e39a9
commit
c6680d5c01
@ -119,8 +119,8 @@ type
|
|||||||
FStoreStepInfoAtInit: Boolean;
|
FStoreStepInfoAtInit: Boolean;
|
||||||
protected
|
protected
|
||||||
procedure Init; override;
|
procedure Init; override;
|
||||||
procedure UpdateThreadStepInfoAfterStepOut;
|
procedure UpdateThreadStepInfoAfterStepOut(ANextOnlyStopOnStartLine: Boolean);
|
||||||
function HasSteppedAwayFromOriginLine: boolean; // Call only, if in original frame (or updated frame)
|
function HasSteppedAwayFromOriginLine(ANextOnlyStopOnStartLine: Boolean): boolean; // Call only, if in original frame (or updated frame)
|
||||||
|
|
||||||
procedure StoreWasAtJumpInstruction;
|
procedure StoreWasAtJumpInstruction;
|
||||||
function IsAtJumpPad: Boolean;
|
function IsAtJumpPad: Boolean;
|
||||||
@ -538,11 +538,12 @@ begin
|
|||||||
inherited Init;
|
inherited Init;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDbgControllerLineStepBaseCmd.UpdateThreadStepInfoAfterStepOut;
|
procedure TDbgControllerLineStepBaseCmd.UpdateThreadStepInfoAfterStepOut(
|
||||||
|
ANextOnlyStopOnStartLine: Boolean);
|
||||||
begin
|
begin
|
||||||
if FStepInfoUpdatedForStepOut or not IsSteppedOut then
|
if FStepInfoUpdatedForStepOut or not IsSteppedOut then
|
||||||
exit;
|
exit;
|
||||||
if not FController.NextOnlyStopOnStartLine then
|
if not ANextOnlyStopOnStartLine then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
FStepInfoUnavailAfterStepOut := not IsAtLastHiddenBreakAddr;
|
FStepInfoUnavailAfterStepOut := not IsAtLastHiddenBreakAddr;
|
||||||
@ -555,13 +556,14 @@ begin
|
|||||||
FStepInfoUpdatedForStepOut := True;
|
FStepInfoUpdatedForStepOut := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDbgControllerLineStepBaseCmd.HasSteppedAwayFromOriginLine: boolean;
|
function TDbgControllerLineStepBaseCmd.HasSteppedAwayFromOriginLine(
|
||||||
|
ANextOnlyStopOnStartLine: Boolean): boolean;
|
||||||
var
|
var
|
||||||
CompRes: TFPDCompareStepInfo;
|
CompRes: TFPDCompareStepInfo;
|
||||||
begin
|
begin
|
||||||
Result := IsSteppedOut;
|
Result := IsSteppedOut;
|
||||||
if Result then begin
|
if Result then begin
|
||||||
Result := (not FController.NextOnlyStopOnStartLine);
|
Result := (not ANextOnlyStopOnStartLine);
|
||||||
if Result then
|
if Result then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -656,7 +658,7 @@ procedure TDbgControllerStepIntoLineCmd.DoResolveEvent(var AnEvent: TFPDEvent;
|
|||||||
var
|
var
|
||||||
CompRes: TFPDCompareStepInfo;
|
CompRes: TFPDCompareStepInfo;
|
||||||
begin
|
begin
|
||||||
UpdateThreadStepInfoAfterStepOut;
|
UpdateThreadStepInfoAfterStepOut(True);
|
||||||
|
|
||||||
if IsAtOrOutOfHiddenBreakFrame then begin
|
if IsAtOrOutOfHiddenBreakFrame then begin
|
||||||
RemoveHiddenBreak;
|
RemoveHiddenBreak;
|
||||||
@ -665,7 +667,7 @@ begin
|
|||||||
assert((FHiddenBreakpoint<>nil) xor (FState=siSteppingCurrent), 'TDbgControllerStepIntoLineCmd.DoResolveEvent: (FHiddenBreakpoint<>nil) xor (FState=siSteppingCurrent)');
|
assert((FHiddenBreakpoint<>nil) xor (FState=siSteppingCurrent), 'TDbgControllerStepIntoLineCmd.DoResolveEvent: (FHiddenBreakpoint<>nil) xor (FState=siSteppingCurrent)');
|
||||||
|
|
||||||
if (FState = siSteppingCurrent) then begin
|
if (FState = siSteppingCurrent) then begin
|
||||||
Finished := HasSteppedAwayFromOriginLine;
|
Finished := HasSteppedAwayFromOriginLine(True);
|
||||||
if Finished then
|
if Finished then
|
||||||
Finished := not IsAtJumpPad;
|
Finished := not IsAtJumpPad;
|
||||||
end
|
end
|
||||||
@ -732,7 +734,7 @@ end;
|
|||||||
procedure TDbgControllerStepOverLineCmd.DoResolveEvent(var AnEvent: TFPDEvent;
|
procedure TDbgControllerStepOverLineCmd.DoResolveEvent(var AnEvent: TFPDEvent;
|
||||||
AnEventThread: TDbgThread; out Finished: boolean);
|
AnEventThread: TDbgThread; out Finished: boolean);
|
||||||
begin
|
begin
|
||||||
UpdateThreadStepInfoAfterStepOut;
|
UpdateThreadStepInfoAfterStepOut(True);
|
||||||
if IsAtOrOutOfHiddenBreakFrame then
|
if IsAtOrOutOfHiddenBreakFrame then
|
||||||
RemoveHiddenBreak;
|
RemoveHiddenBreak;
|
||||||
|
|
||||||
@ -740,7 +742,7 @@ begin
|
|||||||
Finished := False;
|
Finished := False;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
Finished := HasSteppedAwayFromOriginLine;
|
Finished := HasSteppedAwayFromOriginLine(True);
|
||||||
if Finished then
|
if Finished then
|
||||||
Finished := not IsAtJumpPad;
|
Finished := not IsAtJumpPad;
|
||||||
end;
|
end;
|
||||||
@ -842,7 +844,7 @@ begin
|
|||||||
FStackFrameInfo.FlagAsSteppedOut;
|
FStackFrameInfo.FlagAsSteppedOut;
|
||||||
|
|
||||||
if IsSteppedOut or IsAtHiddenBreak then begin
|
if IsSteppedOut or IsAtHiddenBreak then begin
|
||||||
UpdateThreadStepInfoAfterStepOut;
|
UpdateThreadStepInfoAfterStepOut(FController.NextOnlyStopOnStartLine);
|
||||||
|
|
||||||
if IsAtOrOutOfHiddenBreakFrame then
|
if IsAtOrOutOfHiddenBreakFrame then
|
||||||
RemoveHiddenBreak;
|
RemoveHiddenBreak;
|
||||||
@ -850,7 +852,7 @@ begin
|
|||||||
if FHiddenBreakpoint <> nil then
|
if FHiddenBreakpoint <> nil then
|
||||||
Finished := False
|
Finished := False
|
||||||
else
|
else
|
||||||
Finished := HasSteppedAwayFromOriginLine;
|
Finished := HasSteppedAwayFromOriginLine(FController.NextOnlyStopOnStartLine);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Finished then
|
if Finished then
|
||||||
|
Loading…
Reference in New Issue
Block a user