[comp.unix.questions] SDB help

RSILVERMAN@eagle.wesleyan.edu (Richard Silverman) (06/06/89)

I am trying to use sdb under System V.  I would like to patch the value of
a global variable.  I have compiled & linked the image with the -g option.
I get the following:

% sdb -w imagefile
No core image
*:variable!1
No process and/or file
* ...

If I oblige it by starting a process running the image, then the command
works, but of course it only sets the variable in memory; I want to patch
the image file.  The manual says that "if a process is running, all addresses
refer to memory; otherwise, they are file offsets" (or something like that).
What's more puzzling is that I made it work once!  But I haven't the foggiest
notion what did it, and it doesn't work now.  Can anyone enlighten me?  Thanks,

                                                Richard Silverman

arpa:	rsilverman@eagle.wesleyan.edu           Computing Center
bitnet:	rsilverman@wesleyan                     Wesleyan University
CIS:	[72727,453]                             Middletown, CT 06457

RSILVERMAN@eagle.wesleyan.edu (Richard Silverman) (06/07/89)

(message to Bob Nicholls; I could not send this directly)

Bob,
	Many thanks for clearing that up for me!  Of course, the mystifying
"only time it worked" was when I had changed it by hand -- by initializing
it in the source and recompiling.  I am not patching because I don't have
the source; it's just a quick way of setting the debug flag in a yacc-produced
parser without having to recompile it or alter the code to have a command-line
switch.  Thanks again,

                                                Richard Silverman

arpa:	rsilverman@eagle.wesleyan.edu           Computing Center
bitnet:	rsilverman@wesleyan                     Wesleyan University
CIS:	[72727,453]                             Middletown, CT 06457

emuleomo@yes.rutgers.edu (Emuleomo) (06/09/89)

This may not be a strict followup to the sdb patch problem, but I am interested
in knowing if there are any good _debuggers_ out there for SysV?
I have used one called "dbx" and it blows "sdb" AWAY!

Please try sending me mail on any nice ones you have come across.

Also, can any debugger out there debug a CHILD process that is forked and 
execed?

ThanX

--Emuleomo O.O.  (Email ==>  emuleomo@yes.rutgers.edu)