home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19489 < prev    next >
Encoding:
Text File  |  1993-01-10  |  1.8 KB  |  48 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!spillman!tye
  3. From: tye@spillman.uucp (E. Tye McQueen)
  4. Subject: Re: Debugging with 2 terminals. HELP!!!!!
  5. Message-ID: <1993Jan10.060451.19694@spillman.uucp>
  6. Date: Sun, 10 Jan 1993 06:04:51 GMT
  7. Distribution: usa
  8. References: <1993Jan8.213710.4079@netcom.com>
  9. Organization: Spillman Data Systems
  10. Lines: 36
  11.  
  12. herring@netcom.com (John Herring) writes:
  13. )Does anyone know of a debugger that will allow me to run the program on
  14. )one terminal and debug using the debugger in another terminal?
  15.  
  16. Well, you say "terminal" so I'll assume you aren't talking about
  17. MS-DOG.  So I'll just assume you want to do this on Unix (because
  18. otherwise I don't have an answer for you).
  19.  
  20. Take your favorite debugger (ie. probably the only one available),
  21. say sdb, and start it up on the terminal you want to debug from.
  22. Then tell the debugger to start the program with input and output
  23. (ie. stdin, stdout, and stderr) directed to the device (port)
  24. connected to the terminal that you want the program to "run" on.
  25.  
  26. Actually, the debugger probably won't let you redirect stderr
  27. but luckilly the debugger probably doesn't use stderr so you can
  28. do something like:
  29.  
  30.     $ sdb program 2>/dev/ttya9
  31.     *r arg1 </dev/ttya9 >/dev/ttya9
  32.  
  33. This is assuming that you aren't using the C shell.  If you are
  34. using the C shell, you can do it too but it is a bit of a pain
  35. (I'll let you figure it out).
  36.  
  37. If you have dbx, use "run" instead of "r".
  38.  
  39. Don't bother using CodView unless you debug from the console.
  40.  
  41. gdb passes the arguments to your shell so you can redirect
  42. stderr with it.
  43.  
  44.  tye@spillman.com                         Tye McQueen, E.
  45. ----------------------------------------------------------
  46.  Nothing is obvious unless you are overlooking something. 
  47. ----------------------------------------------------------
  48.