Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Marc Lepage <mlepage@cgocable.net>
Subject: Re: Is ladebug sane?!
Date: 1998/01/28	[thread overview]
Message-ID: <34CF46A9.E1FE002B@cgocable.net> (raw)
In-Reply-To: 34CDFF21.41C6@zko.dec.com


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



  reply	other threads:[~1998-01-28  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-20  5:00 Is ladebug sane?! Marc Lepage
1998-01-27  5:00 ` Jeff Diewald
1998-01-28  5:00   ` Marc Lepage [this message]
1998-01-29  5:00     ` Steven Hobbs
1998-01-27  5:00 ` John Hascall
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox