From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: void movedata (...) source (coding a GFX lib) Date: Fri, 07 Jan 2000 13:40:14 +0200 Organization: NetVision Israel Lines: 30 Message-ID: <3875D09E.71EBEA40@is.elta.co.il> References: <3871C765 DOT 829384D4 AT softhome DOT net> NNTP-Posting-Host: ras1-p62.rvt.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.netvision.net.il 947245297 29791 62.0.172.64 (7 Jan 2000 11:41:37 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 7 Jan 2000 11:41:37 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,ru,hebrew To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Tom Alsberg wrote: > > * It crashes every time when running under pure DOS (not RHIDE). There, > when I do a SYMIFY to it, I get the same traceback info. Please always post the full, SYMIFY'ed traceback, together with the registers' dump, when you post such reports. People who are used to look at crash messages can spot some crucial hints there, which will help you solve the problem much more efficiently. > * It never crashed when running under GDB (GNU Debugger). This is often a sign of uninitialized memory, or of accessing buffers beyond their limits. > 2. Where can I find the source for the function movedata (...)? The source of `movedata' is in the file src/libc/pc_hw/mem/md.S. You will see that it calls __dj_movedata, whose source is in src/libc/pc_hw/mem/djmd.S. These two functions are written in assembly. I'd suggest to disassembly __dj_movedata, and see what instruction is at ___dj_movedata+33. You will then know which register holds an invalid value that causes the crash. Next, you need to follow the call sequence up, using the traceback and disassembly as your guides, and find out what variable in your function vidBMP::blit2vidmem winds up in that register. This should provide enough info to unlock the bug. Since you are calling `dosmemput', the primary suspects are each one of its 3 arguments. Examine the code that computes them and look for possible problems.