IdeDebugger: Add up/down navigation to callstack

This commit is contained in:
Martin 2024-09-30 23:36:39 +02:00
parent b854ec9036
commit cca69fe196
28 changed files with 285 additions and 21 deletions

View File

@ -1,15 +1,15 @@
object CallStackDlg: TCallStackDlg
Left = 306
Left = 413
Height = 246
Top = 130
Top = 116
Width = 562
BorderStyle = bsSizeToolWin
Caption = 'CallStack'
ClientHeight = 246
ClientWidth = 562
OnCreate = FormCreate
LCLVersion = '3.99.0.0'
Visible = True
OnCreate = FormCreate
object lvCallStack: TListView
Left = 0
Height = 220
@ -92,14 +92,14 @@ object CallStackDlg: TCallStackDlg
Style = tbsDropDown
end
object ToolButtonGoto: TToolButton
Left = 248
Left = 294
Top = 2
Action = actViewGoto
ImageIndex = 4
ShowCaption = False
end
object ToolButtonCopyAll: TToolButton
Left = 279
Left = 325
Top = 2
Action = actCopyAll
ImageIndex = 5
@ -126,15 +126,27 @@ object CallStackDlg: TCallStackDlg
ImageIndex = 2
ShowCaption = False
end
object ToolButtonBottom: TToolButton
object ToolButtonUp: TToolButton
Left = 175
Top = 2
Action = actViewUp
ShowCaption = False
end
object ToolButtonDown: TToolButton
Left = 198
Top = 2
Action = actViewDown
ShowCaption = False
end
object ToolButtonBottom: TToolButton
Left = 221
Top = 2
Action = actViewBottom
ImageIndex = 3
ShowCaption = False
end
object Panel1: TPanel
Left = 198
Left = 244
Height = 22
Top = 2
Width = 50
@ -147,9 +159,9 @@ object CallStackDlg: TCallStackDlg
Height = 23
Top = 0
Width = 46
OnKeyPress = txtGotoKeyPress
TabOrder = 0
Text = '0'
OnKeyPress = txtGotoKeyPress
end
end
object ToolButtonPower: TToolButton
@ -159,12 +171,12 @@ object CallStackDlg: TCallStackDlg
AutoSize = True
Caption = 'ToolButtonPower'
Down = True
OnClick = ToolButtonPowerClick
ShowCaption = False
Style = tbsCheck
OnClick = ToolButtonPowerClick
end
object ToolButton2: TToolButton
Left = 271
Left = 317
Height = 22
Top = 2
Caption = 'ToolButton2'
@ -209,11 +221,11 @@ object CallStackDlg: TCallStackDlg
Top = 80
object actShow: TAction
Caption = 'Show'
OnExecute = actShowClick
SecondaryShortCuts.Strings = (
'enter'
)
ShortCut = 16470
OnExecute = actShowClick
end
object actViewMore: TAction
Category = 'View'
@ -235,19 +247,14 @@ object CallStackDlg: TCallStackDlg
Caption = 'Top'
OnExecute = actViewTopExecute
end
object actViewBottom: TAction
Category = 'View'
Caption = 'Bottom'
OnExecute = actViewBottomExecute
end
object actSetCurrent: TAction
Caption = 'Current'
OnExecute = actSetAsCurrentClick
end
object actCopyLine: TAction
Caption = 'Copy line'
OnExecute = actCopyLineClick
ShortCut = 16451
OnExecute = actCopyLineClick
end
object actCopyAll: TAction
Caption = 'Copy All'
@ -255,13 +262,28 @@ object CallStackDlg: TCallStackDlg
end
object actToggleBreakPoint: TAction
Caption = 'Toggle Breakpoint'
OnExecute = actToggleBreakPointExecute
ShortCut = 116
OnExecute = actToggleBreakPointExecute
end
object actShowDisass: TAction
Caption = 'actShowDisass'
OnExecute = actShowDisassExecute
end
object actViewUp: TAction
Category = 'View'
Caption = 'actViewUp'
OnExecute = actViewUpExecute
end
object actViewDown: TAction
Category = 'View'
Caption = 'actViewDown'
OnExecute = actViewDownExecute
end
object actViewBottom: TAction
Category = 'View'
Caption = 'Bottom'
OnExecute = actViewBottomExecute
end
end
object mnuLimit: TPopupMenu
Left = 136

View File

@ -60,6 +60,8 @@ type
aclActions: TActionList;
actCopyAll: TAction;
actCopyLine: TAction;
actViewDown: TAction;
actViewUp: TAction;
actShowDisass: TAction;
actToggleBreakPoint: TAction;
actViewBottom: TAction;
@ -73,6 +75,8 @@ type
popShowDisass: TMenuItem;
popToggle: TMenuItem;
Separator1: TMenuItem;
ToolButtonUp: TToolButton;
ToolButtonDown: TToolButton;
ToolButtonPower: TToolButton;
ToolButton2: TToolButton;
ToolButtonTop: TToolButton;
@ -102,10 +106,12 @@ type
procedure actShowDisassExecute(Sender: TObject);
procedure actToggleBreakPointExecute(Sender: TObject);
procedure actViewBottomExecute(Sender: TObject);
procedure actViewDownExecute(Sender: TObject);
procedure actViewGotoExecute(Sender: TObject);
procedure actViewMoreExecute(Sender: TObject);
procedure actViewLimitExecute(Sender: TObject);
procedure actViewTopExecute(Sender: TObject);
procedure actViewUpExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure lvCallStackClick(Sender: TObject);
procedure popCountClick(Sender: TObject);
@ -370,7 +376,7 @@ begin
if FWantedViewStart = MaxInt then
Count := CStack.Count
else
Count := CStack.CountLimited(FWantedViewStart);
Count := CStack.CountLimited(FWantedViewStart+FViewLimit);
if (Count > 0) or (CStack.CountValidity = ddsValid) then begin
FViewStart := Min(FWantedViewStart, Count - FViewLimit);
@ -739,6 +745,22 @@ begin
end;
end;
procedure TCallStackDlg.actViewDownExecute(Sender: TObject);
begin
try
DisableAllActions;
BeginUpdate;
if GetSelectedCallstack = nil then
SetViewStart(0)
else
SetViewStart(FViewStart + ViewLimit);
finally
EndUpdate;
EnableAllActions;
end;
end;
procedure TCallStackDlg.actToggleBreakPointExecute(Sender: TObject);
begin
ToggleBreakpoint(lvCallStack.Selected);
@ -787,6 +809,22 @@ begin
end;
end;
procedure TCallStackDlg.actViewUpExecute(Sender: TObject);
begin
try
DisableAllActions;
BeginUpdate;
if GetSelectedCallstack = nil then
SetViewStart(0)
else
SetViewStart(Max(0, FViewStart - ViewLimit));
finally
EndUpdate;
EnableAllActions;
end;
end;
procedure TCallStackDlg.BreakPointChanged(const ASender: TIDEBreakPoints;
const ABreakpoint: TIDEBreakPoint);
var
@ -827,6 +865,8 @@ begin
mnuLimit.Items[i].Caption:= Format(lisMaxS, [mnuLimit.Items[i].Tag]);
actViewMore.Caption := lisMore;
actViewTop.Caption := lisCSTop;
actViewUp.Caption := lisCSUp;
actViewDown.Caption := lisCSDown;
actViewBottom.Caption := lisCSBottom;
actViewGoto.Caption := lisGotoSelected;
actShow.Caption := lisViewSource;
@ -838,6 +878,8 @@ begin
actViewMore.Hint := lisMore;
actViewTop.Hint := lisCSTop;
actViewUp.Hint := lisCSUp;
actViewDown.Hint := lisCSDown;
actViewBottom.Hint := lisCSBottom;
actViewGoto.Hint := lisGotoSelected;
actShow.Hint := lisViewSource;
@ -871,8 +913,10 @@ begin
ToolBar1.Images := IDEImages.Images_16;
ToolButtonShow.ImageIndex := IDEImages.LoadImage('callstack_show');
ToolButtonMore.ImageIndex := IDEImages.LoadImage('callstack_more');
ToolButtonTop.ImageIndex := IDEImages.LoadImage('callstack_top');
ToolButtonBottom.ImageIndex := IDEImages.LoadImage('callstack_bottom');
ToolButtonTop.ImageIndex := IDEImages.LoadImage('NavArrow_T');
ToolButtonUp.ImageIndex := IDEImages.LoadImage('NavArrow_U');
ToolButtonDown.ImageIndex := IDEImages.LoadImage('NavArrow_D');
ToolButtonBottom.ImageIndex := IDEImages.LoadImage('NavArrow_B');
ToolButtonGoto.ImageIndex := IDEImages.LoadImage('callstack_goto');
ToolButtonCopyAll.ImageIndex := IDEImages.LoadImage('laz_copy');
ToolButtonCurrent.ImageIndex := IDEImages.LoadImage('debugger_current_line');

View File

@ -177,6 +177,8 @@ resourcestring
lisIndex = 'Index';
lisFunction = 'Function';
lisCSTop = 'Top';
lisCSDown = 'Page down';
lisCSUp = 'Page up';
lisCSBottom = 'Bottom';
lisCallStackNotEvaluated = 'Stack not evaluated';

View File

@ -22,3 +22,15 @@ NavArrow_Hide_200 RCDATA "../../../images/general_purpose/Arrow_07_32.png"
NavArrow_Show RCDATA "../../../images/general_purpose/Arrow_08_16.png"
NavArrow_Show_150 RCDATA "../../../images/general_purpose/Arrow_08_24.png"
NavArrow_Show_200 RCDATA "../../../images/general_purpose/Arrow_08_32.png"
NavArrow_T RCDATA "../../../images/general_purpose/Arrow_27_16.png"
NavArrow_T_150 RCDATA "../../../images/general_purpose/Arrow_27_24.png"
NavArrow_T_200 RCDATA "../../../images/general_purpose/Arrow_27_32.png"
NavArrow_U RCDATA "../../../images/general_purpose/Arrow_23_16.png"
NavArrow_U_150 RCDATA "../../../images/general_purpose/Arrow_23_24.png"
NavArrow_U_200 RCDATA "../../../images/general_purpose/Arrow_23_32.png"
NavArrow_D RCDATA "../../../images/general_purpose/Arrow_24_16.png"
NavArrow_D_150 RCDATA "../../../images/general_purpose/Arrow_24_24.png"
NavArrow_D_200 RCDATA "../../../images/general_purpose/Arrow_24_32.png"
NavArrow_B RCDATA "../../../images/general_purpose/Arrow_28_16.png"
NavArrow_B_150 RCDATA "../../../images/general_purpose/Arrow_28_24.png"
NavArrow_B_200 RCDATA "../../../images/general_purpose/Arrow_28_32.png"

Binary file not shown.

View File

@ -1067,10 +1067,18 @@ msgstr ""
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "idedebuggerstringconstants.liscurrent"
msgid "Current"

View File

@ -1069,10 +1069,18 @@ msgstr ""
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "idedebuggerstringconstants.liscurrent"
msgid "Current"

View File

@ -1078,10 +1078,18 @@ msgstr ""
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "idedebuggerstringconstants.liscurrent"
msgid "Current"

View File

@ -1097,11 +1097,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Dolní"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Nahoře"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1095,11 +1095,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Unten"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Oben"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1101,11 +1101,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Abajo"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Arriba"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1094,11 +1094,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Alhaalla"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Ylhäällä"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1098,11 +1098,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Bas"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Haut"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1091,11 +1091,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "תחתית"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "פסגה"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1097,11 +1097,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Le"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Fel"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1080,10 +1080,18 @@ msgstr ""
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "idedebuggerstringconstants.liscurrent"
msgid "Current"

View File

@ -1100,11 +1100,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Basso"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Cima"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1098,11 +1098,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "底"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "上端"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1098,11 +1098,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Apačion"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Viršun"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1080,10 +1080,18 @@ msgstr ""
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "idedebuggerstringconstants.liscurrent"
msgid "Current"

View File

@ -1097,11 +1097,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Dół"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Góra"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1076,11 +1076,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr ""
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr ""
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1112,11 +1112,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Base"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Topo"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1088,11 +1088,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Вниз"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Вверх"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1096,11 +1096,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Dole"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Hore"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1097,11 +1097,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Alt"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Üst"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1098,11 +1098,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "Нижній"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "Верхній"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"

View File

@ -1096,11 +1096,19 @@ msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"
msgstr "底部"
#: idedebuggerstringconstants.liscsdown
msgid "Page down"
msgstr ""
#: idedebuggerstringconstants.liscstop
msgctxt "lazarusidestrconsts.liscstop"
msgid "Top"
msgstr "上部"
#: idedebuggerstringconstants.liscsup
msgid "Page up"
msgstr ""
#: idedebuggerstringconstants.liscurrent
msgctxt "lazarusidestrconsts.liscurrent"
msgid "Current"