From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,ce37c95571e5f88 X-Google-Attributes: gid1164f8,public From: hobbs@steven.zko.dec.com (Steven Hobbs) Subject: Re: Is ladebug sane?! Date: 1998/01/29 Message-ID: <6aq5c9$7in@usenet.pa.dec.com>#1/1 X-Deja-AN: 320503937 References: <34C4B69B.6E1AF936@cgocable.net> <34CDFF21.41C6@zko.dec.com> <34CF46A9.E1FE002B@cgocable.net> Reply-To: hobbs@steven.zko.dec.com (Steven Hobbs) Distribution: world Organization: Digital Equipment Corporation Newsgroups: comp.sys.dec In article <34CF46A9.E1FE002B@cgocable.net>, Marc Lepage writes: .. [Discussion that includes DEC ladebug printing a "short" parameter as having value 1857749023, which clearly would not fit into a 2 byte "short".] .. >But I'm still curious... what are the restrictions on the upper bytes >when a short is placed on the stack? > The restrictions are described in the Digital Unix document entitled "Calling Standard for Alpha Systems", Part Number AA-PY8AC-TE. Section 4.1.5 is entitled "Unused Bits in Passed Data" and this section requires that a "short" parameter, passed in either a register or memory, must be extended to have 64 valid data bits. The code generated by the compilers assume that this Calling Standard is obeyed. Software which does not follow the Calling Standard may produce undefined results when it is linked with code that assumes the Calling Standard is followed. When the debugger printed the 1857749023 as the value of a "short" variable, it was the result of a bug caused by the third party code not following the Calling Standard. Fix this bug and the code will run better. If ladebug only printed the bottom 2 bytes of a "short" register then this particular bug would be much more difficult to find. (On the other hand, an useful extension to ladebug would be the addition of a warning message everytime ladebug accessed a user varible the contained an out-of-range value.)