testgdb.pp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.2 2000-07-13 11:33:16 michael
  55. + removed logs
  56. }