mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 17:09:13 +02:00
* Added breakpont properties dialog. Modified patch by Benito van der Zander (issue #12882)
git-svn-id: trunk@18115 -
This commit is contained in:
parent
8d632ac72b
commit
c569ccca33
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1601,6 +1601,9 @@ debugger/assemblerdlg.pp svneol=native#text/pascal
|
||||
debugger/breakpointsdlg.lfm svneol=native#text/plain
|
||||
debugger/breakpointsdlg.lrs svneol=native#text/pascal
|
||||
debugger/breakpointsdlg.pp svneol=native#text/pascal
|
||||
debugger/breakpropertydlg.lfm svneol=native#text/pascal
|
||||
debugger/breakpropertydlg.lrs svneol=native#text/pascal
|
||||
debugger/breakpropertydlg.pas svneol=native#text/pascal
|
||||
debugger/callstackdlg.lfm svneol=native#text/plain
|
||||
debugger/callstackdlg.lrs svneol=native#text/pascal
|
||||
debugger/callstackdlg.pp svneol=native#text/pascal
|
||||
|
@ -123,7 +123,7 @@ function GetBreakPointActionsDescription(ABreakpoint: TBaseBreakpoint): string;
|
||||
|
||||
implementation
|
||||
uses
|
||||
LazarusIDEStrConsts;
|
||||
LazarusIDEStrConsts, BaseDebugManager;
|
||||
function GetBreakPointStateDescription(ABreakpoint: TBaseBreakpoint): string;
|
||||
const
|
||||
// enabled valid
|
||||
@ -634,8 +634,16 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.ShowProperties;
|
||||
var
|
||||
Item: TListItem;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
begin
|
||||
ShowMessage(lisNotImplementedYet2);
|
||||
Item:=lvBreakPoints.Selected;
|
||||
if Item = nil then exit;
|
||||
|
||||
CurBreakPoint:=TIDEBreakPoint(Item.Data);
|
||||
|
||||
DebugBoss.ShowBreakPointProperties(CurBreakPoint);
|
||||
end;
|
||||
|
||||
|
||||
|
310
debugger/breakpropertydlg.lfm
Normal file
310
debugger/breakpropertydlg.lfm
Normal file
@ -0,0 +1,310 @@
|
||||
inherited BreakPropertyDlg: TBreakPropertyDlg
|
||||
Left = 329
|
||||
Height = 367
|
||||
Top = 288
|
||||
Width = 387
|
||||
HorzScrollBar.Page = 382
|
||||
HorzScrollBar.Range = 392
|
||||
HorzScrollBar.Visible = True
|
||||
VertScrollBar.Page = 188
|
||||
VertScrollBar.Range = 209
|
||||
VertScrollBar.Visible = True
|
||||
AutoScroll = False
|
||||
Caption = 'Breakpoint Properties'
|
||||
ClientHeight = 367
|
||||
ClientWidth = 387
|
||||
object lblFileName: TLabel[0]
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 14
|
||||
Width = 55
|
||||
Caption = 'Filename:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblLine: TLabel[1]
|
||||
AnchorSideLeft.Control = lblFileName
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 41
|
||||
Width = 28
|
||||
Caption = 'Line:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblCondition: TLabel[2]
|
||||
AnchorSideLeft.Control = lblFileName
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 68
|
||||
Width = 57
|
||||
Caption = 'Condition:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblHitCount: TLabel[3]
|
||||
AnchorSideLeft.Control = lblFileName
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 95
|
||||
Width = 61
|
||||
Caption = 'Hitcounter:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblGroup: TLabel[4]
|
||||
AnchorSideLeft.Control = lblFileName
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 8
|
||||
Height = 13
|
||||
Top = 152
|
||||
Width = 38
|
||||
Caption = 'Group:'
|
||||
ParentColor = False
|
||||
end
|
||||
object lblAutoContinue: TLabel[5]
|
||||
Left = 9
|
||||
Height = 13
|
||||
Top = 124
|
||||
Width = 106
|
||||
Caption = 'Auto continue (ms)'
|
||||
ParentColor = False
|
||||
end
|
||||
object edtAutocontinueMS: TEdit[6]
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 23
|
||||
Top = 117
|
||||
Width = 251
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 4
|
||||
TabOrder = 0
|
||||
Text = 'edtAutocontinueMS'
|
||||
end
|
||||
object edtCounter: TEdit[7]
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 23
|
||||
Top = 90
|
||||
Width = 251
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Around = 4
|
||||
TabOrder = 1
|
||||
Text = 'edtCounter'
|
||||
end
|
||||
object edtCondition: TEdit[8]
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 23
|
||||
Top = 63
|
||||
Width = 251
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Around = 4
|
||||
TabOrder = 2
|
||||
Text = 'edtCondition'
|
||||
end
|
||||
object edtLine: TEdit[9]
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 23
|
||||
Top = 36
|
||||
Width = 251
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 4
|
||||
BorderSpacing.Around = 4
|
||||
Color = clBtnFace
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
Text = 'edtLine'
|
||||
end
|
||||
object edtFilename: TEdit[10]
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 24
|
||||
Top = 8
|
||||
Width = 247
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Right = 4
|
||||
BorderSpacing.Around = 4
|
||||
Color = clBtnFace
|
||||
ReadOnly = True
|
||||
TabOrder = 4
|
||||
Text = 'edtFilename'
|
||||
end
|
||||
object cmbGroup: TComboBox[11]
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 137
|
||||
Height = 25
|
||||
Top = 144
|
||||
Width = 251
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 4
|
||||
TabOrder = 5
|
||||
Text = 'cmbGroup'
|
||||
end
|
||||
object gbActions: TGroupBox[12]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 4
|
||||
Height = 149
|
||||
Top = 176
|
||||
Width = 384
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 4
|
||||
Caption = 'Actions'
|
||||
ClientHeight = 132
|
||||
ClientWidth = 380
|
||||
TabOrder = 6
|
||||
object chkActionBreak: TCheckBox
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 5
|
||||
Width = 56
|
||||
Caption = 'Break'
|
||||
TabOrder = 0
|
||||
end
|
||||
object chkEnableGroups: TCheckBox
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 29
|
||||
Width = 101
|
||||
Caption = 'Enable goups'
|
||||
TabOrder = 1
|
||||
end
|
||||
object chkDisableGroups: TCheckBox
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 53
|
||||
Width = 108
|
||||
Caption = 'Disable groups'
|
||||
TabOrder = 2
|
||||
end
|
||||
object edtEnableGroups: TEditButton
|
||||
Left = 130
|
||||
Height = 23
|
||||
Top = 29
|
||||
Width = 221
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ButtonWidth = 23
|
||||
Enabled = False
|
||||
NumGlyphs = 1
|
||||
OnButtonClick = edtEnableGroupsButtonClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object edtDisableGroups: TEditButton
|
||||
Left = 130
|
||||
Height = 23
|
||||
Top = 53
|
||||
Width = 221
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
ButtonWidth = 23
|
||||
Enabled = False
|
||||
NumGlyphs = 1
|
||||
OnButtonClick = edtDisableGroupsButtonClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object chkEvalExpression: TCheckBox
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 77
|
||||
Width = 113
|
||||
Caption = 'Eval expression'
|
||||
Enabled = False
|
||||
TabOrder = 5
|
||||
end
|
||||
object chkLogMessage: TCheckBox
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 101
|
||||
Width = 98
|
||||
Caption = 'Log message'
|
||||
Enabled = False
|
||||
TabOrder = 6
|
||||
end
|
||||
object edtEvalExpression: TEdit
|
||||
Left = 130
|
||||
Height = 23
|
||||
Top = 77
|
||||
Width = 244
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Enabled = False
|
||||
TabOrder = 7
|
||||
Text = 'edtEvalExpression'
|
||||
end
|
||||
object edtLogMessage: TEdit
|
||||
Left = 130
|
||||
Height = 23
|
||||
Top = 101
|
||||
Width = 244
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Enabled = False
|
||||
TabOrder = 8
|
||||
Text = 'Edit1'
|
||||
end
|
||||
end
|
||||
object btnHelp: TBitBtn[13]
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 26
|
||||
Top = 335
|
||||
Width = 35
|
||||
Anchors = [akLeft, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Help'
|
||||
NumGlyphs = 0
|
||||
OnClick = btnHelpClick
|
||||
TabOrder = 7
|
||||
end
|
||||
object btnOK: TBitBtn[14]
|
||||
AnchorSideRight.Control = btnCancel
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 304
|
||||
Height = 26
|
||||
Top = 335
|
||||
Width = 27
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'OK'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
NumGlyphs = 0
|
||||
OnClick = btnOKClick
|
||||
TabOrder = 8
|
||||
end
|
||||
object btnCancel: TBitBtn[15]
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 337
|
||||
Height = 26
|
||||
Top = 335
|
||||
Width = 49
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Cancel = True
|
||||
Caption = 'Cancel'
|
||||
ModalResult = 2
|
||||
NumGlyphs = 0
|
||||
TabOrder = 9
|
||||
end
|
||||
end
|
96
debugger/breakpropertydlg.lrs
Normal file
96
debugger/breakpropertydlg.lrs
Normal file
@ -0,0 +1,96 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TBreakPropertyDlg','FORMDATA',[
|
||||
'TPF0'#241#17'TBreakPropertyDlg'#16'BreakPropertyDlg'#4'Left'#3'I'#1#6'Height'
|
||||
+#3'o'#1#3'Top'#3' '#1#5'Width'#3#131#1#18'HorzScrollBar.Page'#3'~'#1#19'Horz'
|
||||
+'ScrollBar.Range'#3#136#1#21'HorzScrollBar.Visible'#9#18'VertScrollBar.Page'
|
||||
+#3#188#0#19'VertScrollBar.Range'#3#209#0#21'VertScrollBar.Visible'#9#10'Auto'
|
||||
+'Scroll'#8#7'Caption'#6#21'Breakpoint Properties'#12'ClientHeight'#3'o'#1#11
|
||||
+'ClientWidth'#3#131#1#0#242#2#0#6'TLabel'#11'lblFileName'#18'AnchorSideTop.S'
|
||||
+'ide'#7#9'asrCenter'#4'Left'#2#8#6'Height'#2#13#3'Top'#2#14#5'Width'#2'7'#7
|
||||
+'Caption'#6#9'Filename:'#11'ParentColor'#8#0#0#242#2#1#6'TLabel'#7'lblLine'
|
||||
+#22'AnchorSideLeft.Control'#7#11'lblFileName'#18'AnchorSideTop.Side'#7#9'asr'
|
||||
+'Center'#4'Left'#2#8#6'Height'#2#13#3'Top'#2')'#5'Width'#2#28#7'Caption'#6#5
|
||||
+'Line:'#11'ParentColor'#8#0#0#242#2#2#6'TLabel'#12'lblCondition'#22'AnchorSi'
|
||||
+'deLeft.Control'#7#11'lblFileName'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'L'
|
||||
+'eft'#2#8#6'Height'#2#13#3'Top'#2'D'#5'Width'#2'9'#7'Caption'#6#10'Condition'
|
||||
+':'#11'ParentColor'#8#0#0#242#2#3#6'TLabel'#11'lblHitCount'#22'AnchorSideLef'
|
||||
+'t.Control'#7#11'lblFileName'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2
|
||||
+#8#6'Height'#2#13#3'Top'#2'_'#5'Width'#2'='#7'Caption'#6#11'Hitcounter:'#11
|
||||
+'ParentColor'#8#0#0#242#2#4#6'TLabel'#8'lblGroup'#22'AnchorSideLeft.Control'
|
||||
+#7#11'lblFileName'#18'AnchorSideTop.Side'#7#9'asrCenter'#4'Left'#2#8#6'Heigh'
|
||||
+'t'#2#13#3'Top'#3#152#0#5'Width'#2'&'#7'Caption'#6#6'Group:'#11'ParentColor'
|
||||
+#8#0#0#242#2#5#6'TLabel'#15'lblAutoContinue'#4'Left'#2#9#6'Height'#2#13#3'To'
|
||||
+'p'#2'|'#5'Width'#2'j'#7'Caption'#6#18'Auto continue (ms)'#11'ParentColor'#8
|
||||
+#0#0#242#2#6#5'TEdit'#17'edtAutocontinueMS'#23'AnchorSideRight.Control'#7#5
|
||||
+'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#137#0#6'Height'#2
|
||||
+#23#3'Top'#2'u'#5'Width'#3#251#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
||||
+#0#20'BorderSpacing.Around'#2#4#8'TabOrder'#2#0#4'Text'#6#17'edtAutocontinue'
|
||||
+'MS'#0#0#242#2#7#5'TEdit'#10'edtCounter'#18'AnchorSideTop.Side'#7#9'asrBotto'
|
||||
+'m'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrB'
|
||||
+'ottom'#4'Left'#3#137#0#6'Height'#2#23#3'Top'#2'Z'#5'Width'#3#251#0#7'Anchor'
|
||||
+'s'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#4#20'BorderSp'
|
||||
+'acing.Around'#2#4#8'TabOrder'#2#1#4'Text'#6#10'edtCounter'#0#0#242#2#8#5'TE'
|
||||
+'dit'#12'edtCondition'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRi'
|
||||
+'ght.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3
|
||||
+#137#0#6'Height'#2#23#3'Top'#2'?'#5'Width'#3#251#0#7'Anchors'#11#5'akTop'#6
|
||||
+'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#4#20'BorderSpacing.Around'#2#4
|
||||
+#8'TabOrder'#2#2#4'Text'#6#12'edtCondition'#0#0#242#2#9#5'TEdit'#7'edtLine'
|
||||
+#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'
|
||||
+#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#137#0#6'Height'#2#23#3'To'
|
||||
+'p'#2'$'#5'Width'#3#251#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'B'
|
||||
+'orderSpacing.Top'#2#4#20'BorderSpacing.Around'#2#4#5'Color'#7#9'clBtnFace'#8
|
||||
+'ReadOnly'#9#8'TabOrder'#2#3#4'Text'#6#7'edtLine'#0#0#242#2#10#5'TEdit'#11'e'
|
||||
+'dtFilename'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.Contro'
|
||||
+'l'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3#137#0#6'Hei'
|
||||
+'ght'#2#24#3'Top'#2#8#5'Width'#3#247#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'ak'
|
||||
+'Right'#0#19'BorderSpacing.Right'#2#4#20'BorderSpacing.Around'#2#4#5'Color'#7
|
||||
+#9'clBtnFace'#8'ReadOnly'#9#8'TabOrder'#2#4#4'Text'#6#11'edtFilename'#0#0#242
|
||||
+#2#11#9'TComboBox'#8'cmbGroup'#23'AnchorSideRight.Control'#7#5'Owner'#20'Anc'
|
||||
+'horSideRight.Side'#7#9'asrBottom'#4'Left'#3#137#0#6'Height'#2#25#3'Top'#3
|
||||
+#144#0#5'Width'#3#251#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'Bor'
|
||||
+'derSpacing.Around'#2#4#8'TabOrder'#2#5#4'Text'#6#8'cmbGroup'#0#0#242#2#12#9
|
||||
+'TGroupBox'#9'gbActions'#22'AnchorSideLeft.Control'#7#5'Owner'#23'AnchorSide'
|
||||
+'Right.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2
|
||||
+#4#6'Height'#3#149#0#3'Top'#3#176#0#5'Width'#3#128#1#7'Anchors'#11#5'akTop'#6
|
||||
+'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#4#7'Caption'#6#7'Actions'#12
|
||||
+'ClientHeight'#3#132#0#11'ClientWidth'#3'|'#1#8'TabOrder'#2#6#0#9'TCheckBox'
|
||||
+#14'chkActionBreak'#4'Left'#2#6#6'Height'#2#20#3'Top'#2#5#5'Width'#2'8'#7'Ca'
|
||||
+'ption'#6#5'Break'#8'TabOrder'#2#0#0#0#9'TCheckBox'#15'chkEnableGroups'#4'Le'
|
||||
+'ft'#2#6#6'Height'#2#20#3'Top'#2#29#5'Width'#2'e'#7'Caption'#6#12'Enable gou'
|
||||
+'ps'#8'TabOrder'#2#1#0#0#9'TCheckBox'#16'chkDisableGroups'#4'Left'#2#6#6'Hei'
|
||||
+'ght'#2#20#3'Top'#2'5'#5'Width'#2'l'#7'Caption'#6#14'Disable groups'#8'TabOr'
|
||||
+'der'#2#2#0#0#11'TEditButton'#15'edtEnableGroups'#4'Left'#3#130#0#6'Height'#2
|
||||
+#23#3'Top'#2#29#5'Width'#3#221#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
||||
+#0#11'ButtonWidth'#2#23#7'Enabled'#8#9'NumGlyphs'#2#1#13'OnButtonClick'#7#26
|
||||
+'edtEnableGroupsButtonClick'#8'TabOrder'#2#3#0#0#11'TEditButton'#16'edtDisab'
|
||||
+'leGroups'#4'Left'#3#130#0#6'Height'#2#23#3'Top'#2'5'#5'Width'#3#221#0#7'Anc'
|
||||
,'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#11'ButtonWidth'#2#23#7'Enabled'#8#9
|
||||
+'NumGlyphs'#2#1#13'OnButtonClick'#7#27'edtDisableGroupsButtonClick'#8'TabOrd'
|
||||
+'er'#2#4#0#0#9'TCheckBox'#17'chkEvalExpression'#4'Left'#2#6#6'Height'#2#20#3
|
||||
+'Top'#2'M'#5'Width'#2'q'#7'Caption'#6#15'Eval expression'#7'Enabled'#8#8'Tab'
|
||||
+'Order'#2#5#0#0#9'TCheckBox'#13'chkLogMessage'#4'Left'#2#6#6'Height'#2#20#3
|
||||
+'Top'#2'e'#5'Width'#2'b'#7'Caption'#6#11'Log message'#7'Enabled'#8#8'TabOrde'
|
||||
+'r'#2#6#0#0#5'TEdit'#17'edtEvalExpression'#4'Left'#3#130#0#6'Height'#2#23#3
|
||||
+'Top'#2'M'#5'Width'#3#244#0#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7
|
||||
+'Enabled'#8#8'TabOrder'#2#7#4'Text'#6#17'edtEvalExpression'#0#0#5'TEdit'#13
|
||||
+'edtLogMessage'#4'Left'#3#130#0#6'Height'#2#23#3'Top'#2'e'#5'Width'#3#244#0#7
|
||||
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Enabled'#8#8'TabOrder'#2#8#4
|
||||
+'Text'#6#5'Edit1'#0#0#0#242#2#13#7'TBitBtn'#7'btnHelp'#22'AnchorSideLeft.Con'
|
||||
+'trol'#7#5'Owner'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBotto'
|
||||
+'m.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#26#3'Top'#3'O'#1#5'Width'#2
|
||||
+'#'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Aro'
|
||||
+'und'#2#6#7'Caption'#6#4'Help'#9'NumGlyphs'#2#0#7'OnClick'#7#12'btnHelpClick'
|
||||
+#8'TabOrder'#2#7#0#0#242#2#14#7'TBitBtn'#5'btnOK'#23'AnchorSideRight.Control'
|
||||
+#7#9'btnCancel'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.'
|
||||
+'Side'#7#9'asrBottom'#4'Left'#3'0'#1#6'Height'#2#26#3'Top'#3'O'#1#5'Width'#2
|
||||
+#27#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Ar'
|
||||
+'ound'#2#6#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult'#2#1#9'NumGlyphs'#2
|
||||
+#0#7'OnClick'#7#10'btnOKClick'#8'TabOrder'#2#8#0#0#242#2#15#7'TBitBtn'#9'btn'
|
||||
+'Cancel'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9
|
||||
+'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'
|
||||
+#7#9'asrBottom'#4'Left'#3'Q'#1#6'Height'#2#26#3'Top'#3'O'#1#5'Width'#2'1'#7
|
||||
+'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'
|
||||
+#2#6#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0
|
||||
+#8'TabOrder'#2#9#0#0#0
|
||||
]);
|
188
debugger/breakpropertydlg.pas
Normal file
188
debugger/breakpropertydlg.pas
Normal file
@ -0,0 +1,188 @@
|
||||
unit BreakPropertyDlg;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
ExtCtrls, StdCtrls, Buttons, DebuggerDlg, Debugger, ButtonPanel, EditBtn,
|
||||
BaseDebugManager, IDEContextHelpEdit;
|
||||
|
||||
type
|
||||
|
||||
{ TBreakPropertyDlg }
|
||||
|
||||
TBreakPropertyDlg = class(TDebuggerDlg)
|
||||
btnCancel: TBitBtn;
|
||||
btnHelp: TBitBtn;
|
||||
btnOK: TBitBtn;
|
||||
chkEnableGroups: TCheckBox;
|
||||
chkDisableGroups: TCheckBox;
|
||||
chkEvalExpression: TCheckBox;
|
||||
chkLogMessage: TCheckBox;
|
||||
chkActionBreak: TCheckBox;
|
||||
cmbGroup: TComboBox;
|
||||
edtEvalExpression: TEdit;
|
||||
edtLogMessage: TEdit;
|
||||
edtEnableGroups: TEditButton;
|
||||
edtDisableGroups: TEditButton;
|
||||
edtAutocontinueMS: TEdit;
|
||||
edtCondition: TEdit;
|
||||
edtCounter: TEdit;
|
||||
edtFilename: TEdit;
|
||||
edtLine: TEdit;
|
||||
gbActions: TGroupBox;
|
||||
lblFileName: TLabel;
|
||||
lblLine: TLabel;
|
||||
lblCondition: TLabel;
|
||||
lblHitCount: TLabel;
|
||||
lblGroup: TLabel;
|
||||
lblAutoContinue: TLabel;
|
||||
procedure btnHelpClick(Sender: TObject);
|
||||
procedure btnOKClick(Sender: TObject);
|
||||
procedure BreakPointRemove(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure BreakPointUpdate(const ASender: TIDEBreakPoints;
|
||||
const ABreakpoint: TIDEBreakPoint);
|
||||
procedure edtDisableGroupsButtonClick(Sender: TObject);
|
||||
procedure edtEnableGroupsButtonClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
FBreakpointsNotification : TIDEBreakPointsNotification;
|
||||
FBreakpoint: TIDEBreakPoint;
|
||||
protected
|
||||
procedure DoEndUpdate; override;
|
||||
procedure UpdateInfo;
|
||||
public
|
||||
{ public declarations }
|
||||
constructor Create(AOwner: TComponent; ABreakPoint: TIDEBreakPoint);overload;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TBreakPropertyDlg }
|
||||
|
||||
procedure TBreakPropertyDlg.BreakPointUpdate(
|
||||
const ASender: TIDEBreakPoints; const ABreakpoint: TIDEBreakPoint);
|
||||
begin
|
||||
UpdateInfo;
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.btnHelpClick(Sender: TObject);
|
||||
begin
|
||||
ShowContextHelpForIDE(btnHelp);
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.BreakPointRemove(
|
||||
const ASender: TIDEBreakPoints; const ABreakpoint: TIDEBreakPoint);
|
||||
begin
|
||||
if ABreakpoint = FBreakpoint
|
||||
then ModalResult := mrCancel;
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.btnOKClick(Sender: TObject);
|
||||
var
|
||||
Actions: TIDEBreakPointActions;
|
||||
begin
|
||||
if FBreakpoint = nil then Exit;
|
||||
|
||||
FBreakpointsNotification.OnUpdate := nil;
|
||||
// filename
|
||||
// line
|
||||
FBreakpoint.SetLocation(edtFilename.Text, StrToIntDef(edtLine.Text, 1));
|
||||
// expression
|
||||
FBreakpoint.Expression := edtCondition.Text;
|
||||
// hitcount
|
||||
FBreakpoint.BreakHitCount := StrToIntDef(edtCounter.Text, FBreakpoint.HitCount);
|
||||
//auto continue
|
||||
FBreakpoint.AutoContinueTime := StrToIntDef(edtAutocontinueMS.Text, FBreakpoint.AutoContinueTime);
|
||||
// group
|
||||
FBreakpoint.Group := DebugBoss.BreakPointGroups.GetGroupByName(cmbGroup.Text);
|
||||
// actions
|
||||
Actions := [];
|
||||
if chkActionBreak.Checked then Include(Actions, bpaStop);
|
||||
if chkDisableGroups.Checked then Include(Actions, bpaDisableGroup);
|
||||
if chkEnableGroups.Checked then Include(Actions, bpaEnableGroup);
|
||||
// if chkEvalExpression.Checked then Include(Actions, bpaEValExpression);
|
||||
// if chkLogMessage.Checked then Include(Actions, bpaLogMessage);
|
||||
FBreakpoint.Actions := Actions;
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.DoEndUpdate;
|
||||
begin
|
||||
inherited DoEndUpdate;
|
||||
UpdateInfo;
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.edtDisableGroupsButtonClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.edtEnableGroupsButtonClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TBreakPropertyDlg.UpdateInfo;
|
||||
var
|
||||
Actions: TIDEBreakPointActions;
|
||||
begin
|
||||
if FBreakpoint = nil then Exit;
|
||||
// filename
|
||||
edtFilename.text := FBreakpoint.Source;
|
||||
// line
|
||||
if FBreakpoint.Line > 0
|
||||
then edtLine.Text := IntToStr(FBreakpoint.SourceLine)
|
||||
else edtLine.Text := '';
|
||||
// expression
|
||||
edtCondition.Text := FBreakpoint.Expression;
|
||||
// hitcount
|
||||
edtCounter.Text := IntToStr(FBreakpoint.BreakHitCount);
|
||||
// auto continue
|
||||
edtAutocontinueMS.Text := IntToStr(FBreakpoint.AutoContinueTime);
|
||||
// group
|
||||
if FBreakpoint.Group = nil
|
||||
then cmbGroup.Text := ''
|
||||
else cmbGroup.Text := FBreakpoint.Group.Name;
|
||||
|
||||
// actions
|
||||
Actions := FBreakpoint.Actions;
|
||||
chkActionBreak.Checked := bpaStop in Actions;
|
||||
chkDisableGroups.Checked := bpaDisableGroup in Actions;
|
||||
chkEnableGroups.Checked := bpaEnableGroup in Actions;
|
||||
// chkEvalExpression.Checked := bpaEValExpression in Actions;
|
||||
// chkLogMessage.Checked := bpaLogMessage in Actions;
|
||||
end;
|
||||
|
||||
constructor TBreakPropertyDlg.Create(AOwner: TComponent; ABreakPoint: TIDEBreakPoint);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FBreakpoint := ABreakPoint;
|
||||
FBreakpointsNotification := TIDEBreakPointsNotification.Create;
|
||||
FBreakpointsNotification.AddReference;
|
||||
FBreakpointsNotification.OnUpdate := @BreakPointUpdate;
|
||||
FBreakpointsNotification.OnRemove := @BreakPointRemove;
|
||||
UpdateInfo;
|
||||
|
||||
btnOK.LoadGlyphFromLazarusResource('btn_ok');
|
||||
btnCancel.LoadGlyphFromLazarusResource('btn_cancel');
|
||||
btnHelp.LoadGlyphFromLazarusResource('btn_help');
|
||||
end;
|
||||
|
||||
destructor TBreakPropertyDlg.Destroy;
|
||||
begin
|
||||
FBreakpointsNotification.OnUpdate := nil;
|
||||
FBreakpointsNotification.OnRemove := nil;
|
||||
FBreakpointsNotification.ReleaseReference;
|
||||
FBreakpointsNotification := nil;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I breakpropertydlg.lrs}
|
||||
|
||||
end.
|
||||
|
@ -179,25 +179,29 @@ type
|
||||
);
|
||||
TIDEBreakPointActions = set of TIDEBreakPointAction;
|
||||
|
||||
{ TBaseBreakPoint }
|
||||
|
||||
TBaseBreakPoint = class(TDelayedUdateItem)
|
||||
private
|
||||
FEnabled: Boolean;
|
||||
FExpression: String;
|
||||
FHitCount: Integer;
|
||||
FBreakHitCount: Integer;
|
||||
FLine: Integer;
|
||||
FSource: String;
|
||||
FValid: TValidState;
|
||||
FInitialEnabled: Boolean;
|
||||
protected
|
||||
procedure AssignTo(Dest: TPersistent); override;
|
||||
procedure DoBreakHitCountChange; virtual;
|
||||
procedure DoExpressionChange; virtual;
|
||||
procedure DoEnableChange; virtual;
|
||||
procedure DoHit(const ACount: Integer; var AContinue: Boolean); virtual;
|
||||
procedure SetHitCount(const AValue: Integer);
|
||||
procedure SetValid(const AValue: TValidState);
|
||||
|
||||
protected
|
||||
// virtual properties
|
||||
function GetBreakHitCount: Integer; virtual;
|
||||
function GetEnabled: Boolean; virtual;
|
||||
function GetExpression: String; virtual;
|
||||
function GetHitCount: Integer; virtual;
|
||||
@ -206,12 +210,14 @@ type
|
||||
function GetSourceLine: Integer; virtual;
|
||||
function GetValid: TValidState; virtual;
|
||||
|
||||
procedure SetBreakHitCount(const AValue: Integer); virtual;
|
||||
procedure SetEnabled(const AValue: Boolean); virtual;
|
||||
procedure SetExpression(const AValue: String); virtual;
|
||||
procedure SetInitialEnabled(const AValue: Boolean); virtual;
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
procedure SetLocation(const ASource: String; const ALine: Integer); virtual;// PublicProtectedFix ide/debugmanager.pas(867,32) Error: identifier idents no member "SetLocation"
|
||||
property BreakHitCount: Integer read GetBreakHitCount write SetBreakHitCount;
|
||||
property Enabled: Boolean read GetEnabled write SetEnabled;
|
||||
property Expression: String read GetExpression write SetExpression;
|
||||
property HitCount: Integer read GetHitCount;
|
||||
@ -227,6 +233,7 @@ type
|
||||
|
||||
TIDEBreakPoint = class(TBaseBreakPoint)
|
||||
private
|
||||
FAutoContinueTime: Cardinal;
|
||||
FActions: TIDEBreakPointActions;
|
||||
FDisableGroupList: TList;
|
||||
FEnableGroupList: TList;
|
||||
@ -246,8 +253,10 @@ type
|
||||
// virtual properties
|
||||
function GetActions: TIDEBreakPointActions; virtual;
|
||||
function GetGroup: TIDEBreakPointGroup; virtual;
|
||||
function GetAutoContinueTime: Cardinal; virtual;
|
||||
procedure SetActions(const AValue: TIDEBreakPointActions); virtual;
|
||||
procedure SetGroup(const AValue: TIDEBreakPointGroup); virtual;
|
||||
procedure SetAutoContinueTime(const AValue: Cardinal); virtual;
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
@ -262,11 +271,14 @@ type
|
||||
const OnSaveFilename: TOnSaveFilenameToConfig); virtual;
|
||||
public
|
||||
property Actions: TIDEBreakPointActions read GetActions write SetActions;
|
||||
property AutoContinueTime: Cardinal read GetAutoContinueTime write SetAutoContinueTime;
|
||||
property Group: TIDEBreakPointGroup read GetGroup write SetGroup;
|
||||
property Loading: Boolean read FLoading;
|
||||
end;
|
||||
TIDEBreakPointClass = class of TIDEBreakPoint;
|
||||
|
||||
{ TDBGBreakPoint }
|
||||
|
||||
TDBGBreakPoint = class(TBaseBreakPoint)
|
||||
private
|
||||
FSlave: TBaseBreakPoint;
|
||||
@ -280,6 +292,7 @@ type
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
function GetSourceLine: integer; override;
|
||||
procedure Hit(var ACanContinue: Boolean);
|
||||
property Slave: TBaseBreakPoint read FSlave write SetSlave;
|
||||
end;
|
||||
TDBGBreakPointClass = class of TDBGBreakPoint;
|
||||
@ -1028,6 +1041,8 @@ type
|
||||
|
||||
TDebuggerStateChangedEvent = procedure(ADebugger: TDebugger;
|
||||
AOldState: TDBGState) of object;
|
||||
TDebuggerBreakPointHitEvent = procedure(ADebugger: TDebugger; ABreakPoint: TBaseBreakPoint;
|
||||
var ACanContinue: Boolean) of object;
|
||||
TDBGOutputEvent = procedure(Sender: TObject; const AText: String) of object;
|
||||
TDBGCurrentLineEvent = procedure(Sender: TObject;
|
||||
const ALocation: TDBGLocationRec) of object;
|
||||
@ -1064,6 +1079,7 @@ type
|
||||
FOnOutput: TDBGOutputEvent;
|
||||
FOnDbgOutput: TDBGOutputEvent;
|
||||
FOnState: TDebuggerStateChangedEvent;
|
||||
FOnBreakPointHit: TDebuggerBreakPointHitEvent;
|
||||
FWorkingDir: String;
|
||||
procedure DebuggerEnvironmentChanged(Sender: TObject);
|
||||
procedure EnvironmentChanged(Sender: TObject);
|
||||
@ -1085,6 +1101,7 @@ type
|
||||
procedure DoDbgOutput(const AText: String);
|
||||
procedure DoException(const AExceptionClass: String; const AExceptionText: String);
|
||||
procedure DoOutput(const AText: String);
|
||||
procedure DoBreakpointHit(const ABreakPoint: TBaseBreakPoint; var ACanContinue: Boolean);
|
||||
procedure DoState(const OldState: TDBGState); virtual;
|
||||
function ChangeFileName: Boolean; virtual;
|
||||
function GetCommands: TDBGCommands;
|
||||
@ -1153,6 +1170,7 @@ type
|
||||
property OnException: TDBGExceptionEvent read FOnException write FOnException; // Fires when the debugger received an exeption
|
||||
property OnOutput: TDBGOutputEvent read FOnOutput write FOnOutput; // Passes all output of the debugged target
|
||||
property OnState: TDebuggerStateChangedEvent read FOnState write FOnState; // Fires when the current state of the debugger changes
|
||||
property OnBreakPointHit: TDebuggerBreakPointHitEvent read FOnBreakPointHit write FOnBreakPointHit; // Fires when the program is paused at a breakpoint
|
||||
end;
|
||||
TDebuggerClass = class of TDebugger;
|
||||
|
||||
@ -1438,6 +1456,12 @@ begin
|
||||
if Assigned(FOnOutput) then FOnOutput(Self, AText);
|
||||
end;
|
||||
|
||||
procedure TDebugger.DoBreakpointHit(const ABreakPoint: TBaseBreakPoint; var ACanContinue: Boolean);
|
||||
begin
|
||||
if Assigned(FOnBreakpointHit)
|
||||
then FOnBreakpointHit(Self, ABreakPoint, ACanContinue);
|
||||
end;
|
||||
|
||||
procedure TDebugger.DoState(const OldState: TDBGState);
|
||||
begin
|
||||
if State in INTERNAL_STATES then Exit;
|
||||
@ -1694,12 +1718,12 @@ end;
|
||||
|
||||
procedure TBaseBreakPoint.AssignTo(Dest: TPersistent);
|
||||
var
|
||||
DestBreakPoint: TBaseBreakPoint;
|
||||
DestBreakPoint: TBaseBreakPoint absolute Dest;
|
||||
begin
|
||||
// updatelock is set in source.assignto
|
||||
if Dest is TBaseBreakPoint
|
||||
then begin
|
||||
DestBreakPoint:=TBaseBreakPoint(Dest);
|
||||
DestBreakPoint.SetBreakHitCount(FBreakHitCount);
|
||||
DestBreakPoint.SetLocation(FSource, FLine);
|
||||
DestBreakPoint.SetExpression(FExpression);
|
||||
DestBreakPoint.SetEnabled(FEnabled);
|
||||
@ -1715,11 +1739,17 @@ begin
|
||||
FValid := vsUnknown;
|
||||
FEnabled := False;
|
||||
FHitCount := 0;
|
||||
FBreakHitCount := 0;
|
||||
FExpression := '';
|
||||
FInitialEnabled := False;
|
||||
inherited Create(ACollection);
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.DoBreakHitCountChange;
|
||||
begin
|
||||
Changed;
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.DoEnableChange;
|
||||
begin
|
||||
Changed;
|
||||
@ -1735,6 +1765,11 @@ begin
|
||||
SetHitCount(ACount);
|
||||
end;
|
||||
|
||||
function TBaseBreakPoint.GetBreakHitCount: Integer;
|
||||
begin
|
||||
Result := FBreakHitCount;
|
||||
end;
|
||||
|
||||
function TBaseBreakPoint.GetEnabled: Boolean;
|
||||
begin
|
||||
Result := FEnabled;
|
||||
@ -1770,6 +1805,15 @@ begin
|
||||
Result := FValid;
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.SetBreakHitCount(const AValue: Integer);
|
||||
begin
|
||||
if FBreakHitCount <> AValue
|
||||
then begin
|
||||
FBreakHitCount := AValue;
|
||||
DoBreakHitCountChange;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.SetEnabled (const AValue: Boolean );
|
||||
begin
|
||||
if FEnabled <> AValue
|
||||
@ -1840,12 +1884,25 @@ begin
|
||||
Changed;
|
||||
end;
|
||||
|
||||
function TIDEBreakPoint.GetAutoContinueTime: Cardinal;
|
||||
begin
|
||||
Result := FAutoContinueTime;
|
||||
end;
|
||||
|
||||
procedure TIDEBreakPoint.SetAutoContinueTime(const AValue: Cardinal);
|
||||
begin
|
||||
if FAutoContinueTime = AValue then Exit;
|
||||
FAutoContinueTime := AValue;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
procedure TIDEBreakPoint.AssignTo(Dest: TPersistent);
|
||||
begin
|
||||
inherited;
|
||||
if Dest is TIDEBreakPoint
|
||||
then begin
|
||||
TIDEBreakPoint(Dest).Actions := FActions;
|
||||
TIDEBreakPoint(Dest).AutoContinueTime := FAutoContinueTime;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1967,6 +2024,8 @@ begin
|
||||
GroupName:=XMLConfig.GetValue(Path+'Group/Name','');
|
||||
Group:=OnGetGroup(GroupName);
|
||||
Expression:=XMLConfig.GetValue(Path+'Expression/Value','');
|
||||
AutoContinueTime:=XMLConfig.GetValue(Path+'AutoContinueTime/Value',0);
|
||||
BreakHitCount := XMLConfig.GetValue(Path+'BreakHitCount/Value',0);
|
||||
Filename:=XMLConfig.GetValue(Path+'Source/Value','');
|
||||
if Assigned(OnLoadFilename) then OnLoadFilename(Filename);
|
||||
FSource:=Filename;
|
||||
@ -2031,6 +2090,8 @@ begin
|
||||
then AConfig.SetDeleteValue(APath+'Group/Name',Group.Name,'');
|
||||
|
||||
AConfig.SetDeleteValue(APath+'Expression/Value',Expression,'');
|
||||
AConfig.SetDeleteValue(APath+'AutoContinueTime/Value',AutoContinueTime,0);
|
||||
AConfig.SetDeleteValue(APath+'BreakHitCount/Value',BreakHitCount,0);
|
||||
|
||||
Filename := Source;
|
||||
if Assigned(OnSaveFilename) then OnSaveFilename(Filename);
|
||||
@ -2134,6 +2195,17 @@ begin
|
||||
Result:=inherited GetSourceLine;
|
||||
end;
|
||||
|
||||
procedure TDBGBreakPoint.Hit(var ACanContinue: Boolean);
|
||||
var
|
||||
cnt: Integer;
|
||||
begin
|
||||
cnt := HitCount + 1;
|
||||
if BreakHitcount > 0
|
||||
then ACanContinue := cnt < BreakHitcount;
|
||||
DoHit(cnt, ACanContinue);
|
||||
Debugger.DoBreakpointHit(Self, ACanContinue)
|
||||
end;
|
||||
|
||||
procedure TDBGBreakPoint.DoChanged;
|
||||
begin
|
||||
inherited DoChanged;
|
||||
|
@ -37,7 +37,7 @@ unit DebuggerDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms, Controls, IDEProcs, Debugger, EnvironmentOpts;
|
||||
Classes, Forms, Controls, IDEProcs, Debugger, EnvironmentOpts, IDEOptionDefs;
|
||||
|
||||
type
|
||||
TDebuggerDlgClass = class of TDebuggerDlg;
|
||||
@ -84,20 +84,21 @@ begin
|
||||
end;
|
||||
*)
|
||||
procedure TDebuggerDlg.DoClose(var CloseAction: TCloseAction);
|
||||
var
|
||||
Layout: TIDEWindowLayout;
|
||||
begin
|
||||
CloseAction := caFree; // we default to free
|
||||
inherited DoClose(CloseAction);
|
||||
EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Name).GetCurrentPosition;
|
||||
Layout := EnvironmentOptions.IDEWindowLayoutList.ItemByFormID(Name);
|
||||
if Layout <> nil then Layout.GetCurrentPosition;
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.DoBeginUpdate;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.DoEndUpdate;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -268,7 +268,6 @@ type
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
procedure Hit(var ACanContinue: Boolean);
|
||||
procedure SetLocation(const ASource: String; const ALine: Integer); override;
|
||||
end;
|
||||
|
||||
@ -2862,11 +2861,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGDBMIBreakPoint.Hit(var ACanContinue: Boolean);
|
||||
begin
|
||||
DoHit(HitCount + 1, ACanContinue);
|
||||
end;
|
||||
|
||||
procedure TGDBMIBreakPoint.SetBreakpoint;
|
||||
begin
|
||||
if Debugger = nil then Exit;
|
||||
|
@ -62,6 +62,7 @@ type
|
||||
FExceptions: TIDEExceptions;
|
||||
FSignals: TIDESignals;
|
||||
FBreakPoints: TIDEBreakPoints;
|
||||
FBreakPointGroups: TIDEBreakPointGroups;
|
||||
FLocals: TIDELocals;
|
||||
FWatches: TIDEWatches;
|
||||
FRegisters: TIDERegisters;
|
||||
@ -120,6 +121,7 @@ type
|
||||
property State: TDBGState read GetState; // The current state of the debugger
|
||||
|
||||
property BreakPoints: TIDEBreakPoints read FBreakpoints; // A list of breakpoints for the current project
|
||||
property BreakPointGroups: TIDEBreakPointGroups read FBreakPointGroups;
|
||||
property Exceptions: TIDEExceptions read FExceptions; // A list of exceptions we should ignore
|
||||
property CallStack: TIDECallStack read FCallStack;
|
||||
property Locals: TIDELocals read FLocals;
|
||||
|
@ -40,7 +40,7 @@ uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, Forms, Controls, Dialogs, Menus, FileUtil, LCLProc,
|
||||
Classes, SysUtils, Forms, Controls, Dialogs, Menus, ExtCtrls, FileUtil, LCLProc,
|
||||
Laz_XMLCfg,
|
||||
{ for Get/SetForegroundWindow }
|
||||
LCLType, LCLIntf,
|
||||
@ -48,11 +48,11 @@ uses
|
||||
MenuIntf, IDECommands, LazIDEIntf, ProjectIntf,
|
||||
LazConf,
|
||||
CompilerOptions, EditorOptions, EnvironmentOpts, ProjectOpts, KeyMapping, SourceEditor,
|
||||
ProjectDefs, Project, IDEProcs, InputHistory, Debugger,
|
||||
ProjectDefs, Project, IDEProcs, InputHistory, Debugger, CmdLineDebugger,
|
||||
IDEOptionDefs, LazarusIDEStrConsts,
|
||||
MainBar, MainIntf, MainBase, BaseBuildManager,
|
||||
SourceMarks,
|
||||
DebuggerDlg, Watchesdlg, BreakPointsdlg, LocalsDlg, WatchPropertyDlg,
|
||||
DebuggerDlg, Watchesdlg, BreakPointsdlg, BreakPropertyDlg, LocalsDlg, WatchPropertyDlg,
|
||||
CallStackDlg, EvaluateDlg, RegistersDlg, AssemblerDlg, DBGOutputForm,
|
||||
GDBMIDebugger, SSHGDBMIDebugger, ProcessDebugger,
|
||||
BaseDebugManager;
|
||||
@ -73,6 +73,7 @@ type
|
||||
{ TDebugManager }
|
||||
|
||||
TDebugManager = class(TBaseDebugManager)
|
||||
procedure BreakAutoContinueTimer(Sender: TObject);
|
||||
// Menu events
|
||||
procedure mnuViewDebugDialogClick(Sender: TObject);
|
||||
procedure mnuResetDebuggerClicked(Sender: TObject);
|
||||
@ -81,6 +82,7 @@ type
|
||||
function OnSrcNotebookAddWatchesAtCursor(Sender: TObject): boolean;
|
||||
|
||||
// Debugger events
|
||||
procedure DebuggerBreakPointHit(ADebugger: TDebugger; ABreakPoint: TBaseBreakPoint; var ACanContinue: Boolean);
|
||||
procedure DebuggerChangeState(ADebugger: TDebugger; OldState: TDBGState);
|
||||
procedure DebuggerCurrentLine(Sender: TObject; const ALocation: TDBGLocationRec);
|
||||
procedure DebuggerOutput(Sender: TObject; const AText: String);
|
||||
@ -90,11 +92,13 @@ type
|
||||
procedure DebugDialogDestroy(Sender: TObject);
|
||||
private
|
||||
FDebugger: TDebugger;
|
||||
FBreakPointGroups: TIDEBreakPointGroups;
|
||||
FDialogs: array[TDebugDialogType] of TDebuggerDlg;
|
||||
FPrevShownWindow: HWND;
|
||||
// keep track of the last reported location
|
||||
FCurrentLocation: TDBGLocationRec;
|
||||
// last hit breakpoint
|
||||
FCurrentBreakpoint: TIDEBreakpoint;
|
||||
FAutoContinueTimer: TTimer;
|
||||
|
||||
// When a source file is not found, the user can choose one
|
||||
// here are all choices stored
|
||||
@ -946,7 +950,7 @@ begin
|
||||
else
|
||||
AddMenuItem('Enable Breakpoint',true,@OnToggleEnableMenuItemClick);
|
||||
AddMenuItem('Delete Breakpoint',true,@OnDeleteMenuItemClick);
|
||||
AddMenuItem('View Breakpoint Properties',false,@OnViewPropertiesMenuItemClick);
|
||||
AddMenuItem('View Breakpoint Properties',true,@OnViewPropertiesMenuItemClick);
|
||||
// add separator
|
||||
AddMenuItem('-',true,nil);
|
||||
end;
|
||||
@ -1176,6 +1180,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.BreakAutoContinueTimer(Sender: TObject);
|
||||
begin
|
||||
FAutoContinueTimer.Enabled := False;
|
||||
FDebugger.Run;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.DebuggerBreakPointHit(ADebugger: TDebugger;
|
||||
ABreakPoint: TBaseBreakPoint; var ACanContinue: Boolean);
|
||||
begin
|
||||
FCurrentBreakPoint := nil;
|
||||
if FBreakPoints = nil then Exit;
|
||||
if ABreakpoint = nil then Exit;
|
||||
if ACanContinue then Exit;
|
||||
|
||||
FCurrentBreakPoint := FBreakPoints.Find(ABreakPoint.Source, ABreakPoint.SourceLine);
|
||||
end;
|
||||
|
||||
procedure TDebugManager.mnuViewDebugDialogClick(Sender: TObject);
|
||||
begin
|
||||
ViewDebugDialog(TDebugDialogType((Sender as TIDEMenuItem).Tag));
|
||||
@ -1286,20 +1307,27 @@ begin
|
||||
if MainIDE.ToolStatus in [itNone,itDebugger]
|
||||
then MainIDE.ToolStatus := TOOLSTATEMAP[FDebugger.State];
|
||||
|
||||
FAutoContinueTimer.Enabled := false;
|
||||
if (FDebugger.State in [dsRun])
|
||||
then begin
|
||||
// hide IDE during run
|
||||
if EnvironmentOptions.HideIDEOnRun
|
||||
and (MainIDE.ToolStatus=itDebugger) then
|
||||
MainIDE.HideIDE;
|
||||
if EnvironmentOptions.HideIDEOnRun and (MainIDE.ToolStatus=itDebugger)
|
||||
then MainIDE.HideIDE;
|
||||
|
||||
if FPrevShownWindow <> 0 then
|
||||
begin
|
||||
SetForegroundWindow(FPrevShownWindow);
|
||||
FPrevShownWindow := 0;
|
||||
end;
|
||||
FCurrentBreakPoint := nil;
|
||||
end
|
||||
else begin
|
||||
if (OldState in [dsRun]) then
|
||||
if (FCurrentBreakPoint <> nil) and (FCurrentBreakPoint.AutoContinueTime > 0) then
|
||||
begin
|
||||
FAutoContinueTimer.Enabled := True;
|
||||
FAutoContinueTimer.Interval := FCurrentBreakPoint.AutoContinueTime;
|
||||
end
|
||||
else if (OldState in [dsRun]) then
|
||||
begin
|
||||
MainIDE.UnhideIDE;
|
||||
FPrevShownWindow := GetForegroundWindow;
|
||||
@ -1308,8 +1336,7 @@ begin
|
||||
end;
|
||||
|
||||
// unmark execution line
|
||||
if (FDebugger.State <> dsPause)
|
||||
and (SourceNotebook <> nil)
|
||||
if (FDebugger.State <> dsPause) and (SourceNotebook <> nil)
|
||||
then begin
|
||||
Editor := SourceNotebook.GetActiveSE;
|
||||
if Editor <> nil
|
||||
@ -1329,10 +1356,10 @@ begin
|
||||
dsStop: begin
|
||||
if (OldState<>dsIdle)
|
||||
then begin
|
||||
if EnvironmentOptions.DebuggerShowStopMessage then begin
|
||||
MessageDlg(lisExecutionStopped,
|
||||
Format(lisExecutionStoppedOn, [#13#13]),
|
||||
mtInformation, [mbOK],0);
|
||||
if EnvironmentOptions.DebuggerShowStopMessage
|
||||
then begin
|
||||
MessageDlg(lisExecutionStopped,
|
||||
Format(lisExecutionStoppedOn, [#13#13]), mtInformation, [mbOK],0);
|
||||
end;
|
||||
FDebugger.FileName := '';
|
||||
|
||||
@ -1355,6 +1382,7 @@ var
|
||||
SrcLine: Integer;
|
||||
i: Integer;
|
||||
StackEntry: TCallStackEntry;
|
||||
FocusEditor: Boolean;
|
||||
begin
|
||||
if (Sender<>FDebugger) or (Sender=nil) then exit;
|
||||
if Destroying then exit;
|
||||
@ -1417,9 +1445,9 @@ begin
|
||||
SourceNotebook.ClearExecutionLines;
|
||||
SourceNotebook.ClearErrorLines;
|
||||
end;
|
||||
|
||||
// jump editor to execution line
|
||||
if MainIDE.DoJumpToCodePos(nil,nil,NewSource,1,SrcLine,-1,true)<>mrOk
|
||||
FocusEditor := (FCurrentBreakPoint = nil) or (FCurrentBreakPoint.AutoContinueTime = 0);
|
||||
if MainIDE.DoJumpToCodePos(nil,nil,NewSource,1,SrcLine,-1,true, FocusEditor)<>mrOk
|
||||
then exit;
|
||||
|
||||
// mark execution line
|
||||
@ -1596,6 +1624,10 @@ begin
|
||||
|
||||
FUserSourceFiles := TStringList.Create;
|
||||
|
||||
FAutoContinueTimer := TTimer.Create(Self);
|
||||
FAutoContinueTimer.Enabled := False;
|
||||
FAutoContinueTimer.OnTimer := @BreakAutoContinueTimer;
|
||||
|
||||
inherited Create(TheOwner);
|
||||
end;
|
||||
|
||||
@ -1603,7 +1635,9 @@ destructor TDebugManager.Destroy;
|
||||
var
|
||||
DialogType: TDebugDialogType;
|
||||
begin
|
||||
FDestroying:=true;
|
||||
FDestroying := true;
|
||||
|
||||
FreeAndNil(FAutoContinueTimer);
|
||||
|
||||
for DialogType := Low(TDebugDialogType) to High(TDebugDialogType) do
|
||||
DestroyDebugDialog(DialogType);
|
||||
@ -1945,10 +1979,11 @@ begin
|
||||
|
||||
ClearDebugOutputLog;
|
||||
|
||||
FDebugger.OnState := @DebuggerChangeState;
|
||||
FDebugger.OnCurrent := @DebuggerCurrentLine;
|
||||
FDebugger.OnDbgOutput := @DebuggerOutput;
|
||||
FDebugger.OnException := @DebuggerException;
|
||||
FDebugger.OnBreakPointHit := @DebuggerBreakPointHit;
|
||||
FDebugger.OnState := @DebuggerChangeState;
|
||||
FDebugger.OnCurrent := @DebuggerCurrentLine;
|
||||
FDebugger.OnDbgOutput := @DebuggerOutput;
|
||||
FDebugger.OnException := @DebuggerException;
|
||||
|
||||
if FDebugger.State = dsNone
|
||||
then begin
|
||||
@ -2246,17 +2281,12 @@ end;
|
||||
|
||||
function TDebugManager.ShowBreakPointProperties(const ABreakpoint: TIDEBreakPoint): TModalresult;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
// ToDo
|
||||
Result := TBreakPropertyDlg.Create(Self, ABreakpoint).ShowModal;
|
||||
end;
|
||||
|
||||
function TDebugManager.ShowWatchProperties(const AWatch: TIDEWatch): TModalresult;
|
||||
begin
|
||||
with TWatchPropertyDlg.Create(Self, AWatch) do
|
||||
begin
|
||||
Result := ShowModal;
|
||||
Free;
|
||||
end;
|
||||
Result := TWatchPropertyDlg.Create(Self, AWatch).ShowModal;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.SetDebugger(const ADebugger: TDebugger);
|
||||
@ -2286,3 +2316,4 @@ end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
@ -3850,6 +3850,7 @@ resourcestring
|
||||
lisBreak = 'Break';
|
||||
lisEnableGroup = 'Enable Group';
|
||||
lisDisableGroup = 'Disable Group';
|
||||
lisAutoContinue = 'Auto Continue';
|
||||
lisDisabled = 'Disabled';
|
||||
lisInvalidOff = 'Invalid (Off)';
|
||||
lisInvalidOn = 'Invalid (On)';
|
||||
|
13
ide/main.pp
13
ide/main.pp
@ -849,7 +849,7 @@ type
|
||||
ActiveSrcEdit: TSourceEditor;
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
||||
AddJumpPoint: boolean): TModalResult; override;
|
||||
AddJumpPoint: boolean; FocusEditor: Boolean=True): TModalResult; override;
|
||||
procedure DoJumpToCodeToolBossError; override;
|
||||
procedure UpdateSourceNames;
|
||||
procedure SaveSourceEditorChangesToCodeCache(PageIndex: integer); override;
|
||||
@ -10770,6 +10770,7 @@ procedure TMainIDE.UpdateCaption;
|
||||
var NewCaption: string;
|
||||
begin
|
||||
if MainIDEBar=nil then exit;
|
||||
if ToolStatus = itExiting then exit;
|
||||
NewCaption := Format(lisLazarusEditorV, [GetLazarusVersionString]);
|
||||
if MainBarSubTitle<>'' then begin
|
||||
NewCaption:=NewCaption+' - '+MainBarSubTitle;
|
||||
@ -12185,7 +12186,7 @@ end;
|
||||
function TMainIDE.DoJumpToCodePos(
|
||||
ActiveSrcEdit: TSourceEditor; ActiveUnitInfo: TUnitInfo;
|
||||
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
||||
AddJumpPoint: boolean): TModalResult;
|
||||
AddJumpPoint: boolean; FocusEditor: boolean): TModalResult;
|
||||
var
|
||||
NewSrcEdit: TSourceEditor;
|
||||
NewUnitInfo: TUnitInfo;
|
||||
@ -12235,8 +12236,12 @@ begin
|
||||
//DebugLn('TMainIDE.DoJumpToCodePos NewY=',dbgs(NewY),' ',dbgs(TopLine),' ',dbgs(NewTopLine));
|
||||
LeftChar:=Max(NewX-CharsInWindow,1);
|
||||
end;
|
||||
SourceNoteBook.ShowOnTop;
|
||||
SourceNotebook.FocusEditor;
|
||||
|
||||
if FocusEditor
|
||||
then begin
|
||||
SourceNoteBook.ShowOnTop;
|
||||
SourceNotebook.FocusEditor;
|
||||
end;
|
||||
UpdateSourceNames;
|
||||
Result:=mrOk;
|
||||
end;
|
||||
|
@ -165,7 +165,7 @@ type
|
||||
ActiveSrcEdit: TSourceEditor;
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
||||
AddJumpPoint: boolean): TModalResult; virtual; abstract;
|
||||
AddJumpPoint: boolean; FocusEditor: Boolean=True): TModalResult; virtual; abstract;
|
||||
|
||||
procedure FindInFilesPerDialog(AProject: TProject); override;
|
||||
procedure FindInFiles(AProject: TProject; const FindText: string); override;
|
||||
|
Loading…
Reference in New Issue
Block a user