Mail Archives: djgpp/2004/07/20/15:12:03
> From: sterten AT aol DOT com (Sterten)
> Newsgroups: comp.os.msdos.djgpp
> Date: 20 Jul 2004 09:03:54 GMT
>
> thanks for the bfdsymify hint, but with -g
> switch I get no error at all.
Please show the compilation command(s) you used in each case.
> bfdsymify refers to crt1.c , but I couldn't find such a file
> on my computer.
That's okay, crt1.c is the startup module for which you have no
source (unless you download the library sources, djlsr203.zip).
Don't worry about that.
What _would_ be useful (and that's why I suggested bfdsymify) is the
translation of the hex EIP value in "0x00001cdf main+1631" into a
source line number in qser1.c.
> When compiled with -g , or when including the printf("");
> (which basically is a no-operation command !)
printf("") is certainly _not_ a no-op! The program actually calls the
function and passes it an empty string, so the program code is
altered.
> then the program works correctly.
If the program compiled with -g does not crash (but please still show
us the compilation command you used to do that), then please run the
program under GDB, like this:
C:\DJGPP>gdb qser1.exe
(gdb) run 20 1 7
and when it crashes, type "disassemble" and post here the results.
(You will have to download and install GDB, if you don't have it
already.)
> can there be any disadvantage with -g ?
It makes the executable MUCH larger.
> C:\DJGPP>queensy4 20 1 7
>
> 480 solutions
> General Protection Fault at eip=8; flags=3046
> eax=00a30000 ebx=000000a7 ecx=00000000 edx=0001cc10 esi=00001000 edi=10000000
> ebp=00000000 esp=00000400 cs=87 ds=0 es=8f fs=0 gs=0 ss=8f error=0000
This message comes from CWSDPMI, which means you've seriously
thrashed the system.
> ---------------------------------------------
> C:\DJGPP>gcc qser1.c -O2 -o qser1.exe
What's the difference between qser1.exe and queensy4.exe?
> C:\DJGPP>gcc qser1.c -g -O2 -o qser1.exe
>
> C:\DJGPP>qser1 16 2 3
>
> 0 solutions
Is "0 solution" the correct answer for this input?
Also, please try -gstabs+ instead of -g, and see if the program
crashes then. If it does, bfdsymify will show the line number.
- Raw text -