2
This file is part of the Free Pascal Integrated Development Environment
3
Copyright (c) 1998 by Berczi Gabor
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
16
{$ifdef SUPPORT_REMOTE}
17
function GetRemoteString : string;
21
St:=RemoteSendCommand;
22
If RemoteConfig<>'' then
23
ReplaceStrI(St,'$CONFIG','-F '+RemoteConfig)
25
ReplaceStrI(St,'$CONFIG','');
26
If RemoteIdent<>'' then
27
ReplaceStrI(St,'$IDENT','-i '+RemoteIdent)
29
ReplaceStrI(St,'$IDENT','');
30
ReplaceStrI(St,'$LOCALFILE',GDBFileName(ExeFile));
31
ReplaceStrI(St,'$REMOTEDIR',RemoteDir);
32
ReplaceStrI(St,'$REMOTEMACHINE',RemoteMachine);
36
procedure TIDEApp.TransferRemote;
38
S,SendCommand : string;
41
SendCommand:=GetRemoteString;
42
if SendCommand<>'' then
45
if LocateExeFile(s) then
46
Executed:=DoExecute(s,SendCommand,'','','',exNormal)
48
Executed:=DoExecute('scp',SendCommand,'','','',exNormal);
51
if (DosError<>0) or (DosExitCode<>0) then
52
ErrorBox(#3'Execution of'#13#3+s+' '+SendCommand+#13#3+
53
'returned ('+inttostr(DosError)+','+inttostr(DosExitCode)+')',nil);
56
ErrorBox(#3'Unable to execute'#13#3+s+' '+SendCommand,nil);
60
ErrorBox(#3'Unable to transfer executable',nil);
62
{$endif SUPPORT_REMOTE}
64
procedure TIDEApp.DoUserScreenWindow;
66
if UserScreenWindow=nil then
68
New(UserScreenWindow, Init(UserScreen, SearchFreeWindowNo));
69
Desktop^.Insert(UserScreenWindow);
71
UserScreenWindow^.MakeFirst;
74
procedure TIDEApp.DoCloseUserScreenWindow;
76
if Assigned(UserScreenWindow) then
77
Message(UserScreenWindow,evCommand,cmClose,nil);
80
procedure TIDEApp.DoUserScreen;
85
if UserScreen=nil then
87
ErrorBox(msg_userscreennotavailable,nil);
94
{ closing the user screen on mouse events makes copy paste impossible }
98
Drivers.GetKeyEvent(Event);
99
until Event.What=evKeyboard;
101
if not UserScreen^.CanScroll then
104
case Event.keycode of
105
kbPgUp : UserScreen^.Scroll(-20);
106
kbPgDn : UserScreen^.Scroll(20);
107
kbUp : UserScreen^.Scroll(-1);
108
kbDown : UserScreen^.Scroll(1);
109
kbHome : UserScreen^.Scroll(-1024);
110
kbEnd : UserScreen^.Scroll(+1024);
116
until Event.what=evKeyboard;
117
while (Keyboard.PollKeyEvent<>0) do
118
Keyboard.GetKeyEvent;
124
procedure TIDEApp.DoShowCallStack;
129
If not assigned(StackWindow) then
132
StackWindow^.MakeFirst;
137
procedure TIDEApp.DoShowDisassembly;
142
If not assigned(DisassemblyWindow) then
143
InitDisassemblyWindow
145
DisassemblyWindow^.MakeFirst;
146
DisassemblyWindow^.LoadFunction('');
151
procedure TIDEApp.DoShowRegisters;
156
If not assigned(RegistersWindow) then
159
RegistersWindow^.MakeFirst;
163
procedure TIDEApp.DoShowFPU;
168
If not assigned(FPUWindow) then
171
FPUWindow^.MakeFirst;
176
procedure TIDEApp.DoShowVector;
181
If not assigned(VectorWindow) then
184
VectorWindow^.MakeFirst;
188
procedure TIDEApp.DoShowBreakpointList;
193
If assigned(BreakpointsWindow) then
195
BreakpointsWindow^.Update;
196
BreakpointsWindow^.Show;
197
BreakpointsWindow^.MakeFirst;
201
New(BreakpointsWindow,Init);
202
Desktop^.Insert(BreakpointsWindow);
207
procedure TIDEApp.DoShowWatches;
212
If assigned(WatchesWindow) then
214
WatchesWindow^.Update;
215
WatchesWindow^.MakeFirst;
219
New(WatchesWindow,Init);
220
Desktop^.Insert(WatchesWindow);
225
procedure TIDEApp.DoAddWatch;
233
EditorWindow : PSourceWindow;
234
EditorWasFirst : boolean;
237
EditorWindow:=FirstEditorWindow;
238
{ Leave the editor first, but only if there was already an WatchesWindow }
239
EditorWasFirst:=(PWindow(Desktop^.First)=PWindow(EditorWindow)) and
240
assigned(WatchesWindow);
241
If assigned(EditorWindow) then
242
S:={LowerCaseStr(}EditorWindow^.Editor^.GetCurrentWord
245
P:=New(PWatch,Init(S));
246
if ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
248
WatchesCollection^.Insert(P);
249
WatchesCollection^.Update;
251
if EditorWasFirst then
252
EditorWindow^.MakeFirst;
260
procedure TIDEapp.do_evaluate;
266
procedure TIDEapp.do_evaluate;
268
var d:Pevaluate_dialog;
272
desktop^.getextent(r);
273
r.b.x:=r.b.x*3 div 4;
276
desktop^.execview(d);