testgdb.pp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Peter Vreman
  4. Small example program to the GDB
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. program testgdb;
  12. uses gdbcon;
  13. var
  14. last,s,parafile : string;
  15. gdb : tgdbcontroller;
  16. begin
  17. gdb.init;
  18. if paramcount=1 then
  19. parafile:=paramstr(1)
  20. else
  21. parafile:='test';
  22. gdb.loadfile(parafile);
  23. Writeln('Welcome to the pascal GDB...');
  24. Writeln('Type "q" to exit...');
  25. last:='';
  26. repeat
  27. write('>');
  28. readln(s);
  29. if (s='a') then
  30. gdb.starttrace
  31. else
  32. if (s='s') then
  33. gdb.tracestep
  34. else
  35. if (s='n') then
  36. gdb.tracenext
  37. else
  38. if (s='q') then
  39. break
  40. else
  41. begin
  42. if s='' then
  43. s:=last;
  44. GDB.Command(s);
  45. GDB.WriteErrorBuf;
  46. GDB.WriteOutputBuf;
  47. last:=s;
  48. end;
  49. until false;
  50. Writeln('End of pascal GDB...');
  51. end.
  52. {
  53. $Log$
  54. Revision 1.1 1999-11-24 23:36:33 peter
  55. * moved to packages dir
  56. Revision 1.1 1999/05/22 13:43:00 peter
  57. * moved
  58. Revision 1.4 1999/01/29 10:32:57 peter
  59. * fixes to compile with the makefile
  60. Revision 1.3 1999/01/22 10:23:51 peter
  61. * small update to get it working with the IDE
  62. }