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:
maxim 2018-02-01 22:40:14 +00:00
parent 5e313cd71c
commit 735cd248e4
5 changed files with 28 additions and 14 deletions

View File

@ -1932,6 +1932,7 @@ type
end;
procedure RegisterDebugger(const ADebuggerClass: TDebuggerClass);
function MinDbgPtr(a, b: TDBGPtr): TDBGPtr;inline; overload;
function dbgs(AState: TDBGState): String; overload;
function dbgs(ADataState: TDebuggerDataState): String; overload;
@ -1982,6 +1983,14 @@ begin
MDebuggerClasses.AddObject(ADebuggerClass.ClassName, TObject(Pointer(ADebuggerClass)));
end;
function MinDbgPtr(a, b: TDBGPtr): TDBGPtr;
begin
if a < b then
Result := a
else
Result := b;
end;
procedure DoFinalization;
var
n: Integer;
@ -2189,7 +2198,7 @@ begin
TryStartAt.GuessedValue := TmpAddr;
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
// check max size
if (TryStartAt.Value < AStartAddr - Min(AStartAddr, DAssMaxRangeSize))
if (TryStartAt.Value < AStartAddr - MinDbgPtr(AStartAddr, DAssMaxRangeSize))
then begin
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: FStartAddr=', AStartAddr, ' TryStartAt.Value=', TryStartAt.Value ]);
TryStartAt := InitAddress(TmpAddr, avGuessed);
@ -2307,7 +2316,7 @@ begin
then RngBefore := nil;
{$POP}
AdjustToRangeOrKnowFunctionStart(TryStartAt, RngBefore);
if (TryStartAt.Value < TryEndAt.Value - Min(TryEndAt.Value, DAssMaxRangeSize))
if (TryStartAt.Value < TryEndAt.Value - MinDbgPtr(TryEndAt.Value, DAssMaxRangeSize))
then begin
DebugLn(DBG_DISASSEMBLER, ['INFO: Limit Range for Disass: TryEndAt.Value=', TryEndAt.Value, ' TryStartAt.Value=', TryStartAt.Value ]);
TryStartAt := InitAddress(TmpAddr, avGuessed);

View File

@ -396,8 +396,8 @@ type
function CheckHasType(TypeName: String; TypeFlag: TGDBMITargetFlag): TGDBMIExecResult;
function PointerTypeCast: string;
function FrameToLocation(const AFrame: String = ''): TDBGLocationRec;
procedure ProcessFrame(const ALocation: TDBGLocationRec); overload;
procedure ProcessFrame(const AFrame: String = ''); overload;
procedure ProcessFrame(ALocation: TDBGLocationRec; ASeachStackForSource: Boolean = True); overload;
procedure ProcessFrame(const AFrame: String = ''; ASeachStackForSource: Boolean = True); overload;
procedure DoDbgEvent(const ACategory: TDBGEventCategory; const AEventType: TDBGEventType; const AText: String);
property LastExecResult: TGDBMIExecResult read FLastExecResult;
property DefaultTimeOut: Integer read FDefaultTimeOut write FDefaultTimeOut;
@ -6005,21 +6005,21 @@ begin
if Reason = 'function-finished'
then begin
SetDebuggerState(dsPause);
ProcessFrame(List.Values['frame']);
ProcessFrame(List.Values['frame'], False);
Exit;
end;
if Reason = 'end-stepping-range'
then begin
SetDebuggerState(dsPause);
ProcessFrame(List.Values['frame']);
ProcessFrame(List.Values['frame'], False);
Exit;
end;
if Reason = 'location-reached'
then begin
SetDebuggerState(dsPause);
ProcessFrame(List.Values['frame']);
ProcessFrame(List.Values['frame'], False);
Exit;
end;
@ -11132,18 +11132,23 @@ begin
Frame.Free;
end;
procedure TGDBMIDebuggerCommand.ProcessFrame(const ALocation: TDBGLocationRec);
procedure TGDBMIDebuggerCommand.ProcessFrame(ALocation: TDBGLocationRec;
ASeachStackForSource: Boolean);
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.FCurrentLocation := ALocation;
end;
procedure TGDBMIDebuggerCommand.ProcessFrame(const AFrame: String);
procedure TGDBMIDebuggerCommand.ProcessFrame(const AFrame: String;
ASeachStackForSource: Boolean);
var
Location: TDBGLocationRec;
begin
Location := FrameToLocation(AFrame);
ProcessFrame(Location);
ProcessFrame(Location, ASeachStackForSource);
end;
procedure TGDBMIDebuggerCommand.DoDbgEvent(const ACategory: TDBGEventCategory;

View File

@ -1331,7 +1331,7 @@ begin
SrcLine := ALocation.SrcLine;
CurrentSourceUnitInfo := nil;
if SrcLine < 1
if (SrcLine < 1) and (SrcLine <> -2) // TODO: this should move to the debugger
then begin
// jump to the deepest stack frame with debugging info
// TODO: Only below the frame supplied by debugger
@ -1942,7 +1942,7 @@ begin
or (dcRun in FDebugger.Commands) or (FDebugger.State = dsIdle));
// Pause
itmRunMenuPause.Enabled := CanRun and DebuggerIsValid
and (dcPause in FDebugger.Commands);
and ((dcPause in FDebugger.Commands) or FAutoContinueTimer.Enabled);
// Show execution point
itmRunMenuShowExecutionPoint.Enabled := CanRun and DebuggerIsValid
and (FDebugger.State = dsPause);
@ -2442,6 +2442,7 @@ begin
if (MainIDE.ToolStatus <> itDebugger)
or (FDebugger = nil) or Destroying
then Exit;
FAutoContinueTimer.Enabled := False;
FDebugger.Pause;
Result := mrOk;
end;

View File

@ -2833,7 +2833,6 @@ resourcestring
uemAddWatchAtCursor = 'Add &Watch At Cursor';
uemAddWatchPointAtCursor = 'Add Watch&Point At Cursor';
uemInspect = '&Inspect ...';
uemRunToCursor='&Run to Cursor';
uemViewCallStack = 'View Call Stack';
uemMovePageLeft='Move Page Left';
uemMovePageRight='Move Page Right';

View File

@ -1661,7 +1661,7 @@ begin
'Inspect...', uemInspect, nil, nil, nil, 'debugger_inspect');
SrcEditMenuInspect.Enabled:=False;
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,
'View Call Stack', uemViewCallStack, nil, @ExecuteIdeMenuClick, nil, 'debugger_call_stack');
{%endregion}