ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/03/01:17:38

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DOS/Windows Pointer Corruption
Date: Wed, 03 Apr 2002 09:07:10 +0300
Lines: 34
Message-ID: <3CAA9C0E.24631B8C@is.elta.co.il>
References: <3CAA5C53 DOT 6020805 AT vif DOT com>
Mime-Version: 1.0
X-Trace: fu-berlin.de 1017814284 29046731 (16 [61365])
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sahab Yazdani wrote:
> okay, first off I know that if my program is working fine in Windows but
> not in DOS it usually means that there are pointer bugs in my program,
> BUT, i have initialized a VESA2.0 screen (which returns a pointer to RAM
> that acts as the primary draw surface) which I am %110 sure that the
> pointer is valid (cuz after all, i can draw on it in Windows and
> actually see the results) and then I try to clear it to black via this call:
> memset( memPtr, 0, width*height*bitDepth>>3 );
> now on windows this works fine, but on plain DOS it chokes on this exact
> line (via symify).

Doesn't the VESA initialization function returns a pointer in conventional
memory?  If so, you cannot use memset with it, unless you enable near
pointers and add __djgpp_conventional_base to the pointer VESA returns.

Also, what size is the memory region set up by the VESA function, and what
is the value of width*height*bitDepth?

> PS.  why doesn't symify give line numbers on a traceback anymore??

Didn't you just say that you were able to find the offending line via
symify?  How did you do that if it doesn't show line numbers?

> it
> still gives function names (although mangled up cuz of C++) and
> filenames, but the line number is always 0 now.  i guess it has
> something to do with my upgrading to GCC 3.0.3?

No, symify works just fine with GCC 3.0.3 (and 3.0.4), I use it all the
time.  Does the problem happens in C programs as well, or only C++
programs?  Can you show a simple program on which symify doesn't work?

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019