home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!spillman!tye
- From: tye@spillman.uucp (E. Tye McQueen)
- Subject: Re: Debugging with 2 terminals. HELP!!!!!
- Message-ID: <1993Jan10.060451.19694@spillman.uucp>
- Date: Sun, 10 Jan 1993 06:04:51 GMT
- Distribution: usa
- References: <1993Jan8.213710.4079@netcom.com>
- Organization: Spillman Data Systems
- Lines: 36
-
- herring@netcom.com (John Herring) writes:
- )Does anyone know of a debugger that will allow me to run the program on
- )one terminal and debug using the debugger in another terminal?
-
- Well, you say "terminal" so I'll assume you aren't talking about
- MS-DOG. So I'll just assume you want to do this on Unix (because
- otherwise I don't have an answer for you).
-
- Take your favorite debugger (ie. probably the only one available),
- say sdb, and start it up on the terminal you want to debug from.
- Then tell the debugger to start the program with input and output
- (ie. stdin, stdout, and stderr) directed to the device (port)
- connected to the terminal that you want the program to "run" on.
-
- Actually, the debugger probably won't let you redirect stderr
- but luckilly the debugger probably doesn't use stderr so you can
- do something like:
-
- $ sdb program 2>/dev/ttya9
- *r arg1 </dev/ttya9 >/dev/ttya9
-
- This is assuming that you aren't using the C shell. If you are
- using the C shell, you can do it too but it is a bit of a pain
- (I'll let you figure it out).
-
- If you have dbx, use "run" instead of "r".
-
- Don't bother using CodView unless you debug from the console.
-
- gdb passes the arguments to your shell so you can redirect
- stderr with it.
-
- tye@spillman.com Tye McQueen, E.
- ----------------------------------------------------------
- Nothing is obvious unless you are overlooking something.
- ----------------------------------------------------------
-