Debugger for C

gnu at toad.com gnu at toad.com
Tue Mar 19 03:28:00 AEST 1991


The GNU Debugger, gdb, can run the debugger in one window and the program
in another.  I have run it in this mode, by finding out the pty name of a
shell window with the "tty" shell command and then doing something like
"sleep 999999" in that window.  Then, in another window, I run gdb on the
program, specify that tty name to the gdb "tty" command, and type "run".

GDB can also do the "attach" trick described by an earlier poster, where
you start the program in one window and "attach" a GDB from another window
to it by saying "attach PID".

gdb-3.5 is the latest released version, available in all the standard
spots, like uunet and prep.ai.mit.edu.  To compile this on a Sun you have
to change the Makefile by removing the definition of TARGET_ARCH.  It was
there because Sun Make used it to control cross-compilation, forcing the
current architecture to be passed to the compiler by default.  This broke
when using gcc, because gcc did not know how to parse a switch like -sun3.
So TARGET_ARCH= (nothing) was added to the makefile to null out this
feature.  Well, in the next release Sun's infinite wisdom changed this
"feature", so now setting TARGET_ARCH to nothing produces a "-target "
switch to the compiler, followed by nothing, which not only breaks GCC but
also breaks under the sun unsupported C compiler.  Just remove the line
that says:

	TARGET_ARCH=

from Makefile.dist and rerun config.gdb to rebuild Makefile, then make it.



More information about the Comp.sys.sun mailing list