fpmdebug.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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.DoShowBreakpointList;
  51. begin
  52. {$ifdef NODEBUG}
  53. NoDebugger;
  54. {$else}
  55. If assigned(BreakpointsWindow) then
  56. begin
  57. BreakpointsWindow^.Update;
  58. BreakpointsWindow^.Show;
  59. BreakpointsWindow^.MakeFirst;
  60. end
  61. else
  62. begin
  63. New(BreakpointsWindow,Init);
  64. Desktop^.Insert(BreakpointsWindow);
  65. end;
  66. {$endif NODEBUG}
  67. end;
  68. procedure TIDEApp.DoShowWatches;
  69. begin
  70. {$ifdef NODEBUG}
  71. NoDebugger;
  72. {$else}
  73. If assigned(WatchesWindow) then
  74. begin
  75. WatchesWindow^.Update;
  76. WatchesWindow^.MakeFirst;
  77. end
  78. else
  79. begin
  80. New(WatchesWindow,Init);
  81. Desktop^.Insert(WatchesWindow);
  82. end;
  83. {$endif NODEBUG}
  84. end;
  85. procedure TIDEApp.DoAddWatch;
  86. {$ifdef NODEBUG}
  87. begin
  88. NoDebugger;
  89. end;
  90. {$else}
  91. var
  92. P: PWatch;
  93. EditorWindow : PSourceWindow;
  94. S : string;
  95. begin
  96. EditorWindow:=FirstEditorWindow;
  97. If assigned(EditorWindow) then
  98. S:=LowerCaseStr(EditorWindow^.Editor^.GetCurrentWord)
  99. else
  100. S:='';
  101. P:=New(PWatch,Init(S));
  102. if ExecuteDialog(New(PWatchItemDialog,Init(P)),nil)<>cmCancel then
  103. begin
  104. WatchesCollection^.Insert(P);
  105. WatchesCollection^.Update;
  106. end
  107. else
  108. dispose(P,Done);
  109. end;
  110. {$endif NODEBUG}
  111. {
  112. $Log$
  113. Revision 1.9 1999-09-22 16:18:19 pierre
  114. + TIDEApp.DoCloseUserScreenWindow
  115. Revision 1.8 1999/09/09 14:20:05 pierre
  116. + Stack Window
  117. Revision 1.7 1999/07/28 23:11:19 peter
  118. * fixes from gabor
  119. Revision 1.6 1999/07/10 01:24:19 pierre
  120. + First implementation of watches window
  121. Revision 1.5 1999/06/30 23:58:17 pierre
  122. + BreakpointsList Window implemented
  123. with Edit/New/Delete functions
  124. + Individual breakpoint dialog with support for all types
  125. ignorecount and conditions
  126. (commands are not yet implemented, don't know if this wolud be useful)
  127. awatch and rwatch have problems because GDB does not annotate them
  128. I fixed v4.16 for this
  129. Revision 1.4 1999/06/25 00:36:51 pierre
  130. + missing Debug menu added (not implemented yet)
  131. Revision 1.3 1999/02/02 16:41:40 peter
  132. + automatic .pas/.pp adding by opening of file
  133. * better debuggerscreen changes
  134. Revision 1.2 1999/01/21 11:54:16 peter
  135. + tools menu
  136. + speedsearch in symbolbrowser
  137. * working run command
  138. Revision 1.1 1998/12/28 15:47:47 peter
  139. + Added user screen support, display & window
  140. + Implemented Editor,Mouse Options dialog
  141. + Added location of .INI and .CFG file
  142. + Option (INI) file managment implemented (see bottom of Options Menu)
  143. + Switches updated
  144. + Run program
  145. }