mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:47:59 +02:00
implemented enable and deleting breakpoint in breakpoint dlg
git-svn-id: trunk@4202 -
This commit is contained in:
parent
a64e34471b
commit
4e73760765
@ -1,99 +1,103 @@
|
||||
object BreakpointsDlg: TBreakpointsDlg
|
||||
CAPTION = 'Breakpoint list'
|
||||
CLIENTHEIGHT = 200
|
||||
CLIENTWIDTH = 500
|
||||
HORZSCROLLBAR.PAGE = 501
|
||||
VERTSCROLLBAR.PAGE = 201
|
||||
LEFT = 340
|
||||
HEIGHT = 200
|
||||
TOP = 117
|
||||
WIDTH = 500
|
||||
object lvBreakPoints: TLISTVIEW
|
||||
ALIGN = alclient
|
||||
ANCHORS = [aktop, akleft]
|
||||
COLUMNS = <
|
||||
Caption = 'Breakpoint list'
|
||||
ClientHeight = 205
|
||||
ClientWidth = 629
|
||||
Visible = True
|
||||
HorzScrollBar.Page = 630
|
||||
VertScrollBar.Page = 206
|
||||
Left = 340
|
||||
Height = 205
|
||||
Top = 117
|
||||
Width = 629
|
||||
HelpType = htkeyword
|
||||
object lvBreakPoints: TListView
|
||||
Align = alclient
|
||||
Columns = <
|
||||
item
|
||||
CAPTION = 'State'
|
||||
VISIBLE = True
|
||||
WIDTH = 50
|
||||
Caption = 'State'
|
||||
Visible = True
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
CAPTION = 'Filename/Address'
|
||||
VISIBLE = True
|
||||
WIDTH = 150
|
||||
Caption = 'Filename/Address'
|
||||
Visible = True
|
||||
Width = 150
|
||||
end
|
||||
item
|
||||
CAPTION = 'Line/Length'
|
||||
VISIBLE = True
|
||||
WIDTH = 100
|
||||
Caption = 'Line/Length'
|
||||
Visible = True
|
||||
Width = 100
|
||||
end
|
||||
item
|
||||
CAPTION = 'Condition'
|
||||
VISIBLE = True
|
||||
WIDTH = 75
|
||||
Caption = 'Condition'
|
||||
Visible = True
|
||||
Width = 75
|
||||
end
|
||||
item
|
||||
CAPTION = 'Action'
|
||||
VISIBLE = True
|
||||
WIDTH = 50
|
||||
Caption = 'Action'
|
||||
Visible = True
|
||||
Width = 50
|
||||
end
|
||||
item
|
||||
CAPTION = 'Pass Count'
|
||||
VISIBLE = True
|
||||
WIDTH = 100
|
||||
Caption = 'Pass Count'
|
||||
Visible = True
|
||||
Width = 100
|
||||
end
|
||||
item
|
||||
CAPTION = 'Group'
|
||||
VISIBLE = True
|
||||
WIDTH = 50
|
||||
Caption = 'Group'
|
||||
Visible = True
|
||||
Width = 50
|
||||
end>
|
||||
MULTISELECT = True
|
||||
POPUPMENU = mnuPopup
|
||||
VIEWSTYLE = vsreport
|
||||
ONCLICK = lvBreakPointsClick
|
||||
ONSELECTITEM = lvBreakPointsSelectItem
|
||||
HEIGHT = 200
|
||||
WIDTH = 500
|
||||
MultiSelect = True
|
||||
PopupMenu = mnuPopup
|
||||
ViewStyle = vsreport
|
||||
OnClick = lvBreakPointsClick
|
||||
OnSelectItem = lvBreakPointsSelectItem
|
||||
Height = 205
|
||||
Width = 629
|
||||
HelpType = htkeyword
|
||||
end
|
||||
object mnuPopup: TPOPUPMENU
|
||||
object mnuPopup: TPopupMenu
|
||||
OnPopup = mnuPopupPopup
|
||||
left = 100
|
||||
top = 96
|
||||
object popAdd: TMENUITEM
|
||||
CAPTION = 'Add...'
|
||||
object popAddSourceBP: TMENUITEM
|
||||
CAPTION = '&Source breakpoint'
|
||||
ONCLICK = popAddSourceBPClick
|
||||
object popAdd: TMenuItem
|
||||
Caption = 'Add...'
|
||||
object popAddSourceBP: TMenuItem
|
||||
Caption = '&Source breakpoint'
|
||||
OnClick = popAddSourceBPClick
|
||||
end
|
||||
end
|
||||
object N1: TMENUITEM
|
||||
CAPTION = '-'
|
||||
object N1: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object popProperties: TMENUITEM
|
||||
CAPTION = '&Properties'
|
||||
ONCLICK = popPropertiesClick
|
||||
object popProperties: TMenuItem
|
||||
Caption = '&Properties'
|
||||
OnClick = popPropertiesClick
|
||||
end
|
||||
object popEnabled: TMENUITEM
|
||||
CAPTION = '&Enabled'
|
||||
ONCLICK = popEnabledClick
|
||||
object popEnabled: TMenuItem
|
||||
Caption = '&Enabled'
|
||||
ShowAlwaysCheckable = True
|
||||
OnClick = popEnabledClick
|
||||
end
|
||||
object popDelete: TMENUITEM
|
||||
CAPTION = '&Delete'
|
||||
ONCLICK = popDeleteClick
|
||||
object popDelete: TMenuItem
|
||||
Caption = '&Delete'
|
||||
OnClick = popDeleteClick
|
||||
end
|
||||
object N2: TMENUITEM
|
||||
CAPTION = '-'
|
||||
object N2: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object popDisableAll: TMENUITEM
|
||||
CAPTION = 'D&isable All'
|
||||
ONCLICK = popDisableAllClick
|
||||
object popDisableAll: TMenuItem
|
||||
Caption = 'D&isable All'
|
||||
OnClick = popDisableAllClick
|
||||
end
|
||||
object popEnableAll: TMENUITEM
|
||||
CAPTION = '&Enable All'
|
||||
ONCLICK = popEnableAllClick
|
||||
object popEnableAll: TMenuItem
|
||||
Caption = '&Enable All'
|
||||
OnClick = popEnableAllClick
|
||||
end
|
||||
object popDeleteAll: TMENUITEM
|
||||
CAPTION = '&Delete All'
|
||||
ONCLICK = popDeleteAllClick
|
||||
object popDeleteAll: TMenuItem
|
||||
Caption = '&Delete All'
|
||||
OnClick = popDeleteAllClick
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,29 +1,30 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TBreakpointsDlg','FORMDATA',[
|
||||
'TPF0'#15'TBreakpointsDlg'#14'BreakpointsDlg'#7'CAPTION'#6#15'Breakpoint list'
|
||||
+#12'CLIENTHEIGHT'#3#200#0#11'CLIENTWIDTH'#3#244#1#18'HORZSCROLLBAR.PAGE'#3
|
||||
+#245#1#18'VERTSCROLLBAR.PAGE'#3#201#0#4'LEFT'#3'T'#1#6'HEIGHT'#3#200#0#3'TOP'
|
||||
+#2'u'#5'WIDTH'#3#244#1#0#9'TLISTVIEW'#13'lvBreakPoints'#5'ALIGN'#7#8'alclien'
|
||||
+'t'#7'ANCHORS'#11#5'aktop'#6'akleft'#0#7'COLUMNS'#14#1#7'CAPTION'#6#5'State'
|
||||
+#7'VISIBLE'#9#5'WIDTH'#2'2'#0#1#7'CAPTION'#6#16'Filename/Address'#7'VISIBLE'
|
||||
+#9#5'WIDTH'#3#150#0#0#1#7'CAPTION'#6#11'Line/Length'#7'VISIBLE'#9#5'WIDTH'#2
|
||||
+'d'#0#1#7'CAPTION'#6#9'Condition'#7'VISIBLE'#9#5'WIDTH'#2'K'#0#1#7'CAPTION'#6
|
||||
+#6'Action'#7'VISIBLE'#9#5'WIDTH'#2'2'#0#1#7'CAPTION'#6#10'Pass Count'#7'VISI'
|
||||
+'BLE'#9#5'WIDTH'#2'd'#0#1#7'CAPTION'#6#5'Group'#7'VISIBLE'#9#5'WIDTH'#2'2'#0
|
||||
+#0#11'MULTISELECT'#9#9'POPUPMENU'#7#8'mnuPopup'#9'VIEWSTYLE'#7#8'vsreport'#7
|
||||
+'ONCLICK'#7#18'lvBreakPointsClick'#12'ONSELECTITEM'#7#23'lvBreakPointsSelect'
|
||||
+'Item'#6'HEIGHT'#3#200#0#5'WIDTH'#3#244#1#0#0#10'TPOPUPMENU'#8'mnuPopup'#4'l'
|
||||
+'eft'#2'd'#3'top'#2'`'#0#9'TMENUITEM'#6'popAdd'#7'CAPTION'#6#6'Add...'#0#9'T'
|
||||
+'MENUITEM'#14'popAddSourceBP'#7'CAPTION'#6#18'&Source breakpoint'#7'ONCLICK'
|
||||
+#7#19'popAddSourceBPClick'#0#0#0#9'TMENUITEM'#2'N1'#7'CAPTION'#6#1'-'#0#0#9
|
||||
+'TMENUITEM'#13'popProperties'#7'CAPTION'#6#11'&Properties'#7'ONCLICK'#7#18'p'
|
||||
+'opPropertiesClick'#0#0#9'TMENUITEM'#10'popEnabled'#7'CAPTION'#6#8'&Enabled'
|
||||
+#7'ONCLICK'#7#15'popEnabledClick'#0#0#9'TMENUITEM'#9'popDelete'#7'CAPTION'#6
|
||||
+#7'&Delete'#7'ONCLICK'#7#14'popDeleteClick'#0#0#9'TMENUITEM'#2'N2'#7'CAPTION'
|
||||
+#6#1'-'#0#0#9'TMENUITEM'#13'popDisableAll'#7'CAPTION'#6#12'D&isable All'#7'O'
|
||||
+'NCLICK'#7#18'popDisableAllClick'#0#0#9'TMENUITEM'#12'popEnableAll'#7'CAPTIO'
|
||||
+'N'#6#11'&Enable All'#7'ONCLICK'#7#17'popEnableAllClick'#0#0#9'TMENUITEM'#12
|
||||
+'popDeleteAll'#7'CAPTION'#6#11'&Delete All'#7'ONCLICK'#7#17'popDeleteAllClic'
|
||||
+'k'#0#0#0#0
|
||||
'TPF0'#15'TBreakpointsDlg'#14'BreakpointsDlg'#7'Caption'#6#15'Breakpoint list'
|
||||
+#12'ClientHeight'#3#205#0#11'ClientWidth'#3'u'#2#7'Visible'#9#18'HorzScrollB'
|
||||
+'ar.Page'#3'v'#2#18'VertScrollBar.Page'#3#206#0#4'Left'#3'T'#1#6'Height'#3
|
||||
+#205#0#3'Top'#2'u'#5'Width'#3'u'#2#8'HelpType'#7#9'htkeyword'#0#9'TListView'
|
||||
+#13'lvBreakPoints'#5'Align'#7#8'alclient'#7'Columns'#14#1#7'Caption'#6#5'Sta'
|
||||
+'te'#7'Visible'#9#5'Width'#2'2'#0#1#7'Caption'#6#16'Filename/Address'#7'Visi'
|
||||
+'ble'#9#5'Width'#3#150#0#0#1#7'Caption'#6#11'Line/Length'#7'Visible'#9#5'Wid'
|
||||
+'th'#2'd'#0#1#7'Caption'#6#9'Condition'#7'Visible'#9#5'Width'#2'K'#0#1#7'Cap'
|
||||
+'tion'#6#6'Action'#7'Visible'#9#5'Width'#2'2'#0#1#7'Caption'#6#10'Pass Count'
|
||||
+#7'Visible'#9#5'Width'#2'd'#0#1#7'Caption'#6#5'Group'#7'Visible'#9#5'Width'#2
|
||||
+'2'#0#0#11'MultiSelect'#9#9'PopupMenu'#7#8'mnuPopup'#9'ViewStyle'#7#8'vsrepo'
|
||||
+'rt'#7'OnClick'#7#18'lvBreakPointsClick'#12'OnSelectItem'#7#23'lvBreakPoints'
|
||||
+'SelectItem'#6'Height'#3#205#0#5'Width'#3'u'#2#8'HelpType'#7#9'htkeyword'#0#0
|
||||
+#10'TPopupMenu'#8'mnuPopup'#7'OnPopup'#7#13'mnuPopupPopup'#4'left'#2'd'#3'to'
|
||||
+'p'#2'`'#0#9'TMenuItem'#6'popAdd'#7'Caption'#6#6'Add...'#0#9'TMenuItem'#14'p'
|
||||
+'opAddSourceBP'#7'Caption'#6#18'&Source breakpoint'#7'OnClick'#7#19'popAddSo'
|
||||
+'urceBPClick'#0#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#13
|
||||
+'popProperties'#7'Caption'#6#11'&Properties'#7'OnClick'#7#18'popPropertiesCl'
|
||||
+'ick'#0#0#9'TMenuItem'#10'popEnabled'#7'Caption'#6#8'&Enabled'#19'ShowAlways'
|
||||
+'Checkable'#9#7'OnClick'#7#15'popEnabledClick'#0#0#9'TMenuItem'#9'popDelete'
|
||||
+#7'Caption'#6#7'&Delete'#7'OnClick'#7#14'popDeleteClick'#0#0#9'TMenuItem'#2
|
||||
+'N2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#13'popDisableAll'#7'Caption'#6#12'D&'
|
||||
+'isable All'#7'OnClick'#7#18'popDisableAllClick'#0#0#9'TMenuItem'#12'popEnab'
|
||||
+'leAll'#7'Caption'#6#11'&Enable All'#7'OnClick'#7#17'popEnableAllClick'#0#0#9
|
||||
+'TMenuItem'#12'popDeleteAll'#7'Caption'#6#11'&Delete All'#7'OnClick'#7#17'po'
|
||||
+'pDeleteAllClick'#0#0#0#0
|
||||
]);
|
||||
|
@ -42,6 +42,11 @@ uses
|
||||
Buttons, Extctrls, Menus, ComCtrls, IDEProcs, Debugger, DebuggerDlg;
|
||||
|
||||
type
|
||||
TBreakPointsDlgState = (
|
||||
bpdsItemsNeedUpdate
|
||||
);
|
||||
TBreakPointsDlgStates = set of TBreakPointsDlgState;
|
||||
|
||||
TBreakPointsDlg = class(TDebuggerDlg)
|
||||
lvBreakPoints: TListView;
|
||||
mnuPopup: TPopupMenu;
|
||||
@ -58,6 +63,7 @@ type
|
||||
procedure lvBreakPointsClick(Sender: TObject);
|
||||
procedure lvBreakPointsSelectItem(Sender: TObject; AItem: TListItem;
|
||||
Selected: Boolean);
|
||||
procedure mnuPopupPopup(Sender: TObject);
|
||||
procedure popAddSourceBPClick(Sender: TObject);
|
||||
procedure popPropertiesClick(Sender: TObject);
|
||||
procedure popEnabledClick(Sender: TObject);
|
||||
@ -68,6 +74,7 @@ type
|
||||
private
|
||||
FBaseDirectory: string;
|
||||
FBreakpointsNotification: TDBGBreakPointsNotification;
|
||||
FStates: TBreakPointsDlgStates;
|
||||
procedure BreakPointAdd(const ASender: TDBGBreakPoints;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
procedure BreakPointUpdate(const ASender: TDBGBreakPoints;
|
||||
@ -81,9 +88,11 @@ type
|
||||
procedure UpdateAll;
|
||||
protected
|
||||
procedure SetDebugger(const ADebugger: TDebugger); override;
|
||||
procedure DoEndUpdate; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
public
|
||||
property BaseDirectory: string read FBaseDirectory write SetBaseDirectory;
|
||||
end;
|
||||
|
||||
@ -118,7 +127,13 @@ begin
|
||||
Item := lvBreakPoints.Items.FindData(ABreakpoint);
|
||||
if Item = nil
|
||||
then BreakPointAdd(ASender, ABreakPoint)
|
||||
else UpdateItem(Item, ABreakPoint);
|
||||
else begin
|
||||
if UpdateCount>0 then begin
|
||||
Include(FStates,bpdsItemsNeedUpdate);
|
||||
exit;
|
||||
end;
|
||||
UpdateItem(Item, ABreakPoint);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.BreakPointRemove(const ASender: TDBGBreakPoints;
|
||||
@ -161,13 +176,31 @@ end;
|
||||
|
||||
procedure TBreakPointsDlg.lvBreakPointsSelectItem(Sender: TObject;
|
||||
AItem: TListItem; Selected: Boolean);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.mnuPopupPopup(Sender: TObject);
|
||||
var
|
||||
Enable: Boolean;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
begin
|
||||
Enable := lvBreakPoints.Selected <> nil;
|
||||
if Enable then
|
||||
CurBreakPoint:=TDBGBreakPoint(lvBreakPoints.Selected.Data)
|
||||
else
|
||||
CurBreakPoint:=nil;
|
||||
popProperties.Enabled := Enable;
|
||||
popEnabled.Enabled := Enable;
|
||||
if CurBreakPoint<>nil then
|
||||
popEnabled.Checked := CurBreakPoint.Enabled
|
||||
else
|
||||
popEnabled.Checked := false;
|
||||
popDelete.Enabled := Enable;
|
||||
|
||||
Enable := lvBreakPoints.Items.Count>0;
|
||||
popDisableAll.Enabled := Enable;
|
||||
popDeleteAll.Enabled := Enable;
|
||||
popEnableAll.Enabled := Enable;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popAddSourceBPClick(Sender: TObject);
|
||||
@ -183,7 +216,19 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popDeleteClick(Sender: TObject);
|
||||
var
|
||||
CurItem: TListItem;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if CurItem=nil then exit;
|
||||
CurBreakPoint:=TDBGBreakPoint(CurItem.Data);
|
||||
if MessageDlg('Delete breakpoint?',
|
||||
'Delete breakpoint at'#13
|
||||
+'"'+CurBreakPoint.Source+'" line '+IntToStr(CurBreakPoint.Line)+'?',
|
||||
mtConfirmation,[mbYes,mbCancel],0)<>mrYes
|
||||
then exit;
|
||||
CurBreakPoint.Free;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popDisableAllClick(Sender: TObject);
|
||||
@ -213,7 +258,12 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popEnabledClick(Sender: TObject);
|
||||
var
|
||||
CurItem: TListItem;
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if (CurItem=nil) then exit;
|
||||
TDBGBreakPoint(CurItem.Data).Enabled:=not TDBGBreakPoint(CurItem.Data).Enabled;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.popPropertiesClick(Sender: TObject);
|
||||
@ -237,6 +287,12 @@ begin
|
||||
else inherited;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.DoEndUpdate;
|
||||
begin
|
||||
inherited DoEndUpdate;
|
||||
if bpdsItemsNeedUpdate in FStates then UpdateAll;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.UpdateItem(const AItem: TListItem;
|
||||
const ABreakpoint: TDBGBreakPoint);
|
||||
const
|
||||
@ -246,8 +302,8 @@ const
|
||||
// enabled valid
|
||||
DEBUG_STATE: array[Boolean, TValidState] of String = (
|
||||
{vsUnknown, vsValid, vsInvalid}
|
||||
{Enabled} ('', '?', ''),
|
||||
{Disabled}('*', '!', '*'));
|
||||
{Disabled} ('?', 'Disabled','Invalid'),
|
||||
{Endabled} ('?', 'Enabled', 'Invalid'));
|
||||
var
|
||||
Action: TDBGBreakPointAction;
|
||||
S: String;
|
||||
@ -297,8 +353,19 @@ begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.UpdateAll;
|
||||
var
|
||||
i: Integer;
|
||||
CurItem: TListItem;
|
||||
begin
|
||||
|
||||
if UpdateCount>0 then begin
|
||||
Include(FStates,bpdsItemsNeedUpdate);
|
||||
exit;
|
||||
end;
|
||||
Exclude(FStates,bpdsItemsNeedUpdate);
|
||||
for i:=0 to lvBreakPoints.Items.Count-1 do begin
|
||||
CurItem:=lvBreakPoints.Items[i];
|
||||
UpdateItem(CurItem,TDBGBreakPoint(CurItem.Data));
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -309,6 +376,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.13 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.12 2003/05/27 15:04:00 mattias
|
||||
small fixes for debugger without file
|
||||
|
||||
|
@ -59,13 +59,14 @@ type
|
||||
function ReadLine(const APeek: Boolean): String; overload;
|
||||
procedure SendCmdLn(const ACommand: String); overload;
|
||||
procedure SendCmdLn(const ACommand: String; Values: array of const); overload;
|
||||
property DebugProcess: TProcess read FDbgProcess;
|
||||
property DebugProcessRunning: Boolean read GetDebugProcessRunning;
|
||||
property LineEnds: TStringList read FLineEnds;
|
||||
public
|
||||
constructor Create(const AExternalDebugger: String); {override; }
|
||||
destructor Destroy; override;
|
||||
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
|
||||
public
|
||||
property DebugProcess: TProcess read FDbgProcess;
|
||||
property DebugProcessRunning: Boolean read GetDebugProcessRunning;
|
||||
property LineEnds: TStringList read FLineEnds;
|
||||
end;
|
||||
|
||||
procedure SendBreak(const AHandle: Integer);
|
||||
@ -203,6 +204,7 @@ begin
|
||||
inherited;
|
||||
try
|
||||
FDbgProcess.Free;
|
||||
FDbgProcess:=nil;
|
||||
except
|
||||
on E: Exception do WriteLN('Exeption while freeing debugger: ', E.Message);
|
||||
end;
|
||||
@ -242,6 +244,7 @@ begin
|
||||
end;
|
||||
|
||||
function TCmdLineDebugger.ReadLine(const APeek: Boolean): String;
|
||||
|
||||
function ReadData(const AStream: TStream; var ABuffer: String): Integer;
|
||||
var
|
||||
S: String;
|
||||
@ -363,6 +366,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.15 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.14 2003/05/23 14:12:51 mattias
|
||||
implemented restoring breakpoints
|
||||
|
||||
|
@ -1036,6 +1036,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Changed(false);
|
||||
end;
|
||||
|
||||
procedure TDBGBreakPoint.EnableGroups;
|
||||
@ -2168,6 +2169,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.29 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.28 2003/05/27 08:01:31 marc
|
||||
MWE: + Added exception break
|
||||
* Reworked adding/removing breakpoints
|
||||
|
@ -45,11 +45,17 @@ type
|
||||
TDebuggerDlg = class(TForm)
|
||||
private
|
||||
FDebugger: TDebugger;
|
||||
FUpdateCount: integer;
|
||||
protected
|
||||
procedure SetDebugger(const ADebugger: TDebugger); virtual;
|
||||
procedure DoClose(var Action: TCloseAction); override;
|
||||
procedure DoBeginUpdate; virtual;
|
||||
procedure DoEndUpdate; virtual;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
function UpdateCount: integer;
|
||||
property Debugger: TDebugger read FDebugger write SetDebugger;
|
||||
end;
|
||||
|
||||
@ -63,6 +69,26 @@ begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.BeginUpdate;
|
||||
begin
|
||||
inc(FUpdateCount);
|
||||
writeln('TDebuggerDlg.BeginUpdate ',ClassName,' ',FUpdateCount);
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.EndUpdate;
|
||||
begin
|
||||
if FUpdateCount<1 then RaiseException('TDebuggerDlg.EndUpdate');
|
||||
dec(FUpdateCount);
|
||||
|
||||
writeln('TDebuggerDlg.EndUpdate ',ClassName,' ',FUpdateCount);
|
||||
if FUpdateCount=0 then DoEndUpdate;
|
||||
end;
|
||||
|
||||
function TDebuggerDlg.UpdateCount: integer;
|
||||
begin
|
||||
Result:=FUpdateCount;
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.SetDebugger(const ADebugger: TDebugger);
|
||||
begin
|
||||
FDebugger := ADebugger;
|
||||
@ -74,8 +100,21 @@ begin
|
||||
EnvironmentOptions.IDEWindowLayoutList.ItemByForm(Self).GetCurrentPosition;
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.DoBeginUpdate;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.DoEndUpdate;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.4 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.3 2003/05/18 10:42:58 mattias
|
||||
implemented deleting empty submenus
|
||||
|
||||
|
@ -500,24 +500,27 @@ end;
|
||||
|
||||
procedure TGDBBreakPoint.DoActionChange;
|
||||
begin
|
||||
Changed(False);
|
||||
end;
|
||||
|
||||
procedure TGDBBreakPoint.DoEnableChange;
|
||||
procedure TGDBBreakPoint.DoEnableChange;
|
||||
const
|
||||
CMD: array[Boolean] of String = ('disable', 'enable');
|
||||
begin
|
||||
if FBreakID = 0 then Exit;
|
||||
|
||||
TGDBDebugger(Debugger).SendCommand('%s %d', [CMD[Enabled], FBreakID]);
|
||||
Changed(false);
|
||||
end;
|
||||
|
||||
procedure TGDBBreakPoint.DoExpressionChange;
|
||||
begin
|
||||
Changed(False);
|
||||
end;
|
||||
|
||||
procedure TGDBBreakPoint.DoStateChange;
|
||||
begin
|
||||
inherited;
|
||||
inherited DoStateChange;
|
||||
if (Debugger.State = dsStop)
|
||||
and (FBreakID = 0)
|
||||
then SetBreakpoint;
|
||||
@ -595,6 +598,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.11 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.10 2003/05/23 14:12:51 mattias
|
||||
implemented restoring breakpoints
|
||||
|
||||
|
@ -103,6 +103,8 @@ type
|
||||
procedure LoadProjectSpecificInfo(XMLConfig: TXMLConfig); override;
|
||||
procedure SaveProjectSpecificInfo(XMLConfig: TXMLConfig); override;
|
||||
procedure DoRestoreDebuggerMarks(AnUnitInfo: TUnitInfo); override;
|
||||
procedure BeginUpdateDialogs;
|
||||
procedure EndUpdateDialogs;
|
||||
|
||||
function DoInitDebugger: TModalResult; override;
|
||||
function DoPauseProject: TModalResult; override;
|
||||
@ -589,6 +591,28 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.BeginUpdateDialogs;
|
||||
var
|
||||
DialogType: TDebugDialogType;
|
||||
CurDialog: TDebuggerDlg;
|
||||
begin
|
||||
for DialogType:=Low(FDialogs) to High(FDialogs) do begin
|
||||
CurDialog:=FDialogs[DialogType];
|
||||
if CurDialog<>nil then CurDialog.BeginUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.EndUpdateDialogs;
|
||||
var
|
||||
DialogType: TDebugDialogType;
|
||||
CurDialog: TDebuggerDlg;
|
||||
begin
|
||||
for DialogType:=Low(FDialogs) to High(FDialogs) do begin
|
||||
CurDialog:=FDialogs[DialogType];
|
||||
if CurDialog<>nil then CurDialog.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Debugger routines
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -673,56 +697,61 @@ begin
|
||||
OldBreakPointGroups := nil;
|
||||
OldWatches := nil;
|
||||
|
||||
BeginUpdateDialogs;
|
||||
try
|
||||
case EnvironmentOptions.DebuggerType of
|
||||
dtGnuDebugger: begin
|
||||
// check if debugger already created with the right type
|
||||
if (FDebugger <> nil)
|
||||
and ( not(FDebugger is TGDBMIDebugger)
|
||||
or (FDebugger.ExternalDebugger <> EnvironmentOptions.DebuggerFilename)
|
||||
)
|
||||
then begin
|
||||
// the current debugger is the wrong type -> free it
|
||||
try
|
||||
case EnvironmentOptions.DebuggerType of
|
||||
dtGnuDebugger: begin
|
||||
// check if debugger already created with the right type
|
||||
if (FDebugger <> nil)
|
||||
and ( not(FDebugger is TGDBMIDebugger)
|
||||
or (FDebugger.ExternalDebugger <> EnvironmentOptions.DebuggerFilename)
|
||||
)
|
||||
then begin
|
||||
// the current debugger is the wrong type -> free it
|
||||
FreeDebugger;
|
||||
end;
|
||||
// create debugger object
|
||||
if FDebugger = nil
|
||||
then begin
|
||||
SaveDebuggerItems;
|
||||
FDebugger := TGDBMIDebugger.Create(EnvironmentOptions.DebuggerFilename);
|
||||
FBreakPointGroups := FDebugger.BreakPointGroups;
|
||||
FBreakPoints := FDebugger.BreakPoints;
|
||||
FWatches := FDebugger.Watches;
|
||||
ResetDialogs;
|
||||
end;
|
||||
// restore debugger items
|
||||
RestoreDebuggerItems;
|
||||
end;
|
||||
else
|
||||
if FDebugger=nil then
|
||||
FreeDebugger;
|
||||
end;
|
||||
// create debugger object
|
||||
if FDebugger = nil
|
||||
then begin
|
||||
SaveDebuggerItems;
|
||||
FDebugger := TGDBMIDebugger.Create(EnvironmentOptions.DebuggerFilename);
|
||||
FBreakPointGroups := FDebugger.BreakPointGroups;
|
||||
FBreakPoints := FDebugger.BreakPoints;
|
||||
FWatches := FDebugger.Watches;
|
||||
ResetDialogs;
|
||||
end;
|
||||
// restore debugger items
|
||||
RestoreDebuggerItems;
|
||||
exit;
|
||||
end;
|
||||
else
|
||||
if FDebugger=nil then
|
||||
FreeDebugger;
|
||||
exit;
|
||||
finally
|
||||
OldBreakpoints.Free;
|
||||
OldBreakPointGroups.Free;
|
||||
OldWatches.Free;
|
||||
end;
|
||||
FDebugger.OnState := @OnDebuggerChangeState;
|
||||
FDebugger.OnCurrent := @OnDebuggerCurrentLine;
|
||||
FDebugger.OnDbgOutput := @OnDebuggerOutput;
|
||||
FDebugger.OnException := @OnDebuggerException;
|
||||
if FDebugger.State = dsNone
|
||||
then FDebugger.Init;
|
||||
|
||||
FDebugger.FileName := LaunchingApplication;
|
||||
FDebugger.Arguments := LaunchingParams;
|
||||
Project1.RunParameterOptions.AssignEnvironmentTo(FDebugger.Environment);
|
||||
|
||||
if FDialogs[ddtOutput] <> nil
|
||||
then TDbgOutputForm(FDialogs[ddtOutput]).Clear;
|
||||
|
||||
//TODO: Show/hide debug menuitems based on FDebugger.SupportedCommands
|
||||
finally
|
||||
OldBreakpoints.Free;
|
||||
OldBreakPointGroups.Free;
|
||||
OldWatches.Free;
|
||||
EndUpdateDialogs;
|
||||
end;
|
||||
FDebugger.OnState := @OnDebuggerChangeState;
|
||||
FDebugger.OnCurrent := @OnDebuggerCurrentLine;
|
||||
FDebugger.OnDbgOutput := @OnDebuggerOutput;
|
||||
FDebugger.OnException := @OnDebuggerException;
|
||||
if FDebugger.State = dsNone
|
||||
then FDebugger.Init;
|
||||
|
||||
FDebugger.FileName := LaunchingApplication;
|
||||
FDebugger.Arguments := LaunchingParams;
|
||||
Project1.RunParameterOptions.AssignEnvironmentTo(FDebugger.Environment);
|
||||
|
||||
if FDialogs[ddtOutput] <> nil
|
||||
then TDbgOutputForm(FDialogs[ddtOutput]).Clear;
|
||||
|
||||
//TODO: Show/hide debug menuitems based on FDebugger.SupportedCommands
|
||||
|
||||
Result := mrOk;
|
||||
WriteLN('[TDebugManager.DoInitDebugger] END');
|
||||
@ -938,6 +967,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.30 2003/05/27 20:58:12 mattias
|
||||
implemented enable and deleting breakpoint in breakpoint dlg
|
||||
|
||||
Revision 1.29 2003/05/27 15:04:00 mattias
|
||||
small fixes for debugger without file
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user