2
$Id: fpmdebug.inc,v 1.10 2005/04/04 03:59:13 marco Exp $
3
This file is part of the Free Pascal Integrated Development Environment
4
Copyright (c) 1998 by Berczi Gabor
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
**********************************************************************}
17
{$ifdef SUPPORT_REMOTE}
18
function GetRemoteString : string;
22
St:=RemoteSendCommand;
23
If RemoteConfig<>'' then
24
ReplaceStrI(St,'$CONFIG','-F '+RemoteConfig)
26
ReplaceStrI(St,'$CONFIG','');
27
If RemoteIdent<>'' then
28
ReplaceStrI(St,'$IDENT','-i '+RemoteIdent)
30
ReplaceStrI(St,'$IDENT','');
31
ReplaceStrI(St,'$LOCALFILE',GDBFileName(ExeFile));
32
ReplaceStrI(St,'$REMOTEDIR',RemoteDir);
33
ReplaceStrI(St,'$REMOTEMACHINE',RemoteMachine);
37
procedure TIDEApp.TransferRemote;
39
S,SendCommand : string;
42
SendCommand:=GetRemoteString;
43
if SendCommand<>'' then
46
if LocateExeFile(s) then
47
Executed:=DoExecute(s,SendCommand,'','','',exNormal)
49
Executed:=DoExecute('scp',SendCommand,'','','',exNormal);
52
if (DosError<>0) or (DosExitCode<>0) then
53
ErrorBox(#3'Execution of'#13#3+s+' '+SendCommand+#13#3+
54
'returned ('+inttostr(DosError)+','+inttostr(DosExitCode)+')',nil);
57
ErrorBox(#3'Unable to execute'#13#3+s+' '+SendCommand,nil);
61
ErrorBox(#3'Unable to transfer executable',nil);
63
{$endif SUPPORT_REMOTE}
65
procedure TIDEApp.DoUserScreenWindow;
67
if UserScreenWindow=nil then
69
New(UserScreenWindow, Init(UserScreen, SearchFreeWindowNo));
70
Desktop^.Insert(UserScreenWindow);
72
UserScreenWindow^.MakeFirst;
75
procedure TIDEApp.DoCloseUserScreenWindow;
77
if Assigned(UserScreenWindow) then
78
Message(UserScreenWindow,evCommand,cmClose,nil);
81
procedure TIDEApp.DoUserScreen;
86
if UserScreen=nil then
88
ErrorBox(msg_userscreennotavailable,nil);
99
Drivers.GetKeyEvent(Event);
100
if (Event.What and EvKeyboard)=evNothing then
104
Drivers.GetMouseEvent(Event);
105
if (Event.What and evMouse)=evNothing then
112
Event.what:=evkeyboard;
113
until Event.What in [evKeyboard,evmouse];
114
if event.what=evmouse then
119
if not UserScreen^.CanScroll then
122
case Event.keycode of
123
kbPgUp : UserScreen^.Scroll(-20);
124
kbPgDn : UserScreen^.Scroll(20);
125
kbUp : UserScreen^.Scroll(-1);
126
kbDown : UserScreen^.Scroll(1);
127
kbHome : UserScreen^.Scroll(-1024);
128
kbEnd : UserScreen^.Scroll(+1024);
135
until Event.what in [evKeyboard,evmouse];
136
while (Keyboard.PollKeyEvent<>0) do
137
Keyboard.GetKeyEvent;
140
while PollMouseEvent(Ev) do
149
procedure TIDEApp.DoShowCallStack;
154
If not assigned(StackWindow) then
157
StackWindow^.MakeFirst;
162
procedure TIDEApp.DoShowDisassembly;
167
If not assigned(DisassemblyWindow) then
168
InitDisassemblyWindow
170
DisassemblyWindow^.MakeFirst;
171
DisassemblyWindow^.LoadFunction('');
176
procedure TIDEApp.DoShowRegisters;
181
If not assigned(RegistersWindow) then
184
RegistersWindow^.MakeFirst;
188
procedure TIDEApp.DoShowFPU;
193
If not assigned(FPUWindow) then
196
FPUWindow^.MakeFirst;
201
procedure TIDEApp.DoShowVector;
206
If not assigned(VectorWindow) then
209
VectorWindow^.MakeFirst;
213
procedure TIDEApp.DoShowBreakpointList;
218
If assigned(BreakpointsWindow) then
220
BreakpointsWindow^.Update;
221
BreakpointsWindow^.Show;
222
BreakpointsWindow^.MakeFirst;
226
New(BreakpointsWindow,Init);
227
Desktop^.Insert(BreakpointsWindow);
232
procedure TIDEApp.DoShowWatches;
237
If assigned(WatchesWindow) then
239
WatchesWindow^.Update;
240
WatchesWindow^.MakeFirst;
244
New(WatchesWindow,Init);
245
Desktop^.Insert(WatchesWindow);
250
procedure TIDEApp.DoAddWatch;
258
EditorWindow : PSourceWindow;
259
EditorWasFirst : boolean;
262
EditorWindow:=FirstEditorWindow;
263
{ Leave the editor first, but only if there was already an WatchesWindow }
264
EditorWasFirst:=(PWindow(Desktop^.First)=PWindow(EditorWindow)) and
265
assigned(WatchesWindow);
266
If assigned(EditorWindow) then
267
S:={LowerCaseStr(}EditorWindow^.Editor^.GetCurrentWord
270
P:=New(PWatch,Init(S));
271
if ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
273
WatchesCollection^.Insert(P);
274
WatchesCollection^.Update;
276
if EditorWasFirst then
277
EditorWindow^.MakeFirst;
285
$Log: fpmdebug.inc,v $
286
Revision 1.10 2005/04/04 03:59:13 marco
287
* fix for 3194: Use mouse to exit output screen
289
Revision 1.9 2005/02/14 17:13:18 peter
292
Revision 1.8 2005/01/08 11:43:18 florian
295
Revision 1.7 2005/01/07 21:52:23 florian
296
* proper stepping in disassembler window now possible
297
+ disassembler window to menu added