Mail Archives: djgpp/2004/07/24/08:11:28
> 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 <main+0>
> 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.
> <break>
BAD IDEA.
- Raw text -