🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #7019

Debugger for C

#7019
From: gnu
Date: Mon, 18 Mar 1991 17:28
26 lines
2023 bytes
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.
Technical Details
Message-ID: <1924@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: gnu@toad.com
Newsgroups: comp.sys.sun
Subject: Debugger for C
Keywords: Software
Message-ID: <1924@brchh104.bnr.ca>
Date: 18 Mar 91 17:28:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sun-Spots
Lines: 26
Approved: Sun-Spots@rice.edu
X-Original-Date: Mon, 04 Mar 91 02:31:47 -0800
X-Refs:  Original: v10n27
X-Sun-Spots-Digest: Volume 10, Issue 53, message 11
X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu