Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: sean%fiamass.ie@pucc.princeton.edu (Sean Mc grath) Newsgroups: comp.sys.sun Subject: Trouble with dbx on a SPARC Keywords: Software Message-ID: <1404@brchh104.bnr.ca> Date: 23 Jan 91 10:36:34 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 39 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 10, Issue 27, message 14 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu 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@fiamass.ie) 12 Clarinda Park North Dun Laoghaire Co. Dublin