One last tidbit: if you want to use gdb with the utelnetd or sshd terminals to just get a simple stack trace at a crash, you can redirect the commands to gdb rather than trying to type them at the prompt (which doesn't work). For example, using a
here document (i.e. "<<"):
Code:
gdb <program-name> <<EOD
run [arguments-to-program]
where
quit
EOD
will run the program in the debugger, and then run the "where" command and "quit" at the crash point.
You can also copy the gdb commands into a file, say
gdb.txt, and then redirect those to gdb through standard input:
Code:
gdb <program-name> <gdb.txt
The latter is handy if you are re-running the program many times while testing.