mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 09:19:41 +02:00
Merged revision(s) 57089 #dee589f02f, 57101-57103 #6f95f40044-#6f95f40044, 57198 #392a64d93b from trunk:
Debbugger: Do not always auto adjust the stackframe when stopping. (temp fix) Issue #0032978 ........ IDE, Debugger: fixed name for "step to cursor". Two different names where in use for this. ........ IDE: removed unused caption resource for "run to cursor". Clean up for rev 57101 #6f95f40044 ........ Debugger: Allow pause button to abort auto-continue of breakpoint ........ Debugger, GDBMI: fix range check, when comparing qword for min() Issue #033106 ........ git-svn-id: branches/fixes_1_8@57211 -
This commit is contained in:
parent
5e313cd71c
commit
735cd248e4
@ -1932,6 +1932,7 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RegisterDebugger(const ADebuggerClass: TDebuggerClass);
|
procedure RegisterDebugger(const ADebuggerClass: TDebuggerClass);
|
||||||
|
function MinDbgPtr(a, b: TDBGPtr): TDBGPtr;inline; overload;
|
||||||
|
|
||||||
function dbgs(AState: TDBGState): String; overload;
|
function dbgs(AState: TDBGState): String; overload;
|
||||||
function dbgs(ADataState: TDebuggerDataState): String; overload;
|
function dbgs(ADataState: TDebuggerDataState): String; overload;
|
||||||
@ -1982,6 +1983,14 @@ begin
|
|||||||
MDebuggerClasses.AddObject(ADebuggerClass.ClassName, TObject(Pointer(ADebuggerClass)));
|
MDebuggerClasses.AddObject(ADebuggerClass.ClassName, TObject(Pointer(ADebuggerClass)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function MinDbgPtr(a, b: TDBGPtr): TDBGPtr;
|
||||||
|
begin
|
||||||
|
if a < b then
|
||||||
|
Result := a
|
||||||
|
else
|
||||||
|
Result := b;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure DoFinalization;
|
procedure DoFinalization;
|
||||||
var
|
var
|
||||||
n: Integer;
|
n: Integer;
|
||||||
@ -2189,7 +2198,7 @@ begin
|
|||||||
TryStartAt.GuessedValue := TmpAddr;
|
TryStartAt.GuessedValue := TmpAddr;
|
||||||
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
|
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
|
||||||
// check max size
|
// check max size
|
||||||
if (TryStartAt.Value < AStartAddr - Min(AStartAddr, DAssMaxRangeSize))
|
if (TryStartAt.Value < AStartAddr - MinDbgPtr(AStartAddr, DAssMaxRangeSize))
|
||||||
then begin
|
then begin
|
||||||
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: FStartAddr=', AStartAddr, ' TryStartAt.Value=', TryStartAt.Value ]);
|
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: FStartAddr=', AStartAddr, ' TryStartAt.Value=', TryStartAt.Value ]);
|
||||||
TryStartAt := InitAddress(TmpAddr, avGuessed);
|
TryStartAt := InitAddress(TmpAddr, avGuessed);
|
||||||
@ -2307,7 +2316,7 @@ begin
|
|||||||
then RngBefore := nil;
|
then RngBefore := nil;
|
||||||
{$POP}
|
{$POP}
|
||||||
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
|
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
|
||||||
if (TryStartAt.Value < TryEndAt.Value - Min(TryEndAt.Value, DAssMaxRangeSize))
|
if (TryStartAt.Value < TryEndAt.Value - MinDbgPtr(TryEndAt.Value, DAssMaxRangeSize))
|
||||||
then begin
|
then begin
|
||||||
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: TryEndAt.Value=', TryEndAt.Value, ' TryStartAt.Value=', TryStartAt.Value ]);
|
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: TryEndAt.Value=', TryEndAt.Value, ' TryStartAt.Value=', TryStartAt.Value ]);
|
||||||
TryStartAt := InitAddress(TmpAddr, avGuessed);
|
TryStartAt := InitAddress(TmpAddr, avGuessed);
|
||||||
|
@ -396,8 +396,8 @@ type
|
|||||||
function CheckHasType(TypeName: String; TypeFlag: TGDBMITargetFlag): TGDBMIExecResult;
|
function CheckHasType(TypeName: String; TypeFlag: TGDBMITargetFlag): TGDBMIExecResult;
|
||||||
function PointerTypeCast: string;
|
function PointerTypeCast: string;
|
||||||
function FrameToLocation(const AFrame: String = ''): TDBGLocationRec;
|
function FrameToLocation(const AFrame: String = ''): TDBGLocationRec;
|
||||||
procedure ProcessFrame(const ALocation: TDBGLocationRec); overload;
|
procedure ProcessFrame(ALocation: TDBGLocationRec; ASeachStackForSource: Boolean = True); overload;
|
||||||
procedure ProcessFrame(const AFrame: String = ''); overload;
|
procedure ProcessFrame(const AFrame: String = ''; ASeachStackForSource: Boolean = True); overload;
|
||||||
procedure DoDbgEvent(const ACategory: TDBGEventCategory; const AEventType: TDBGEventType; const AText: String);
|
procedure DoDbgEvent(const ACategory: TDBGEventCategory; const AEventType: TDBGEventType; const AText: String);
|
||||||
property LastExecResult: TGDBMIExecResult read FLastExecResult;
|
property LastExecResult: TGDBMIExecResult read FLastExecResult;
|
||||||
property DefaultTimeOut: Integer read FDefaultTimeOut write FDefaultTimeOut;
|
property DefaultTimeOut: Integer read FDefaultTimeOut write FDefaultTimeOut;
|
||||||
@ -6005,21 +6005,21 @@ begin
|
|||||||
if Reason = 'function-finished'
|
if Reason = 'function-finished'
|
||||||
then begin
|
then begin
|
||||||
SetDebuggerState(dsPause);
|
SetDebuggerState(dsPause);
|
||||||
ProcessFrame(List.Values['frame']);
|
ProcessFrame(List.Values['frame'], False);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Reason = 'end-stepping-range'
|
if Reason = 'end-stepping-range'
|
||||||
then begin
|
then begin
|
||||||
SetDebuggerState(dsPause);
|
SetDebuggerState(dsPause);
|
||||||
ProcessFrame(List.Values['frame']);
|
ProcessFrame(List.Values['frame'], False);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Reason = 'location-reached'
|
if Reason = 'location-reached'
|
||||||
then begin
|
then begin
|
||||||
SetDebuggerState(dsPause);
|
SetDebuggerState(dsPause);
|
||||||
ProcessFrame(List.Values['frame']);
|
ProcessFrame(List.Values['frame'], False);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -11132,18 +11132,23 @@ begin
|
|||||||
Frame.Free;
|
Frame.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBMIDebuggerCommand.ProcessFrame(const ALocation: TDBGLocationRec);
|
procedure TGDBMIDebuggerCommand.ProcessFrame(ALocation: TDBGLocationRec;
|
||||||
|
ASeachStackForSource: Boolean);
|
||||||
begin
|
begin
|
||||||
|
// TODO: process stack in gdbmi debugger // currently: signal IDE
|
||||||
|
if (not ASeachStackForSource) and (ALocation.SrcLine < 0) then
|
||||||
|
ALocation.SrcLine := -2;
|
||||||
FTheDebugger.DoCurrent(ALocation); // TODO: only selected callers
|
FTheDebugger.DoCurrent(ALocation); // TODO: only selected callers
|
||||||
FTheDebugger.FCurrentLocation := ALocation;
|
FTheDebugger.FCurrentLocation := ALocation;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBMIDebuggerCommand.ProcessFrame(const AFrame: String);
|
procedure TGDBMIDebuggerCommand.ProcessFrame(const AFrame: String;
|
||||||
|
ASeachStackForSource: Boolean);
|
||||||
var
|
var
|
||||||
Location: TDBGLocationRec;
|
Location: TDBGLocationRec;
|
||||||
begin
|
begin
|
||||||
Location := FrameToLocation(AFrame);
|
Location := FrameToLocation(AFrame);
|
||||||
ProcessFrame(Location);
|
ProcessFrame(Location, ASeachStackForSource);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGDBMIDebuggerCommand.DoDbgEvent(const ACategory: TDBGEventCategory;
|
procedure TGDBMIDebuggerCommand.DoDbgEvent(const ACategory: TDBGEventCategory;
|
||||||
|
@ -1331,7 +1331,7 @@ begin
|
|||||||
SrcLine := ALocation.SrcLine;
|
SrcLine := ALocation.SrcLine;
|
||||||
CurrentSourceUnitInfo := nil;
|
CurrentSourceUnitInfo := nil;
|
||||||
|
|
||||||
if SrcLine < 1
|
if (SrcLine < 1) and (SrcLine <> -2) // TODO: this should move to the debugger
|
||||||
then begin
|
then begin
|
||||||
// jump to the deepest stack frame with debugging info
|
// jump to the deepest stack frame with debugging info
|
||||||
// TODO: Only below the frame supplied by debugger
|
// TODO: Only below the frame supplied by debugger
|
||||||
@ -1942,7 +1942,7 @@ begin
|
|||||||
or (dcRun in FDebugger.Commands) or (FDebugger.State = dsIdle));
|
or (dcRun in FDebugger.Commands) or (FDebugger.State = dsIdle));
|
||||||
// Pause
|
// Pause
|
||||||
itmRunMenuPause.Enabled := CanRun and DebuggerIsValid
|
itmRunMenuPause.Enabled := CanRun and DebuggerIsValid
|
||||||
and (dcPause in FDebugger.Commands);
|
and ((dcPause in FDebugger.Commands) or FAutoContinueTimer.Enabled);
|
||||||
// Show execution point
|
// Show execution point
|
||||||
itmRunMenuShowExecutionPoint.Enabled := CanRun and DebuggerIsValid
|
itmRunMenuShowExecutionPoint.Enabled := CanRun and DebuggerIsValid
|
||||||
and (FDebugger.State = dsPause);
|
and (FDebugger.State = dsPause);
|
||||||
@ -2442,6 +2442,7 @@ begin
|
|||||||
if (MainIDE.ToolStatus <> itDebugger)
|
if (MainIDE.ToolStatus <> itDebugger)
|
||||||
or (FDebugger = nil) or Destroying
|
or (FDebugger = nil) or Destroying
|
||||||
then Exit;
|
then Exit;
|
||||||
|
FAutoContinueTimer.Enabled := False;
|
||||||
FDebugger.Pause;
|
FDebugger.Pause;
|
||||||
Result := mrOk;
|
Result := mrOk;
|
||||||
end;
|
end;
|
||||||
|
@ -2833,7 +2833,6 @@ resourcestring
|
|||||||
uemAddWatchAtCursor = 'Add &Watch At Cursor';
|
uemAddWatchAtCursor = 'Add &Watch At Cursor';
|
||||||
uemAddWatchPointAtCursor = 'Add Watch&Point At Cursor';
|
uemAddWatchPointAtCursor = 'Add Watch&Point At Cursor';
|
||||||
uemInspect = '&Inspect ...';
|
uemInspect = '&Inspect ...';
|
||||||
uemRunToCursor='&Run to Cursor';
|
|
||||||
uemViewCallStack = 'View Call Stack';
|
uemViewCallStack = 'View Call Stack';
|
||||||
uemMovePageLeft='Move Page Left';
|
uemMovePageLeft='Move Page Left';
|
||||||
uemMovePageRight='Move Page Right';
|
uemMovePageRight='Move Page Right';
|
||||||
|
@ -1661,7 +1661,7 @@ begin
|
|||||||
'Inspect...', uemInspect, nil, nil, nil, 'debugger_inspect');
|
'Inspect...', uemInspect, nil, nil, nil, 'debugger_inspect');
|
||||||
SrcEditMenuInspect.Enabled:=False;
|
SrcEditMenuInspect.Enabled:=False;
|
||||||
SrcEditMenuRunToCursor:=RegisterIDEMenuCommand(AParent,
|
SrcEditMenuRunToCursor:=RegisterIDEMenuCommand(AParent,
|
||||||
'Run to cursor', uemRunToCursor, nil, nil, nil, 'menu_run_cursor');
|
'Run to cursor', lisMenuRunToCursor, nil, nil, nil, 'menu_run_cursor');
|
||||||
SrcEditMenuViewCallStack:=RegisterIDEMenuCommand(AParent,
|
SrcEditMenuViewCallStack:=RegisterIDEMenuCommand(AParent,
|
||||||
'View Call Stack', uemViewCallStack, nil, @ExecuteIdeMenuClick, nil, 'debugger_call_stack');
|
'View Call Stack', uemViewCallStack, nil, @ExecuteIdeMenuClick, nil, 'debugger_call_stack');
|
||||||
{%endregion}
|
{%endregion}
|
||||||
|
Loading…
Reference in New Issue
Block a user