fpmdebug.inc 4.4 KB

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