fpmdebug.inc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Debug menu entries
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. procedure TIDEApp.DoUserScreenWindow;
  13. begin
  14. if UserScreenWindow=nil then
  15. begin
  16. New(UserScreenWindow, Init(UserScreen, SearchFreeWindowNo));
  17. Desktop^.Insert(UserScreenWindow);
  18. end;
  19. UserScreenWindow^.MakeFirst;
  20. end;
  21. procedure TIDEApp.DoCloseUserScreenWindow;
  22. begin
  23. if Assigned(UserScreenWindow) then
  24. Message(UserScreenWindow,evCommand,cmClose,nil);
  25. end;
  26. procedure TIDEApp.DoUserScreen;
  27. begin
  28. if UserScreen=nil then
  29. begin
  30. ErrorBox(msg_userscreennotavailable,nil);
  31. Exit;
  32. end;
  33. ShowUserScreen;
  34. InitKeyBoard;
  35. Keyboard.GetKeyEvent;
  36. while (Keyboard.PollKeyEvent<>0) do
  37. Keyboard.GetKeyEvent;
  38. DoneKeyboard;
  39. ShowIDEScreen;
  40. end;
  41. procedure TIDEApp.DoShowCallStack;
  42. begin
  43. {$ifdef NODEBUG}
  44. NoDebugger;
  45. {$else}
  46. If not assigned(StackWindow) then
  47. InitStackWindow
  48. else
  49. StackWindow^.MakeFirst;
  50. {$endif NODEBUG}
  51. end;
  52. procedure TIDEApp.DoShowRegisters;
  53. begin
  54. {$ifdef NODEBUG}
  55. NoDebugger;
  56. {$else}
  57. If not assigned(RegistersWindow) then
  58. InitRegistersWindow
  59. else
  60. RegistersWindow^.MakeFirst;
  61. {$endif NODEBUG}
  62. end;
  63. procedure TIDEApp.DoShowBreakpointList;
  64. begin
  65. {$ifdef NODEBUG}
  66. NoDebugger;
  67. {$else}
  68. If assigned(BreakpointsWindow) then
  69. begin
  70. BreakpointsWindow^.Update;
  71. BreakpointsWindow^.Show;
  72. BreakpointsWindow^.MakeFirst;
  73. end
  74. else
  75. begin
  76. New(BreakpointsWindow,Init);
  77. Desktop^.Insert(BreakpointsWindow);
  78. end;
  79. {$endif NODEBUG}
  80. end;
  81. procedure TIDEApp.DoShowWatches;
  82. begin
  83. {$ifdef NODEBUG}
  84. NoDebugger;
  85. {$else}
  86. If assigned(WatchesWindow) then
  87. begin
  88. WatchesWindow^.Update;
  89. WatchesWindow^.MakeFirst;
  90. end
  91. else
  92. begin
  93. New(WatchesWindow,Init);
  94. Desktop^.Insert(WatchesWindow);
  95. end;
  96. {$endif NODEBUG}
  97. end;
  98. procedure TIDEApp.DoAddWatch;
  99. {$ifdef NODEBUG}
  100. begin
  101. NoDebugger;
  102. end;
  103. {$else}
  104. var
  105. P: PWatch;
  106. EditorWindow : PSourceWindow;
  107. S : string;
  108. begin
  109. EditorWindow:=FirstEditorWindow;
  110. If assigned(EditorWindow) then
  111. S:=LowerCaseStr(EditorWindow^.Editor^.GetCurrentWord)
  112. else
  113. S:='';
  114. P:=New(PWatch,Init(S));
  115. if ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
  116. begin
  117. WatchesCollection^.Insert(P);
  118. WatchesCollection^.Update;
  119. { If not assigned(WatchesWindow) then
  120. should we only open it the first time ?? PM }
  121. DoShowWatches;
  122. end
  123. else
  124. dispose(P,Done);
  125. end;
  126. {$endif NODEBUG}
  127. {
  128. $Log$
  129. Revision 1.1 2000-07-13 09:48:35 michael
  130. + Initial import
  131. Revision 1.13 2000/05/17 10:17:49 pierre
  132. * Reinit the keyboard in ShowUserScreen
  133. Revision 1.12 2000/05/02 08:42:28 pierre
  134. * new set of Gabor changes: see fixes.txt
  135. Revision 1.11 2000/02/04 00:13:59 pierre
  136. * AddWatch calls DoShowWatches
  137. Revision 1.10 2000/01/08 18:26:20 florian
  138. + added a register window, doesn't work yet
  139. Revision 1.9 1999/09/22 16:18:19 pierre
  140. + TIDEApp.DoCloseUserScreenWindow
  141. Revision 1.8 1999/09/09 14:20:05 pierre
  142. + Stack Window
  143. Revision 1.7 1999/07/28 23:11:19 peter
  144. * fixes from gabor
  145. Revision 1.6 1999/07/10 01:24:19 pierre
  146. + First implementation of watches window
  147. Revision 1.5 1999/06/30 23:58:17 pierre
  148. + BreakpointsList Window implemented
  149. with Edit/New/Delete functions
  150. + Individual breakpoint dialog with support for all types
  151. ignorecount and conditions
  152. (commands are not yet implemented, don't know if this wolud be useful)
  153. awatch and rwatch have problems because GDB does not annotate them
  154. I fixed v4.16 for this
  155. Revision 1.4 1999/06/25 00:36:51 pierre
  156. + missing Debug menu added (not implemented yet)
  157. Revision 1.3 1999/02/02 16:41:40 peter
  158. + automatic .pas/.pp adding by opening of file
  159. * better debuggerscreen changes
  160. Revision 1.2 1999/01/21 11:54:16 peter
  161. + tools menu
  162. + speedsearch in symbolbrowser
  163. * working run command
  164. Revision 1.1 1998/12/28 15:47:47 peter
  165. + Added user screen support, display & window
  166. + Implemented Editor,Mouse Options dialog
  167. + Added location of .INI and .CFG file
  168. + Option (INI) file managment implemented (see bottom of Options Menu)
  169. + Switches updated
  170. + Run program
  171. }