X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sat, 24 Jul 2004 15:09:36 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <1438-Sat24Jul2004150936+0300-eliz@gnu.org> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <20040724072614.19398.00001790@mb-m17.aol.com> (sterten@aol.com) Subject: Re: strange error References: <2914-Sat24Jul2004104537+0300-eliz AT gnu DOT org> <20040724072614 DOT 19398 DOT 00001790 AT mb-m17 DOT aol DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: sterten AT aol DOT com (Sterten) > Newsgroups: comp.os.msdos.djgpp > Date: 24 Jul 2004 11:26:14 GMT > > OK, I understand now that the program starts at 0x1680 > and the error occurred at 0x1cfc Yes. > >> And then, we still don't know the first line, > >> where an incorrect index occurred. > > > >That can be found by compiling the source with switches that produce > >assembly listing (see section 8.20 in the DJGPP FAQ, except that you > >will also need to add the -g switch--this is a mistake in the FAQ). > > ..with -g it will produce non-crashing code then, despite index-overflow The GCC command described in the FAQ is meant to produce an assembly listing interspesed with source lines. Don't worry about the resulting code, we don't need it, just the listing. > >If we find the machine instruction that crashed (the one at address > >0x00001cfc), we will be able to tell the index and its value. > > only the final one, where it crashed Sure; but that's better than what you have now (which is nothing except guesses). > >Bottom line, using the debugger in such cases might need some hard > >work, but it is always the shortest way to the solution, because it > >saves you the need to guess. > > wouldn't a compiler which checks the indices > (I found compaq-C with google) be a shorter solution here ? If the indices are the culprit, yes. But we don't know that, do we? > under DOS: > gdb qser3.exe > file > run 16 1 5 (typed blindly) > disassemble (typed blindly) > > crash, no way to escape, reboot What type of crash? Did you see any messages? did it freeze? what happened? > redir -o file gdb qser3.exe > run 16 1 5 (typed blindly) > disassemble (typed blindly) > quit (typed blindly) > quit (now displayed) Try "yes" at this point. > BAD IDEA.