Re: How to debug program

Search this archive.

From: Michal Moskal (malekith@pld.org.pl)
Date: Wed 25 Apr 2001 - 15:31:30 IDT


On Mon, Apr 23, 2001 at 07:18:00PM -0500, Mochinushi Shingo wrote:
>     Second, I redirected input and output devices for debugger
> program to /dev/ttyS0 which is serial terminal.
> For example:
> 
> [root@kiev45 demos]$ cat /dev/ttyS0 | gdb foo > /dev/ttyS0
> 
>     After debugging, I send 'quit' command to the debugger
> from serial terminal, and terminated 'cat /dev/ttyS0' process
> by sending a TERM signal from console.  Then a command prompt
> returned to console!

You may also try running program on console, while logging in from 
terminal (also from network though telnet/ssh). You simply make your
program sleep 10 seconds or so on startup (maybe 
if (getenv("GDB_SLEEP")!=NULL)sleep(10) or sth), and use attach gdb
command. This has the advantage that you can use non-serial terminal
but some other host in the network.

-- 
: Michal ``,/\/\,       '' Moskal    | |            : GCS {C,UL}++++$
:          |    |alekith      @    |)|(| . org . pl : {E--, W, w-,M}-
:                                  |                : {b,e>+}++ !tv h
: Current project:  http://aleph-0.dhs.org/ywindow/ : PLD Team member

------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST