[comp.lang.c] dbx tosses its cookies with "print"

tale@pawl.rpi.edu (David C Lawrence) (06/06/89)

Sun 3, SunOS 4.0.1

I'm not sure if this is the best place for this, but at the moment I
can't think of a better one.

dbx dumps core when trying to combine a function call with a pointer
into a struct with the "print" command.

Repeat by:
Say I am debugging some network code which has made all of the
necessary includes.
(dbx) print gethostbyname("pawl.rpi.edu")
gethostbyname("pawl.rpi.edu")=159952
(dbx) print gethostbyname("pawl.rpi.edu")->h_name
Segmentation fault (core dumped)
Exit 139

Okay, so maybe I'm using the tool wrong.  However, it is "legal" C
syntax and works in C programmes.  I have basically been able to use
print to print out the return value of anything I wanted and the
manual page does say:

     print expression [ , expression ] ...
          Print the value of each expression, which  may  involve
          function  calls.  Program execution halts when a break-
          point is reached, and dbx resumes.

Well, it involved a function call and it puked.  Oh well.  (I wonder
whether it dumped out of sheer frustration from the supposed
obviousness of printing the result of gethostbyname()->h_name :-)

Is this a dbx bug?  A documentation bug?  An isolated example of why I
shouldn't debug when I am oxygen deprived?

Dave
--
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))