mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 09:40:21 +02:00
debugger: save and restore call stack depth. Issue #29508
git-svn-id: trunk@51586 -
This commit is contained in:
parent
2ee5aeec56
commit
6745d36137
@ -39,7 +39,7 @@ uses
|
||||
SysUtils, Classes, Controls, Forms, LCLProc, LazLoggerBase,
|
||||
IDEWindowIntf, DebuggerStrConst,
|
||||
ComCtrls, Debugger, DebuggerDlg, Menus, ClipBrd, ExtCtrls, StdCtrls,
|
||||
ActnList, IDEImagesIntf, IDECommands;
|
||||
ActnList, IDEImagesIntf, IDECommands, EnvironmentOpts;
|
||||
|
||||
type
|
||||
|
||||
@ -193,11 +193,6 @@ begin
|
||||
ThreadsNotification.OnCurrent := @CallStackChanged;
|
||||
SnapshotNotification.OnCurrent := @CallStackChanged;
|
||||
|
||||
FViewLimit := 10;
|
||||
FViewCount := 10;
|
||||
FViewStart := 0;
|
||||
FInUpdateView := False;
|
||||
actViewLimit.Caption := popLimit10.Caption;
|
||||
actToggleBreakPoint.ShortCut := IDECommandList.FindIDECommand(ecToggleBreakPoint).AsShortCut;
|
||||
|
||||
for i := low(COL_WIDTHS) to high(COL_WIDTHS) do
|
||||
@ -589,6 +584,7 @@ begin
|
||||
if FViewCount = TMenuItem(Sender).Tag then Exit;
|
||||
FViewCount := TMenuItem(Sender).Tag;
|
||||
ViewLimit := FViewCount;
|
||||
EnvironmentOptions.DebuggerConfig.DlgCallStackConfig.ViewCount := FViewCount;
|
||||
actViewLimit.Caption := TMenuItem(Sender).Caption;
|
||||
end;
|
||||
|
||||
@ -728,13 +724,13 @@ end;
|
||||
procedure TCallStackDlg.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: integer;
|
||||
curPopLimit: TMenuItem;
|
||||
begin
|
||||
Caption := lisMenuViewCallStack;
|
||||
ToolButtonPower.Caption := lisDbgWinPower;
|
||||
ToolButtonPower.Hint := lisDbgWinPowerHint;
|
||||
for i:= 0 to mnuLimit.Items.Count-1 do
|
||||
mnuLimit.Items[i].Caption:= Format(lisMaxS, [mnuLimit.Items[i].Tag]);
|
||||
actViewLimit.Caption := mnuLimit.Items[0].Caption;
|
||||
actViewMore.Caption := lisMore;
|
||||
actViewTop.Caption := lisCSTop;
|
||||
actViewBottom.Caption := lisCSBottom;
|
||||
@ -745,6 +741,23 @@ begin
|
||||
actSetCurrent.Caption := lisCurrent;
|
||||
actCopyAll.Caption := lisCopyAll;
|
||||
|
||||
FViewCount := EnvironmentOptions.DebuggerConfig.DlgCallStackConfig.ViewCount;
|
||||
curPopLimit := nil;
|
||||
for i := 0 to mnuLimit.Items.Count-1 do
|
||||
if mnuLimit.Items[i].Tag = FViewCount then
|
||||
begin
|
||||
curPopLimit := mnuLimit.Items[i];
|
||||
Break;
|
||||
end;
|
||||
if curPopLimit=nil then
|
||||
curPopLimit := popLimit10;
|
||||
FViewCount := curPopLimit.Tag;
|
||||
FViewLimit := FViewCount;
|
||||
FViewStart := 0;
|
||||
FInUpdateView := False;
|
||||
actViewLimit.Caption := curPopLimit.Caption;
|
||||
ToolButtonMax.Caption := actViewLimit.Caption;
|
||||
|
||||
lvCallStack.Columns[1].Caption:= lisIndex;
|
||||
lvCallStack.Columns[2].Caption:= histdlgColumnLoc;
|
||||
lvCallStack.Columns[3].Caption:= dlgAddHiAttrGroupLine;
|
||||
|
@ -79,9 +79,22 @@ type
|
||||
property ColumnValueWidth: Integer read FColumnValueWidth write FColumnValueWidth;
|
||||
end;
|
||||
|
||||
{ TDebuggerWatchesDlgConfig }
|
||||
|
||||
TDebuggerCallStackDlgConfig = class(TDebuggerConfigStoreBase)
|
||||
private
|
||||
FViewCount: Integer;
|
||||
public
|
||||
constructor Create;
|
||||
procedure Init; override;
|
||||
published
|
||||
property ViewCount: Integer read FViewCount write FViewCount;
|
||||
end;
|
||||
|
||||
TDebuggerConfigStore = class(TDebuggerConfigStoreBase)
|
||||
private
|
||||
FDebuggerClass: String;
|
||||
FDlgCallStackConfig: TDebuggerCallStackDlgConfig;
|
||||
FTDebuggerWatchesDlgConfig: TDebuggerWatchesDlgConfig;
|
||||
public
|
||||
procedure Load; override;
|
||||
@ -91,6 +104,7 @@ type
|
||||
destructor Destroy; override;
|
||||
property DebuggerClass: String read FDebuggerClass write FDebuggerClass;
|
||||
property DlgWatchesConfig: TDebuggerWatchesDlgConfig read FTDebuggerWatchesDlgConfig;
|
||||
property DlgCallStackConfig: TDebuggerCallStackDlgConfig read FDlgCallStackConfig write FDlgCallStackConfig;
|
||||
published
|
||||
end;
|
||||
|
||||
@ -1816,6 +1830,18 @@ begin
|
||||
Result:=bpaStop;
|
||||
end;
|
||||
|
||||
{ TDebuggerCallStackDlgConfig }
|
||||
|
||||
constructor TDebuggerCallStackDlgConfig.Create;
|
||||
begin
|
||||
Init;
|
||||
end;
|
||||
|
||||
procedure TDebuggerCallStackDlgConfig.Init;
|
||||
begin
|
||||
inherited Init;
|
||||
end;
|
||||
|
||||
{ TIdeThreadFrameEntry }
|
||||
|
||||
function TIdeThreadFrameEntry.GetUnitInfoProvider: TDebuggerUnitInfoProvider;
|
||||
@ -1942,6 +1968,13 @@ begin
|
||||
finally
|
||||
ConfigStore.UndoAppendBasePath;
|
||||
end;
|
||||
ConfigStore.AppendBasePath('CallStackDlg/');
|
||||
try
|
||||
FDlgCallStackConfig.ConfigStore := ConfigStore;
|
||||
FDlgCallStackConfig.Load;
|
||||
finally
|
||||
ConfigStore.UndoAppendBasePath;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebuggerConfigStore.Save;
|
||||
@ -1956,17 +1989,26 @@ begin
|
||||
finally
|
||||
ConfigStore.UndoAppendBasePath;
|
||||
end;
|
||||
ConfigStore.AppendBasePath('CallStackDlg/');
|
||||
try
|
||||
FDlgCallStackConfig.ConfigStore := ConfigStore;
|
||||
FDlgCallStackConfig.Save;
|
||||
finally
|
||||
ConfigStore.UndoAppendBasePath;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TDebuggerConfigStore.Create;
|
||||
begin
|
||||
FTDebuggerWatchesDlgConfig := TDebuggerWatchesDlgConfig.Create;
|
||||
FDlgCallStackConfig := TDebuggerCallStackDlgConfig.Create;
|
||||
end;
|
||||
|
||||
destructor TDebuggerConfigStore.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
FreeAndNil(FTDebuggerWatchesDlgConfig);
|
||||
FreeAndNil(FDlgCallStackConfig);
|
||||
end;
|
||||
|
||||
{ TDebuggerUnitInfoProvider }
|
||||
|
Loading…
Reference in New Issue
Block a user