mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 01:08:12 +02:00
Debugger: fix asm-stepping bring source-edit to front (work around) Issue #40415
(cherry picked from commit 478b6dcf4b
)
This commit is contained in:
parent
52aafa7090
commit
f051d0bd65
@ -143,7 +143,7 @@ type
|
||||
FDialogs: array[TDebugDialogType] of TDebuggerDlg;
|
||||
FInStateChange: Boolean;
|
||||
FPrevShownWindow: HWND;
|
||||
FStepping: Boolean;
|
||||
FStepping, FAsmStepping: Boolean;
|
||||
// keep track of the last reported location
|
||||
FCurrentLocation: TDBGLocationRec;
|
||||
// last hit breakpoint
|
||||
@ -1700,6 +1700,7 @@ begin
|
||||
a := FAsmWindowShouldAutoClose or (FDialogs[ddtAssembler] = nil) or (not FDialogs[ddtAssembler].Visible);
|
||||
ViewDebugDialog(ddtAssembler);
|
||||
FAsmWindowShouldAutoClose := a and EnvironmentDebugOpts.DebuggerAutoCloseAsm;
|
||||
FAsmStepping := False;
|
||||
exit;
|
||||
end;
|
||||
if (FDialogs[ddtAssembler] <> nil) and FAsmWindowShouldAutoClose then
|
||||
@ -1716,8 +1717,12 @@ begin
|
||||
i := SrcLine;
|
||||
if (Editor <> nil) then
|
||||
i := Editor.DebugToSourceLine(i);
|
||||
if MainIDE.DoJumpToCodePosition(nil,nil,NewSource,1,i,-1,-1,-1,Flags)<>mrOk
|
||||
then exit;
|
||||
if not (FAsmStepping and (FDialogs[ddtAssembler] <> nil) and
|
||||
FDialogs[ddtAssembler].IsVisible and FDialogs[ddtAssembler].Active )
|
||||
then
|
||||
if MainIDE.DoJumpToCodePosition(nil,nil,NewSource,1,i,-1,-1,-1,Flags)<>mrOk
|
||||
then exit;
|
||||
FAsmStepping := False;
|
||||
|
||||
// mark execution line
|
||||
if (Editor = nil) and (SourceEditorManager <> nil) then
|
||||
@ -2811,6 +2816,7 @@ begin
|
||||
end;
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := False;
|
||||
FDebugger.StepInto;
|
||||
Result := mrOk;
|
||||
end;
|
||||
@ -2826,6 +2832,7 @@ begin
|
||||
end;
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := False;
|
||||
FDebugger.StepOver;
|
||||
Result := mrOk;
|
||||
end;
|
||||
@ -2841,6 +2848,7 @@ begin
|
||||
end;
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := True;
|
||||
FDebugger.StepIntoInstr;
|
||||
Result := mrOk;
|
||||
// Todo: move to DebuggerChangeState (requires the last run-command-type to be avail)
|
||||
@ -2858,6 +2866,7 @@ begin
|
||||
end;
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := True;
|
||||
FDebugger.StepOverInstr;
|
||||
Result := mrOk;
|
||||
// Todo: move to DebuggerChangeState (requires the last run-command-type to be avail)
|
||||
@ -2881,6 +2890,7 @@ begin
|
||||
end;
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := False;
|
||||
FDebugger.StepOut;
|
||||
Result := mrOk;
|
||||
end;
|
||||
@ -2892,6 +2902,7 @@ begin
|
||||
FRunTimer.Enabled:=false;
|
||||
Exclude(FManagerStates,dmsWaitForRun);
|
||||
Exclude(FManagerStates,dmsWaitForAttach);
|
||||
FAsmStepping := False;
|
||||
|
||||
SourceEditorManager.ClearExecutionLines;
|
||||
if (MainIDE.ToolStatus=itDebugger) and (FDebugger<>nil) and (not Destroying)
|
||||
@ -3043,6 +3054,7 @@ begin
|
||||
end;
|
||||
Include(FManagerStates,dmsRunning);
|
||||
FStepping:=False;
|
||||
FAsmStepping := False;
|
||||
try
|
||||
FDebugger.Run;
|
||||
finally
|
||||
@ -3305,6 +3317,7 @@ begin
|
||||
else UnitFilename:=BuildBoss.GetTestUnitFilename(ActiveUnitInfo);
|
||||
|
||||
FStepping:=True;
|
||||
FAsmStepping := False;
|
||||
FDebugger.RunTo(ExtractFilename(UnitFilename),
|
||||
TSourceEditor(ActiveSrcEdit).EditorComponent.CaretY);
|
||||
|
||||
@ -3370,6 +3383,7 @@ begin
|
||||
end;
|
||||
Include(FManagerStates,dmsRunning);
|
||||
FStepping:=False;
|
||||
FAsmStepping := False;
|
||||
try
|
||||
FDebugger.Attach(FAttachToID);
|
||||
finally
|
||||
|
Loading…
Reference in New Issue
Block a user