calling procedures from dbx

baer at Rand-Unix.ARPA baer at Rand-Unix.ARPA
Tue Mar 27 04:33:00 AEST 1984


From:  Larry Baer <baer at Rand-Unix.ARPA>

I am moving my C programming effort from our 4.1bsd system to our
4.2bsd system; therefore I will be using dbx instead of sdb.  I
have come to rely heavily on my own data-structure printing
routines while debugging under sdb.  I cannot figure out how to
call these procedures successfully under dbx.

Often dbx complains that I am giving it arguments of incorrect
type when trying to call a procedure (I claim I am not), and on
those occasions when it does accept my arguments to a procedure,
it invariably dies with the message "program terminated by signal
1".  Once this has happened the debugger no longer pays any
attention to breakpoints that have been set, and my program
terminates "unexpectedly" when I give the "run" command.

This happens even with a procedure that tries to print its single
argument of type int.

Appended to this message are a simple test program, and a script
from a dbx session over said program illustrating my problem.
Can anyone tell me what magic to invoke to get this to work
correctly?

Helpful or informative responses will be summarized & posted to
this newsgroup unless

	(1) the newsgroup was copied in the response
    OR  (2) the sender asks that his response not be posted.

Thanks,

Larry Baer <baer at rand-unix.ARPA>


-----------------------------------------
#include <stdio.h>

typedef struct SimpleStruct {
    char simple_char;
    int  simple_int;
} SimpleObject;

typedef SimpleObject *SimpleObjectPtr;

ShowSimple(s)
SimpleObject s;
{
    fprintf(stderr, "SimpleObject = (char: %c, int: %d)\n",
	    s.simple_char, s.simple_int);
}

ShowSimplePtr(sp)
SimpleObjectPtr sp;
{

***Sender closed connection***

=== Network Mail from host brl-tgr on Mon Mar 26 11:17:20  ===



More information about the Comp.unix mailing list