* Is ladebug sane?!
@ 1998-01-20 5:00 Marc Lepage
1998-01-27 5:00 ` John Hascall
1998-01-27 5:00 ` Jeff Diewald
0 siblings, 2 replies; 5+ messages in thread
From: Marc Lepage @ 1998-01-20 5:00 UTC (permalink / raw)
Perhaps someone can explain this to me? nCount is the short parameter.
(ladebug) next
stopped at [void ALocalFile::WriteBlock(VARIANT*, short):899
0x6e1e53e4]
899 int nCount2 = nCount;
(ladebug) print nCount
31
(ladebug) print sizeof(nCount)
2
(ladebug) next
stopped at [void ALocalFile::WriteBlock(VARIANT*, short):900
0x6e1e53e8]
900 m_Stream->write((char *)pVar,nCount2);
(ladebug) print nCount2
1857749023
--
SEGV
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is ladebug sane?!
1998-01-20 5:00 Is ladebug sane?! Marc Lepage
@ 1998-01-27 5:00 ` John Hascall
1998-01-27 5:00 ` Jeff Diewald
1 sibling, 0 replies; 5+ messages in thread
From: John Hascall @ 1998-01-27 5:00 UTC (permalink / raw)
Marc Lepage <mlepage@cgocable.net> wrote:
}Perhaps someone can explain this to me? nCount is the short parameter.
}(ladebug) next
}stopped at [void ALocalFile::WriteBlock(VARIANT*, short):899 0x6e1e53e4]
} 899 int nCount2 = nCount;
}(ladebug) print nCount
}31
}(ladebug) print sizeof(nCount)
}2
}(ladebug) next
}stopped at [void ALocalFile::WriteBlock(VARIANT*, short):900 0x6e1e53e8]
} 900 m_Stream->write((char *)pVar,nCount2);
}(ladebug) print nCount2
}1857749023
Note. 1857749023 is 0x6EBB001F
31 is 0x0000001F
Either:
a) your program compiled wrong (there really is crap in
the top half of 'nCount2'
b) ladebug is confused.
I should think inserting an fprintf/cout/... as line 900
should tell you which it is.
John
--
John Hascall, Software Engr. Shut up, be happy. The conveniences you
ISU Computation Center demanded are now mandatory. -Jello Biafra
mailto:john@iastate.edu
http://www.cc.iastate.edu/staff/systems/john/welcome.html <-- the usual crud
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is ladebug sane?!
1998-01-20 5:00 Is ladebug sane?! Marc Lepage
1998-01-27 5:00 ` John Hascall
@ 1998-01-27 5:00 ` Jeff Diewald
1998-01-28 5:00 ` Marc Lepage
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Diewald @ 1998-01-27 5:00 UTC (permalink / raw)
Marc Lepage wrote:
>
> Perhaps someone can explain this to me? nCount is the short parameter.
>
> (ladebug) next
> stopped at [void ALocalFile::WriteBlock(VARIANT*, short):899
> 0x6e1e53e4]
> 899 int nCount2 = nCount;
> (ladebug) print nCount
> 31
> (ladebug) print sizeof(nCount)
> 2
> (ladebug) next
> stopped at [void ALocalFile::WriteBlock(VARIANT*, short):900
> 0x6e1e53e8]
> 900 m_Stream->write((char *)pVar,nCount2);
> (ladebug) print nCount2
> 1857749023
>
> --
> SEGV
Well, it looks like a bug to me, but without additional information,
we can't tell you if it's something we've already fixed. It would
also help if you could tell us which version of Ladebug, Digital
Unix, and compiler you're using. (FYI - Ladebug version 4.0-44 is
the latest and greatest.) The SEGV traceback information is also
of interest. Can you reproduce the problem in a smaller example you
can send to us?
We've done a lot of work to improve our quality of late. Your fix
might be as easy as an upgrade of Ladebug.
-----------------------------------------------------------------------
Jeff Diewald EASYNET: VIRRUS::DIEWALD
Ladebug group INTERNET: diewald@zko.dec.com
Digital Equipment Corp.
Note: I don't read every article in this group. If you have debugger
questions, I may be able to get you an answer. You're much more likely
to get an answer if you put "Ladebug" somewhere in your subject line.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is ladebug sane?!
1998-01-27 5:00 ` Jeff Diewald
@ 1998-01-28 5:00 ` Marc Lepage
1998-01-29 5:00 ` Steven Hobbs
0 siblings, 1 reply; 5+ messages in thread
From: Marc Lepage @ 1998-01-28 5:00 UTC (permalink / raw)
Jeff Diewald wrote:
>
> Marc Lepage wrote:
> >
> > Perhaps someone can explain this to me? nCount is the short parameter.
> >
> > (ladebug) next
> > stopped at [void ALocalFile::WriteBlock(VARIANT*, short):899
> > 0x6e1e53e4]
> > 899 int nCount2 = nCount;
> > (ladebug) print nCount
> > 31
> > (ladebug) print sizeof(nCount)
> > 2
> > (ladebug) next
> > stopped at [void ALocalFile::WriteBlock(VARIANT*, short):900
> > 0x6e1e53e8]
> > 900 m_Stream->write((char *)pVar,nCount2);
> > (ladebug) print nCount2
> > 1857749023
> >
> > --
> > SEGV
>
> Well, it looks like a bug to me, but without additional information,
> we can't tell you if it's something we've already fixed. It would
> also help if you could tell us which version of Ladebug, Digital
> Unix, and compiler you're using. (FYI - Ladebug version 4.0-44 is
> the latest and greatest.) The SEGV traceback information is also
> of interest. Can you reproduce the problem in a smaller example you
> can send to us?
>
> We've done a lot of work to improve our quality of late. Your fix
> might be as easy as an upgrade of Ladebug.
Thanks all. As everyone has pointed out, the lower bytes are correct. I
know that, I was more concerned about the upper incorrect bytes. :-)
Printfs and couts yield the incorrect result, unless I do a printf with
"%h", since the printf function then only really does look at the two
bytes.
Assigning to a temporary short and then to an int works. The problem, as
it turned out, is that the first short came in through a parameter, and
that parameter was being marshalled by some third-party software.
I suppose I phrased my subject wrong. Ladebug is correct, but I wondered
why then the compiler was producing wrong results. When assigning a
short, why was it looking at the other bytes? I guess it assumes it is
packed into an int for the parameter. Anyhow, the third party has fixed
the code and now it works.
But I'm still curious... what are the restrictions on the upper bytes
when a short is placed on the stack?
PS: The SEGV is my alias. :-)
--
SEGV
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is ladebug sane?!
1998-01-28 5:00 ` Marc Lepage
@ 1998-01-29 5:00 ` Steven Hobbs
0 siblings, 0 replies; 5+ messages in thread
From: Steven Hobbs @ 1998-01-29 5:00 UTC (permalink / raw)
In article <34CF46A9.E1FE002B@cgocable.net>, Marc Lepage
<mlepage@cgocable.net> 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.)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1998-01-29 5:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-01-20 5:00 Is ladebug sane?! Marc Lepage
1998-01-27 5:00 ` John Hascall
1998-01-27 5:00 ` Jeff Diewald
1998-01-28 5:00 ` Marc Lepage
1998-01-29 5:00 ` Steven Hobbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox