Trouble with dbx on a SPARC

Sean Mc grath sean%fiamass.ie at pucc.princeton.edu
Wed Jan 23 21:36:34 AEST 1991


I an having trouble with dbx on a SPARC 4-65 running SUN OS 4.1.  We use
16 bit unsigned integer datatype called UINT16.  We #define it to suit the
machine we are running on.  Unfortunately, when UINT16s are passed as
paramaters on the stack dbx gets confused.  Here is a demo of the problem:

------ CODE starts here --------
#define UINT16 unsigned short
fred(a,b)
UINT16 a,b;
{ a = b; }

main()
{
fred (15,78);
}
------ CODE ends here ---------
I compile this with debugging on using
        cc -g test.c
I run up dbx :-
        dbx a.out
I set a breakpoint in fred
        stop in fred
Run it
        run
It stops in fred. So I print a
        print a
Answer 0 - incorrect
I tried
        print (UINT)a
Answer 0 - incorrect

By the way, the 386i we have gets it right.  I think it must be to do with
dbx looking at the wrong 16 bits of the 32 bit integer that is stuffed on
the stack for both a and b.  Any ideas???

Sean Mc Grath (sean at fiamass.ie)
12 Clarinda Park North
Dun Laoghaire
Co. Dublin



More information about the Comp.sys.sun mailing list