mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 04:48:03 +02:00
implemented jump to code on double click for breakpoints and callstack dlg
git-svn-id: trunk@4214 -
This commit is contained in:
parent
4bff933ab0
commit
c67f949ee8
@ -1,104 +1,106 @@
|
||||
object BreakpointsDlg: TBreakpointsDlg
|
||||
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 = <
|
||||
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
|
||||
ANCHORS = [aktop, akleft]
|
||||
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 = 205
|
||||
Width = 629
|
||||
HelpType = htkeyword
|
||||
MULTISELECT = True
|
||||
POPUPMENU = mnuPopup
|
||||
VIEWSTYLE = vsreport
|
||||
ONCLICK = lvBreakPointsClick
|
||||
ONDBLCLICK = lvBreakPointsDBLCLICK
|
||||
ONSELECTITEM = lvBreakPointsSelectItem
|
||||
HEIGHT = 205
|
||||
WIDTH = 629
|
||||
HELPTYPE = htkeyword
|
||||
end
|
||||
object mnuPopup: TPopupMenu
|
||||
OnPopup = mnuPopupPopup
|
||||
object mnuPopup: TPOPUPMENU
|
||||
ONPOPUP = mnuPopupPopup
|
||||
left = 100
|
||||
top = 96
|
||||
object popAdd: TMenuItem
|
||||
Caption = 'Add...'
|
||||
object popAddSourceBP: TMenuItem
|
||||
Caption = '&Source breakpoint'
|
||||
Enabled = False
|
||||
OnClick = popAddSourceBPClick
|
||||
object popAdd: TMENUITEM
|
||||
CAPTION = 'Add...'
|
||||
object popAddSourceBP: TMENUITEM
|
||||
CAPTION = '&Source breakpoint'
|
||||
ENABLED = False
|
||||
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'
|
||||
ShowAlwaysCheckable = True
|
||||
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,30 +1,31 @@
|
||||
{ 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#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'Enabled'#8#7'OnClick'#7
|
||||
+#19'popAddSourceBPClick'#0#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TM'
|
||||
+'enuItem'#13'popProperties'#7'Caption'#6#11'&Properties'#7'OnClick'#7#18'pop'
|
||||
+'PropertiesClick'#0#0#9'TMenuItem'#10'popEnabled'#7'Caption'#6#8'&Enabled'#19
|
||||
+'ShowAlwaysCheckable'#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'TM'
|
||||
+'enuItem'#2'N2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#13'popDisableAll'#7'Capti'
|
||||
+'on'#6#12'D&isable All'#7'OnClick'#7#18'popDisableAllClick'#0#0#9'TMenuItem'
|
||||
+#12'popEnableAll'#7'Caption'#6#11'&Enable All'#7'OnClick'#7#17'popEnableAllC'
|
||||
+'lick'#0#0#9'TMenuItem'#12'popDeleteAll'#7'Caption'#6#11'&Delete All'#7'OnCl'
|
||||
+'ick'#7#17'popDeleteAllClick'#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'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'CAPT'
|
||||
+'ION'#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'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'vsreport'#7'ONCLICK'#7#18'lvBreakPointsClick'#10
|
||||
+'ONDBLCLICK'#7#21'lvBreakPointsDBLCLICK'#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'ENABLED'#8#7'ONCLICK'#7
|
||||
+#19'popAddSourceBPClick'#0#0#0#9'TMENUITEM'#2'N1'#7'CAPTION'#6#1'-'#0#0#9'TM'
|
||||
+'ENUITEM'#13'popProperties'#7'CAPTION'#6#11'&Properties'#7'ONCLICK'#7#18'pop'
|
||||
+'PropertiesClick'#0#0#9'TMENUITEM'#10'popEnabled'#7'CAPTION'#6#8'&Enabled'#19
|
||||
+'SHOWALWAYSCHECKABLE'#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'TM'
|
||||
+'ENUITEM'#2'N2'#7'CAPTION'#6#1'-'#0#0#9'TMENUITEM'#13'popDisableAll'#7'CAPTI'
|
||||
+'ON'#6#12'D&isable All'#7'ONCLICK'#7#18'popDisableAllClick'#0#0#9'TMENUITEM'
|
||||
+#12'popEnableAll'#7'CAPTION'#6#11'&Enable All'#7'ONCLICK'#7#17'popEnableAllC'
|
||||
+'lick'#0#0#9'TMENUITEM'#12'popDeleteAll'#7'CAPTION'#6#11'&Delete All'#7'ONCL'
|
||||
+'ICK'#7#17'popDeleteAllClick'#0#0#0#0
|
||||
]);
|
||||
|
@ -61,6 +61,7 @@ type
|
||||
popEnableAll: TMenuItem;
|
||||
popDeleteAll: TMenuItem;
|
||||
procedure lvBreakPointsClick(Sender: TObject);
|
||||
procedure lvBreakPointsDBLCLICK(Sender: TObject);
|
||||
procedure lvBreakPointsSelectItem(Sender: TObject; AItem: TListItem;
|
||||
Selected: Boolean);
|
||||
procedure mnuPopupPopup(Sender: TObject);
|
||||
@ -91,6 +92,7 @@ type
|
||||
protected
|
||||
procedure DoEndUpdate; override;
|
||||
procedure BreakPointsUpdate; virtual;
|
||||
procedure DoJumpToCurrentBreakPoint; virtual;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -195,10 +197,26 @@ begin
|
||||
BreakPointUpdate(FBreakPoints,FBreakPoints.Items[i]);
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.DoJumpToCurrentBreakPoint;
|
||||
var
|
||||
CurItem: TListItem;
|
||||
CurBreakPoint: TDBGBreakPoint;
|
||||
begin
|
||||
CurItem:=lvBreakPoints.Selected;
|
||||
if CurItem=nil then exit;
|
||||
CurBreakPoint:=TDBGBreakPoint(CurItem.Data);
|
||||
DoJumpToCodePos(CurBreakPoint.Source,CurBreakPoint.Line,0);
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.lvBreakPointsClick(Sender: TObject);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.lvBreakPointsDBLCLICK(Sender: TObject);
|
||||
begin
|
||||
DoJumpToCurrentBreakPoint;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.lvBreakPointsSelectItem(Sender: TObject;
|
||||
AItem: TListItem; Selected: Boolean);
|
||||
begin
|
||||
@ -384,6 +402,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.16 2003/05/29 23:14:17 mattias
|
||||
implemented jump to code on double click for breakpoints and callstack dlg
|
||||
|
||||
Revision 1.15 2003/05/28 15:56:19 mattias
|
||||
implemented sourcemarks
|
||||
|
||||
|
@ -1,29 +1,36 @@
|
||||
object CallStackDlg: TCallStackDlg
|
||||
Left = 359
|
||||
Top = 126
|
||||
Width = 500
|
||||
Height = 200
|
||||
Caption = 'CallStack'
|
||||
object lvCallStack: TListView
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 484
|
||||
Height = 200
|
||||
Align = alClient
|
||||
Columns = <
|
||||
CAPTION = 'CallStack'
|
||||
CLIENTHEIGHT = 200
|
||||
CLIENTWIDTH = 500
|
||||
VISIBLE = True
|
||||
HORZSCROLLBAR.PAGE = 501
|
||||
VERTSCROLLBAR.PAGE = 201
|
||||
LEFT = 359
|
||||
HEIGHT = 200
|
||||
TOP = 126
|
||||
WIDTH = 500
|
||||
object lvCallStack: TLISTVIEW
|
||||
ALIGN = alclient
|
||||
ANCHORS = [aktop, akleft]
|
||||
COLUMNS = <
|
||||
item
|
||||
Caption = 'Source'
|
||||
Width = 150
|
||||
end
|
||||
CAPTION = 'Source'
|
||||
VISIBLE = True
|
||||
WIDTH = 150
|
||||
end
|
||||
item
|
||||
Caption = 'Line'
|
||||
Width = 50
|
||||
end
|
||||
CAPTION = 'Line'
|
||||
VISIBLE = True
|
||||
WIDTH = 50
|
||||
end
|
||||
item
|
||||
Caption = 'Function'
|
||||
Width = 300
|
||||
CAPTION = 'Function'
|
||||
VISIBLE = True
|
||||
WIDTH = 300
|
||||
end>
|
||||
MultiSelect = False
|
||||
ViewStyle = vsReport
|
||||
VIEWSTYLE = vsreport
|
||||
ONDBLCLICK = lvCallStackDBLCLICK
|
||||
HEIGHT = 200
|
||||
WIDTH = 500
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -37,14 +37,24 @@ unit DebuggerDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms, IDEProcs, Debugger, EnvironmentOpts;
|
||||
Classes, Forms, Controls, IDEProcs, Debugger, EnvironmentOpts;
|
||||
|
||||
type
|
||||
TDebuggerDlg = class;
|
||||
TJumpToCodePosEvent = function(Sender: TDebuggerDlg;
|
||||
const Filename: string; Line, Column: integer
|
||||
): TModalresult of object;
|
||||
TGetFullDebugFilenameEvent =
|
||||
function(Sender: TDebuggerDlg; var Filename: string;
|
||||
AskUserIfNotFound: boolean): TModalresult of object;
|
||||
|
||||
TDebuggerDlgClass = class of TDebuggerDlg;
|
||||
|
||||
TDebuggerDlg = class(TForm)
|
||||
private
|
||||
FDebugger: TDebugger;
|
||||
FOnGetFullDebugFilename: TGetFullDebugFilenameEvent;
|
||||
FOnJumpToCodePos: TJumpToCodePosEvent;
|
||||
FUpdateCount: integer;
|
||||
protected
|
||||
procedure SetDebugger(const ADebugger: TDebugger); virtual;
|
||||
@ -56,7 +66,15 @@ type
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
function UpdateCount: integer;
|
||||
function DoJumpToCodePos(const Filename: string; Line, Column: integer
|
||||
): TModalresult;
|
||||
function DoGetFullDebugFilename(var Filename: string; AskUser: boolean
|
||||
): TModalresult;
|
||||
property Debugger: TDebugger read FDebugger write SetDebugger;
|
||||
property OnJumpToCodePos: TJumpToCodePosEvent read FOnJumpToCodePos
|
||||
write FOnJumpToCodePos;
|
||||
property OnGetFullDebugFilename: TGetFullDebugFilenameEvent
|
||||
read FOnGetFullDebugFilename write FOnGetFullDebugFilename;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -86,6 +104,24 @@ begin
|
||||
Result:=FUpdateCount;
|
||||
end;
|
||||
|
||||
function TDebuggerDlg.DoJumpToCodePos(const Filename: string; Line,
|
||||
Column: integer): TModalresult;
|
||||
begin
|
||||
if Assigned(OnJumpToCodePos) then
|
||||
Result:=OnJumpToCodePos(Self,Filename,Line,Column)
|
||||
else
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
|
||||
function TDebuggerDlg.DoGetFullDebugFilename(var Filename: string;
|
||||
AskUser: boolean): TModalresult;
|
||||
begin
|
||||
if Assigned(OnGetFullDebugFilename) then
|
||||
Result:=OnGetFullDebugFilename(Self,Filename,AskUser)
|
||||
else
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
|
||||
procedure TDebuggerDlg.SetDebugger(const ADebugger: TDebugger);
|
||||
begin
|
||||
FDebugger := ADebugger;
|
||||
@ -109,6 +145,9 @@ end;
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.6 2003/05/29 23:14:17 mattias
|
||||
implemented jump to code on double click for breakpoints and callstack dlg
|
||||
|
||||
Revision 1.5 2003/05/28 08:46:24 mattias
|
||||
break;points dialog now gets the items without debugger
|
||||
|
||||
|
@ -73,6 +73,13 @@ type
|
||||
procedure OnDebuggerOutput(Sender: TObject; const AText: String);
|
||||
procedure OnDebuggerException(Sender: TObject; const AExceptionClass: String;
|
||||
const AExceptionText: String);
|
||||
|
||||
// debugger dialog events
|
||||
function DebuggerDlgJumpToCodePos(Sender: TDebuggerDlg;
|
||||
const Filename: string; Line, Column: integer): TModalresult;
|
||||
procedure DebugDialogDestroy(Sender: TObject);
|
||||
function DebuggerDlgGetFullFilename(Sender: TDebuggerDlg;
|
||||
var Filename: string; AskUserIfNotFound: boolean): TModalresult;
|
||||
private
|
||||
FDebugger: TDebugger;
|
||||
FDebuggerUpdateLock: integer;
|
||||
@ -101,7 +108,6 @@ type
|
||||
var ASrcEdit: TSourceEditor);
|
||||
|
||||
// Dialog routines
|
||||
procedure DebugDialogDestroy(Sender: TObject);
|
||||
procedure ViewDebugDialog(const ADialogType: TDebugDialogType);
|
||||
procedure DestroyDebugDialog(const ADialogType: TDebugDialogType);
|
||||
procedure InitDebugOutputDlg;
|
||||
@ -412,6 +418,86 @@ end;
|
||||
// Menu events
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function TDebugManager.DebuggerDlgJumpToCodePos(Sender: TDebuggerDlg;
|
||||
const Filename: string; Line, Column: integer): TModalresult;
|
||||
begin
|
||||
if not Destroying then
|
||||
Result:=MainIDE.DoJumpToSourcePos(Filename,Column,Line,0,true)
|
||||
else
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
|
||||
function TDebugManager.DebuggerDlgGetFullFilename(Sender: TDebuggerDlg;
|
||||
var Filename: string; AskUserIfNotFound: boolean): TModalresult;
|
||||
var
|
||||
SrcFile: String;
|
||||
n: Integer;
|
||||
UserFilename: string;
|
||||
OpenDialog: TOpenDialog;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
if Destroying then exit;
|
||||
|
||||
SrcFile := Filename;
|
||||
SrcFile := MainIDE.FindSourceFile(SrcFile,Project1.ProjectDirectory,
|
||||
[fsfSearchForProject,fsfUseIncludePaths,fsfUseDebugPath]);
|
||||
if SrcFile = '' then SrcFile := Filename;
|
||||
|
||||
if not FilenameIsAbsolute(SrcFile)
|
||||
then begin
|
||||
// first attempt to get a longer name
|
||||
// short file, look in the user list
|
||||
for n := 0 to FUserSourceFiles.Count - 1 do
|
||||
begin
|
||||
UserFilename := FUserSourceFiles[n];
|
||||
if CompareFileNames(ExtractFilenameOnly(SrcFile),
|
||||
ExtractFilenameOnly(UserFilename)) = 0
|
||||
then begin
|
||||
if FileExists(UserFilename)
|
||||
then begin
|
||||
FUserSourceFiles.Move(n, 0); // move most recent first
|
||||
SrcFile := UserFilename;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if ((not FilenameIsAbsolute(SrcFile)) or (not FileExists(SrcFile)))
|
||||
and AskUserIfNotFound
|
||||
then begin
|
||||
|
||||
if MessageDlg(lisFileNotFound,
|
||||
Format(lisTheFileWasNotFoundDoYouWantToLocateItYourself, ['"',
|
||||
SrcFile, '"', #13, #13, #13])
|
||||
,mtConfirmation, [mbYes, mbNo], 0) <> mrYes
|
||||
then Exit;
|
||||
|
||||
repeat
|
||||
OpenDialog:=TOpenDialog.Create(Application);
|
||||
try
|
||||
InputHistories.ApplyFileDialogSettings(OpenDialog);
|
||||
OpenDialog.Title:=lisOpenFile+' '+SrcFile;
|
||||
OpenDialog.Options:=OpenDialog.Options+[ofFileMustExist];
|
||||
OpenDialog.FileName := SrcFile;
|
||||
if not OpenDialog.Execute then
|
||||
exit;
|
||||
SrcFile:=CleanAndExpandFilename(OpenDialog.FileName);
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
OpenDialog.Free;
|
||||
end;
|
||||
until FilenameIsAbsolute(SrcFile) and FileExists(SrcFile);
|
||||
|
||||
FUserSourceFiles.Insert(0, SrcFile);
|
||||
end;
|
||||
|
||||
if SrcFile<>'' then begin
|
||||
Filename:=SrcFile;
|
||||
Result:=mrOk;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDebugManager.mnuViewDebugDialogClick(Sender: TObject);
|
||||
begin
|
||||
ViewDebugDialog(TDebugDialogType(TMenuItem(Sender).Tag));
|
||||
@ -563,11 +649,9 @@ procedure TDebugManager.OnDebuggerCurrentLine(Sender: TObject;
|
||||
// -> show the current execution line in editor
|
||||
// if SrcLine = -1 then no source is available
|
||||
var
|
||||
S, SrcFile: String;
|
||||
OpenDialog: TOpenDialog;
|
||||
SrcFile: String;
|
||||
NewSource: TCodeBuffer;
|
||||
Editor: TSourceEditor;
|
||||
n: Integer;
|
||||
begin
|
||||
if (Sender<>FDebugger) or (Sender=nil) then exit;
|
||||
if Destroying then exit;
|
||||
@ -582,60 +666,15 @@ begin
|
||||
|
||||
Exit;
|
||||
end;
|
||||
|
||||
SrcFile := MainIDE.FindSourceFile(ALocation.SrcFile,Project1.ProjectDirectory,
|
||||
[fsfSearchForProject,fsfUseIncludePaths,fsfUseDebugPath]);
|
||||
if SrcFile = '' then SrcFile := ALocation.SrcFile;
|
||||
|
||||
if not FilenameIsAbsolute(SrcFile)
|
||||
then begin
|
||||
// first attempt to get a longer name
|
||||
// short file, look in the user list
|
||||
for n := 0 to FUserSourceFiles.Count - 1 do
|
||||
begin
|
||||
S := FUserSourceFiles[n];
|
||||
if CompareFileNames(ExtractFilenameOnly(SrcFile), ExtractFilenameOnly(S)) = 0
|
||||
then begin
|
||||
if FileExists(S)
|
||||
then begin
|
||||
FUserSourceFiles.Move(n, 0); // move most recent first
|
||||
SrcFile := S;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (not FilenameIsAbsolute(SrcFile)) or (not FileExists(SrcFile))
|
||||
then begin
|
||||
|
||||
if MessageDlg(lisFileNotFound,
|
||||
Format(lisTheFileWasNotFoundDoYouWantToLocateItYourself, ['"',
|
||||
SrcFile, '"', #13, #13, #13])
|
||||
,mtConfirmation, [mbYes, mbNo], 0) <> mrYes
|
||||
then Exit;
|
||||
|
||||
repeat
|
||||
OpenDialog:=TOpenDialog.Create(Application);
|
||||
try
|
||||
InputHistories.ApplyFileDialogSettings(OpenDialog);
|
||||
OpenDialog.Title:=lisOpenFile+' '+SrcFile;
|
||||
OpenDialog.Options:=OpenDialog.Options+[ofFileMustExist];
|
||||
OpenDialog.FileName := SrcFile;
|
||||
if not OpenDialog.Execute then
|
||||
exit;
|
||||
SrcFile:=CleanAndExpandFilename(OpenDialog.FileName);
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
OpenDialog.Free;
|
||||
end;
|
||||
until FilenameIsAbsolute(SrcFile) and FileExists(SrcFile);
|
||||
|
||||
FUserSourceFiles.Insert(0, SrcFile);
|
||||
end;
|
||||
SrcFile:=ALocation.SrcFile;
|
||||
if DebuggerDlgGetFullFilename(nil,SrcFile,true)<>mrOk then exit;
|
||||
|
||||
NewSource:=CodeToolBoss.LoadFile(SrcFile,true,false);
|
||||
if NewSource=nil then begin
|
||||
MessageDlg(lisDebugUnableToLoadFile,
|
||||
Format(lisDebugUnableToLoadFile2, ['"', SrcFile, '"']),
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
@ -687,6 +726,8 @@ begin
|
||||
CurDialog.Name:=NonModalIDEWindowNames[DebugDlgIDEWindow[ADialogType]];
|
||||
CurDialog.Tag := Integer(ADialogType);
|
||||
CurDialog.OnDestroy := @DebugDialogDestroy;
|
||||
CurDialog.OnJumpToCodePos:=@DebuggerDlgJumpToCodePos;
|
||||
CurDialog.OnGetFullDebugFilename:=@DebuggerDlgGetFullFilename;
|
||||
EnvironmentOptions.IDEWindowLayoutList.Apply(CurDialog,CurDialog.Name);
|
||||
case ADialogType of
|
||||
ddtOutput: InitDebugOutputDlg;
|
||||
@ -1348,6 +1389,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.39 2003/05/29 23:14:17 mattias
|
||||
implemented jump to code on double click for breakpoints and callstack dlg
|
||||
|
||||
Revision 1.38 2003/05/29 18:47:27 mattias
|
||||
fixed reposition sourcemark
|
||||
|
||||
|
@ -422,6 +422,8 @@ resourcestring
|
||||
|
||||
// file dialogs
|
||||
lisOpenFile = 'Open file';
|
||||
lisDebugUnableToLoadFile = 'Unable to load file';
|
||||
lisDebugUnableToLoadFile2 = 'Unable to load file %s%s%s.';
|
||||
lisOpenProjectFile = 'Open Project File';
|
||||
lisOpenPackageFile = 'Open Package File';
|
||||
lisSaveSpace = 'Save ';
|
||||
|
@ -434,6 +434,9 @@ type
|
||||
procedure SaveEnvironment; virtual; abstract;
|
||||
procedure SetRecentSubMenu(ParentMenuItem: TMenuItem; FileList: TStringList;
|
||||
OnClickEvent: TNotifyEvent); virtual;
|
||||
function DoJumpToSourcePos(const Filename: string;
|
||||
NewX, NewY, NewTopLine: integer;
|
||||
AddJumpPoint: boolean): TModalResult; virtual; abstract;
|
||||
function DoJumpToCodePos(
|
||||
ActiveSrcEdit: TSourceEditor; ActiveUnitInfo: TUnitInfo;
|
||||
NewSource: TCodeBuffer; NewX, NewY, NewTopLine: integer;
|
||||
|
@ -573,8 +573,6 @@ begin
|
||||
EditorAndLine.Line:=ALine;
|
||||
AVLNode:=fSortedItems.FindLeftMostKey(@EditorAndLine,
|
||||
@CompareEditorAndLineWithMark);
|
||||
if ALine=50 then
|
||||
writeln('TSourceMarks.GetMarksForLine ',Aline,' ',AVLNode<>nil);
|
||||
while (AVLNode<>nil) do begin
|
||||
CurMark:=TSourceMark(AVLNode.Data);
|
||||
if CompareEditorAndLineWithMark(@EditorAndLine,CurMark)<>0 then break;
|
||||
|
Loading…
Reference in New Issue
Block a user