IDE, Debugger: add "copy line" to callstack window. Issue #40392 Patch by Bruno K

This commit is contained in:
Martin 2023-07-20 19:21:34 +02:00
parent c74bd43729
commit ae1c9e4710
26 changed files with 154 additions and 23 deletions

View File

@ -8,7 +8,7 @@ object CallStackDlg: TCallStackDlg
ClientHeight = 246 ClientHeight = 246
ClientWidth = 562 ClientWidth = 562
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '1.9.0.0' LCLVersion = '3.99.0.0'
Visible = True Visible = True
object lvCallStack: TListView object lvCallStack: TListView
Left = 0 Left = 0
@ -23,7 +23,7 @@ object CallStackDlg: TCallStackDlg
item item
AutoSize = True AutoSize = True
Caption = 'Index' Caption = 'Index'
Width = 100 Width = 44
end end
item item
Caption = 'Source' Caption = 'Source'
@ -57,34 +57,34 @@ object CallStackDlg: TCallStackDlg
ShowHint = True ShowHint = True
TabOrder = 1 TabOrder = 1
object ToolButtonShow: TToolButton object ToolButtonShow: TToolButton
Left = 32 Left = 28
Top = 2 Top = 2
Action = actShow Action = actShow
ImageIndex = 0 ImageIndex = 0
ShowCaption = False ShowCaption = False
end end
object ToolButtonCurrent: TToolButton object ToolButtonCurrent: TToolButton
Left = 55 Left = 51
Top = 2 Top = 2
Action = actSetCurrent Action = actSetCurrent
ShowCaption = False ShowCaption = False
end end
object ToolButton4: TToolButton object ToolButton4: TToolButton
Left = 78 Left = 74
Height = 22 Height = 22
Top = 2 Top = 2
Caption = 'ToolButton4' Caption = 'ToolButton4'
Style = tbsSeparator Style = tbsSeparator
end end
object ToolButtonMore: TToolButton object ToolButtonMore: TToolButton
Left = 121 Left = 113
Top = 2 Top = 2
Action = actViewMore Action = actViewMore
ImageIndex = 1 ImageIndex = 1
ShowCaption = False ShowCaption = False
end end
object ToolButtonMax: TToolButton object ToolButtonMax: TToolButton
Left = 86 Left = 78
Top = 2 Top = 2
Action = actViewLimit Action = actViewLimit
AutoSize = True AutoSize = True
@ -92,14 +92,14 @@ object CallStackDlg: TCallStackDlg
Style = tbsDropDown Style = tbsDropDown
end end
object ToolButtonGoto: TToolButton object ToolButtonGoto: TToolButton
Left = 248 Left = 236
Top = 2 Top = 2
Action = actViewGoto Action = actViewGoto
ImageIndex = 4 ImageIndex = 4
ShowCaption = False ShowCaption = False
end end
object ToolButtonCopyAll: TToolButton object ToolButtonCopyAll: TToolButton
Left = 279 Left = 263
Top = 2 Top = 2
Action = actCopyAll Action = actCopyAll
ImageIndex = 5 ImageIndex = 5
@ -113,28 +113,28 @@ object CallStackDlg: TCallStackDlg
Style = tbsSeparator Style = tbsSeparator
end end
object ToolButton9: TToolButton object ToolButton9: TToolButton
Left = 144 Left = 136
Height = 22 Height = 22
Top = 2 Top = 2
Caption = 'ToolButton9' Caption = 'ToolButton9'
Style = tbsSeparator Style = tbsSeparator
end end
object ToolButtonTop: TToolButton object ToolButtonTop: TToolButton
Left = 152 Left = 140
Top = 2 Top = 2
Action = actViewTop Action = actViewTop
ImageIndex = 2 ImageIndex = 2
ShowCaption = False ShowCaption = False
end end
object ToolButtonBottom: TToolButton object ToolButtonBottom: TToolButton
Left = 175 Left = 163
Top = 2 Top = 2
Action = actViewBottom Action = actViewBottom
ImageIndex = 3 ImageIndex = 3
ShowCaption = False ShowCaption = False
end end
object Panel1: TPanel object Panel1: TPanel
Left = 198 Left = 186
Height = 22 Height = 22
Top = 2 Top = 2
Width = 50 Width = 50
@ -164,7 +164,7 @@ object CallStackDlg: TCallStackDlg
Style = tbsCheck Style = tbsCheck
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 271 Left = 259
Height = 22 Height = 22
Top = 2 Top = 2
Caption = 'ToolButton2' Caption = 'ToolButton2'
@ -193,9 +193,15 @@ object CallStackDlg: TCallStackDlg
Action = actSetCurrent Action = actSetCurrent
OnClick = actSetAsCurrentClick OnClick = actSetAsCurrentClick
end end
object Separator1: TMenuItem
Caption = '-'
end
object popCopyLine: TMenuItem
Action = actCopyLine
end
object popCopyAll: TMenuItem object popCopyAll: TMenuItem
Action = actCopyAll Action = actCopyAll
OnClick = actCopyAllClick OnClick = actCopyLineClick
end end
end end
object aclActions: TActionList object aclActions: TActionList
@ -209,14 +215,6 @@ object CallStackDlg: TCallStackDlg
) )
ShortCut = 16470 ShortCut = 16470
end end
object actSetCurrent: TAction
Caption = 'Current'
OnExecute = actSetAsCurrentClick
end
object actCopyAll: TAction
Caption = 'Copy All'
OnExecute = actCopyAllClick
end
object actViewMore: TAction object actViewMore: TAction
Category = 'View' Category = 'View'
Caption = 'More' Caption = 'More'
@ -242,6 +240,19 @@ object CallStackDlg: TCallStackDlg
Caption = 'Bottom' Caption = 'Bottom'
OnExecute = actViewBottomExecute OnExecute = actViewBottomExecute
end end
object actSetCurrent: TAction
Caption = 'Current'
OnExecute = actSetAsCurrentClick
end
object actCopyLine: TAction
Caption = 'Copy line'
OnExecute = actCopyLineClick
ShortCut = 16451
end
object actCopyAll: TAction
Caption = 'Copy All'
OnExecute = actCopyLineClick
end
object actToggleBreakPoint: TAction object actToggleBreakPoint: TAction
Caption = 'Toggle Breakpoint' Caption = 'Toggle Breakpoint'
OnExecute = actToggleBreakPointExecute OnExecute = actToggleBreakPointExecute

View File

@ -59,6 +59,7 @@ type
TCallStackDlg = class(TDebuggerDlg) TCallStackDlg = class(TDebuggerDlg)
aclActions: TActionList; aclActions: TActionList;
actCopyAll: TAction; actCopyAll: TAction;
actCopyLine: TAction;
actShowDisass: TAction; actShowDisass: TAction;
actToggleBreakPoint: TAction; actToggleBreakPoint: TAction;
actViewBottom: TAction; actViewBottom: TAction;
@ -68,8 +69,10 @@ type
actViewMore: TAction; actViewMore: TAction;
actSetCurrent: TAction; actSetCurrent: TAction;
actShow: TAction; actShow: TAction;
popCopyLine: TMenuItem;
popShowDisass: TMenuItem; popShowDisass: TMenuItem;
popToggle: TMenuItem; popToggle: TMenuItem;
Separator1: TMenuItem;
ToolButtonPower: TToolButton; ToolButtonPower: TToolButton;
ToolButton2: TToolButton; ToolButton2: TToolButton;
ToolButtonTop: TToolButton; ToolButtonTop: TToolButton;
@ -110,6 +113,7 @@ type
procedure txtGotoKeyPress(Sender: TObject; var Key: char); procedure txtGotoKeyPress(Sender: TObject; var Key: char);
procedure lvCallStackDBLCLICK(Sender: TObject); procedure lvCallStackDBLCLICK(Sender: TObject);
procedure actCopyAllClick(Sender: TObject); procedure actCopyAllClick(Sender: TObject);
procedure actCopyLineClick(Sender: TObject);
procedure actSetAsCurrentClick(Sender : TObject); procedure actSetAsCurrentClick(Sender : TObject);
procedure actShowClick(Sender: TObject); procedure actShowClick(Sender: TObject);
private private
@ -129,6 +133,7 @@ type
procedure UpdateView; procedure UpdateView;
procedure JumpToSource; procedure JumpToSource;
procedure CopyToClipBoard; procedure CopyToClipBoard;
procedure LineToClipBoard;
procedure ToggleBreakpoint(Item: TListItem); procedure ToggleBreakpoint(Item: TListItem);
protected protected
procedure DoBeginUpdate; override; procedure DoBeginUpdate; override;
@ -582,6 +587,22 @@ begin
ClipBoard.AsText := S; ClipBoard.AsText := S;
end; end;
procedure TCallStackDlg.LineToClipBoard;
var
n: integer;
Entry: TIdeCallStackEntry;
S: String;
begin
Entry := GetCurrentEntry;
if not Assigned(Entry) then
exit;
Clipboard.Clear;
ClipBoard.AsText := format('%s at %s:%d',
[GetFunction(Entry), Entry.Source, Entry.Line]);
end;
procedure TCallStackDlg.ToggleBreakpoint(Item: TListItem); procedure TCallStackDlg.ToggleBreakpoint(Item: TListItem);
var var
idx: Integer; idx: Integer;
@ -668,6 +689,11 @@ begin
CopyToClipBoard; CopyToClipBoard;
end; end;
procedure TCallStackDlg.actCopyLineClick(Sender: TObject);
begin
LineToClipBoard;
end;
procedure TCallStackDlg.actSetAsCurrentClick(Sender : TObject); procedure TCallStackDlg.actSetAsCurrentClick(Sender : TObject);
var var
Entry: TIdeCallStackEntry; Entry: TIdeCallStackEntry;
@ -798,6 +824,7 @@ begin
actShowDisass.Caption := lisViewSourceDisass; actShowDisass.Caption := lisViewSourceDisass;
actToggleBreakPoint.Caption := uemToggleBreakpoint; actToggleBreakPoint.Caption := uemToggleBreakpoint;
actSetCurrent.Caption := lisCurrent; actSetCurrent.Caption := lisCurrent;
actCopyLine.Caption := lisCopyLine;
actCopyAll.Caption := lisCopyAll; actCopyAll.Caption := lisCopyAll;
actViewMore.Hint := lisMore; actViewMore.Hint := lisMore;

View File

@ -168,6 +168,7 @@ resourcestring
lisViewSourceDisass = 'View Assembler'; lisViewSourceDisass = 'View Assembler';
lisMaxS = 'Max %d'; lisMaxS = 'Max %d';
lisGotoSelected = 'Goto selected'; lisGotoSelected = 'Goto selected';
lisCopyLine = 'Copy Line';
lisCopyAll = 'Copy All'; lisCopyAll = 'Copy All';
lisIndex = 'Index'; lisIndex = 'Index';
lisFunction = 'Function'; lisFunction = 'Function';

View File

@ -514,6 +514,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr ""

View File

@ -515,6 +515,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr ""

View File

@ -521,6 +521,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr ""

View File

@ -542,6 +542,10 @@ msgstr "Kopírovat vše"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Zkopírovat celý výstup do schránky" msgstr "Zkopírovat celý výstup do schránky"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -540,6 +540,10 @@ msgstr "Alle &kopieren"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Alle Ausgaben in die Zwischenablage kopieren" msgstr "Alle Ausgaben in die Zwischenablage kopieren"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -546,6 +546,10 @@ msgstr "Copiar Todo"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Copiar toda la salida al portapapeles" msgstr "Copiar toda la salida al portapapeles"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -538,6 +538,10 @@ msgstr "Kopioi kaikki"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Kopioi kaikki tulostus leikepöydälle" msgstr "Kopioi kaikki tulostus leikepöydälle"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -543,6 +543,10 @@ msgstr "Tout copier"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Copier toutes les sorties dans le presse-papiers" msgstr "Copier toutes les sorties dans le presse-papiers"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -538,6 +538,10 @@ msgstr "העתק הכל"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "העתק את כל הפלט ללוח הזמני" msgstr "העתק את כל הפלט ללוח הזמני"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -542,6 +542,10 @@ msgstr "Minden másolása"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Minden kimenet másolása a vágólapra" msgstr "Minden kimenet másolása a vágólapra"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -523,6 +523,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr ""

View File

@ -546,6 +546,10 @@ msgstr "Copia tutto"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Copia tutto l'output negli appunti" msgstr "Copia tutto l'output negli appunti"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "すべてコピー"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "すべての出力をクリップボードにコピー" msgstr "すべての出力をクリップボードにコピー"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "Kopijuoti viską"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Visą išvestį kopijuoti į išvestinę" msgstr "Visą išvestį kopijuoti į išvestinę"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -523,6 +523,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgid "Bottom" msgid "Bottom"
msgstr "" msgstr ""

View File

@ -542,6 +542,10 @@ msgstr "Kopiuj wszystko"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Kopiuj wszystko do schowka" msgstr "Kopiuj wszystko do schowka"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -522,6 +522,10 @@ msgstr ""
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "Copiar Tudo"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Copiar toda saída para área transferência" msgstr "Copiar toda saída para área transferência"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -534,6 +534,10 @@ msgstr "Копировать все"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Копировать весь вывод в буфер обмена" msgstr "Копировать весь вывод в буфер обмена"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -539,6 +539,10 @@ msgstr "Kopírovať všetko"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "" msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -529,6 +529,10 @@ msgstr "Tümünü Kopyala"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Tüm çıktıları panoya kopyala" msgstr "Tüm çıktıları panoya kopyala"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -530,6 +530,10 @@ msgstr "Копіювати все"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "Копіювати весь вивід у буфер" msgstr "Копіювати весь вивід у буфер"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"

View File

@ -543,6 +543,10 @@ msgstr "复制所有"
msgid "Copy all output to clipboard" msgid "Copy all output to clipboard"
msgstr "复制所有输出到剪贴板" msgstr "复制所有输出到剪贴板"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom #: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom" msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom" msgid "Bottom"