fpmdebug.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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('Sorry, user screen not available.',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. end
  118. else
  119. dispose(P,Done);
  120. end;
  121. {$endif NODEBUG}
  122. {
  123. $Log$
  124. Revision 1.10 2000-01-08 18:26:20 florian
  125. + added a register window, doesn't work yet
  126. Revision 1.9 1999/09/22 16:18:19 pierre
  127. + TIDEApp.DoCloseUserScreenWindow
  128. Revision 1.8 1999/09/09 14:20:05 pierre
  129. + Stack Window
  130. Revision 1.7 1999/07/28 23:11:19 peter
  131. * fixes from gabor
  132. Revision 1.6 1999/07/10 01:24:19 pierre
  133. + First implementation of watches window
  134. Revision 1.5 1999/06/30 23:58:17 pierre
  135. + BreakpointsList Window implemented
  136. with Edit/New/Delete functions
  137. + Individual breakpoint dialog with support for all types
  138. ignorecount and conditions
  139. (commands are not yet implemented, don't know if this wolud be useful)
  140. awatch and rwatch have problems because GDB does not annotate them
  141. I fixed v4.16 for this
  142. Revision 1.4 1999/06/25 00:36:51 pierre
  143. + missing Debug menu added (not implemented yet)
  144. Revision 1.3 1999/02/02 16:41:40 peter
  145. + automatic .pas/.pp adding by opening of file
  146. * better debuggerscreen changes
  147. Revision 1.2 1999/01/21 11:54:16 peter
  148. + tools menu
  149. + speedsearch in symbolbrowser
  150. * working run command
  151. Revision 1.1 1998/12/28 15:47:47 peter
  152. + Added user screen support, display & window
  153. + Implemented Editor,Mouse Options dialog
  154. + Added location of .INI and .CFG file
  155. + Option (INI) file managment implemented (see bottom of Options Menu)
  156. + Switches updated
  157. + Run program
  158. }