gdb com, add setting to limit the call stack depth

This commit is contained in:
Basile Burg 2020-07-02 06:35:40 +02:00
parent 6bce0a2c14
commit 40b2a0b67f
3 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,9 @@
# v3.9.6-dev
## Enhancements
- GDB commander: added the _macCallStackDepth_ option. It prevents slowdown when on automatic break caused by a stack overflow.
## Bugs fixed
- Editor: wrong position indicated in the call tips when starting to type an array literal, a slice or any other expression involving the square brackets. (#51)

View File

@ -353,7 +353,7 @@ inherited GdbWidget: TGdbWidget
end
object button4: TDexedToolButton[2]
Left = 205
Height = 28
Height = 5
Top = 0
AutoSize = True
Caption = 'button4'

View File

@ -8,7 +8,7 @@ uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, RegExpr, ComCtrls,
PropEdits, GraphPropEdits, RTTIGrids, Dialogs, ExtCtrls, Menus, Buttons,
StdCtrls, process, fpjson, typinfo, Unix, ListViewFilterEdit, SynEdit,
ObjectInspector,
ObjectInspector, math,
u_common, u_interfaces, u_widget, u_processes, u_observer, u_synmemo,
u_sharedres, u_stringrange, u_dsgncontrols, u_dialogs, u_dbgitf,
u_ddemangle, u_writableComponent, EditBtn, strutils, u_controls;
@ -315,10 +315,12 @@ type
fHideCpuView: boolean;
fDlangBreakpoints: TDlangBreakpoints;
fCurrentEvalKind: TGdbEvalKind;
fMaxCallStackDepth: integer;
procedure setIgnoredSignals(value: TStringList);
procedure setCommandsHistory(value: TStringList);
procedure setCustomEvalHistory(value: TStringList);
procedure setShortcuts(value: TDebugShortcuts);
procedure setMaxCallStackDepth(value: integer);
procedure cleanInvalidHistoryEntries;
published
property asmSyntax: TAsmSyntax read fAsmSyntax write fAsmSyntax;
@ -335,6 +337,7 @@ type
property hideCpuView: boolean read fHideCpuView write fHideCpuView default false;
property ignoredSignals: TStringList read fIgnoredSignals write setIgnoredSignals;
property keepRedirectedStreams: boolean read fKeepRedirectedStreams write fKeepRedirectedStreams default false;
property maxCallStackDepth: integer read fMaxCallStackDepth write setMaxCallStackDepth default 100;
property shortcuts: TDebugShortcuts read fShortcuts write setShortcuts;
property showGdbOutput: boolean read fShowGdbOutput write fShowGdbOutput;
property showRawMiOutput: boolean read fShowRawMiOutput write fShowRawMiOutput;
@ -679,6 +682,7 @@ var
d: TDlangBreakpoint;
begin
inherited;
fMaxCallStackDepth := 100;
fAutoDemangle := true;
fAutoGetCallStack:= true;
fAutoGetRegisters:= true;
@ -749,6 +753,13 @@ begin
fShortcuts.assign(value);
end;
procedure TDebugOptionsBase.setMaxCallStackDepth(value: integer);
begin
value := max(1, value);
value := min(1000, value);
fMaxCallStackDepth := value;
end;
procedure TDebugOptionsBase.assign(source: TPersistent);
var
src: TDebugOptionsBase;
@ -2796,7 +2807,7 @@ end;
procedure TGdbWidget.infoStack;
begin
gdbCommand('-stack-list-frames', @gdboutJsonize);
gdbCommand('-stack-list-frames 0 ' + intToStr(fOptions.maxCallStackDepth - 1), @gdboutJsonize);
end;
procedure TGdbWidget.infoVariables;