From: Martin Str|mberg Message-Id: <200101231753.SAA21441@father.ludd.luth.se> Subject: Re: Debugging on 386 (Loooooong) In-Reply-To: <2593-Tue23Jan2001193151+0200-eliz@is.elta.co.il> from Eli Zaretskii at "Jan 23, 2001 07:31:51 pm" To: djgpp-workers AT delorie DOT com Date: Tue, 23 Jan 2001 18:53:47 +0100 (MET) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk According to Eli Zaretskii: > Please do. Given the session transcript you posted, it is quite > possible that the SIGFPE comes from some address *after* 0x1a64, since > __crt1_startup doesn't have line info, so GDB cannot step a line. Ok, as my previous disassembly might have too short here's the lot: Dump of assembler code for function main: 0x1a58
: push %ebp 0x1a59 : mov %esp,%ebp 0x1a5b : sub $0x7c,%esp 0x1a5e : push %edi 0x1a5f : push %esi 0x1a60 : push %ebx 0x1a61 : mov 0xc(%ebp),%edx 0x1a64 : cmpl $0x2,0x8(%ebp) 0x1a68 : je 0x1a84 0x1a6a : mov (%edx),%eax 0x1a6c : add $0xfffffff8,%esp 0x1a6f : push %eax 0x1a70 : push $0x1810 0x1a75 : call 0x3800 0x1a7a : add $0xfffffff4,%esp 0x1a7d : push $0x1 0x1a7f : call 0x3850 0x1a84 : mov 0x4(%edx),%eax 0x1a87 : movsbl (%eax),%eax 0x1a8a : xor %ecx,%ecx 0x1a8c : mov 0xc7c1(%eax),%cl 0x1a92 : mov %ecx,0xffffffb4(%ebp) 0x1a95 : mov %ecx,%eax 0x1a97 : add $0xffffffbf,%eax 0x1a9a : cmp $0x19,%eax 0x1a9d : jbe 0x1ac0 0x1a9f : mov (%edx),%eax 0x1aa1 : add $0xfffffff8,%esp 0x1aa4 : push %eax 0x1aa5 : push $0x1810 0x1aaa : call 0x3800 0x1aaf : add $0xfffffff4,%esp 0x1ab2 : push $0x1 0x1ab4 : call 0x3850 0x1ab9 : lea 0x0(%esi,1),%esi 0x1ac0 : mov 0xffffffb4(%ebp),%eax 0x1ac3 : add $0xfffffffc,%esp 0x1ac6 : push %eax 0x1ac7 : push $0x1843 0x1acc : lea 0xffffffc4(%ebp),%edx 0x1acf : mov %edx,0xffffffb0(%ebp) 0x1ad2 : push %edx 0x1ad3 : call 0x38e0 0x1ad8 : mov 0xffffffb0(%ebp),%ecx 0x1adb : add $0xfffffff4,%esp 0x1ade : push %ecx 0x1adf : call 0x3924 <_put_path> 0x1ae4 : movw $0x7303,0xffffffe8(%ebp) 0x1aea : mov 0x1012c,%eax 0x1aef : shr $0x4,%eax 0x1af2 : mov %ax,0xffffffee(%ebp) 0x1af6 : mov %ax,0xfffffff0(%ebp) 0x1afa : movw $0x0,0xffffffcc(%ebp) 0x1b00 : movw $0x0,0xffffffe0(%ebp) 0x1b06 : movw $0x100,0xffffffe4(%ebp) 0x1b0c : add $0x20,%esp 0x1b0f : add $0xfffffff8,%esp 0x1b12 : lea 0xffffffcc(%ebp),%ebx 0x1b15 : push %ebx 0x1b16 : push $0x21 0x1b18 : call 0x3740 <__dpmi_int> 0x1b1d : add $0x10,%esp 0x1b20 : mov $0xffffffff,%edi 0x1b25 : testb $0x1,0xffffffec(%ebp) 0x1b29 : jne 0x1b31 0x1b2b : xor %edi,%edi 0x1b2d : mov 0xffffffe8(%ebp),%di 0x1b31 : mov 0x1013a,%dx 0x1b38 : mov 0x1012c,%ecx 0x1b3e : lea 0xc(%ecx),%esi 0x1b41 : mov %edx,%gs 0x1b43 : mov %gs:(%esi),%esi 0x1b46 : mov %esi,0xffffffbc(%ebp) 0x1b49 : lea 0x8(%ecx),%ebx 0x1b4c : mov %edx,%gs 0x1b4e : mov %gs:(%ebx),%ebx 0x1b51 : lea 0x4(%ecx),%eax 0x1b54 : mov %edx,%gs 0x1b56 : mov %gs:(%eax),%eax 0x1b59 : imul %eax,%ebx 0x1b5c : add $0x10,%ecx 0x1b5f : mov %ebx,0xffffffc0(%ebp) 0x1b62 : mov %edx,%gs 0x1b64 : mov %gs:(%ecx),%edx 0x1b67 : mov %edx,0xffffffb8(%ebp) 0x1b6a : add $0xfffffffc,%esp 0x1b6d : push %esi 0x1b6e : push %edx 0x1b6f : push %ebx 0x1b70 : mov 0x10150,%eax 0x1b75 : push %eax 0x1b76 : push %edi 0x1b77 : mov 0xffffffb4(%ebp),%eax 0x1b7a : push %eax 0x1b7b : push $0x1850 0x1b80 : call 0x3800 0x1b85 : mov 0xffffffb8(%ebp),%esi 0x1b88 : mov 0xffffffc0(%ebp),%edi 0x1b8b : mov %edi,%eax 0x1b8d : imul %esi,%eax 0x1b8f : add $0x20,%esp 0x1b92 : add $0xfffffffc,%esp 0x1b95 : mov %eax,0xffffff94(%ebp) 0x1b98 : mov %edx,0xffffff98(%ebp) 0x1b9b : mov %eax,%ecx 0x1b9d : mov %edx,%ebx 0x1b9f : test %edx,%edx 0x1ba1 : jge 0x1bae 0x1ba3 : addl $0x3ff,0xffffff94(%ebp) 0x1baa : adcl $0x0,0xffffff98(%ebp) 0x1bae : mov 0xffffff94(%ebp),%eax 0x1bb1 : mov 0xffffff98(%ebp),%edx 0x1bb4 : shrd $0xa,%edx,%eax 0x1bb8 : sar $0xa,%edx 0x1bbb : push %edx 0x1bbc : push %eax 0x1bbd : push %esi 0x1bbe : push %edi 0x1bbf : push %ebx 0x1bc0 : push %ecx 0x1bc1 : push $0x18b0 0x1bc6 : call 0x3800 0x1bcb : add $0x20,%esp 0x1bce : add $0xfffffff4,%esp 0x1bd1 : push $0x18de 0x1bd6 : call 0x3800 0x1bdb : mov 0xffffffb4(%ebp),%edx 0x1bde : add $0xfffffffc,%esp 0x1be1 : push %edx 0x1be2 : push $0x1843 0x1be7 : mov 0xffffffb0(%ebp),%ecx 0x1bea : push %ecx 0x1beb : call 0x38e0 0x1bf0 : mov 0xffffffb0(%ebp),%eax 0x1bf3 : add $0x20,%esp 0x1bf6 : add $0xfffffff4,%esp 0x1bf9 : push %eax 0x1bfa : call 0x3924 <_put_path> 0x1bff : add $0x10,%esp 0x1c02 : movl 0x1013a,%gs 0x1c08 : mov 0xffffffb4(%ebp),%ecx 0x1c0b : add $0xffffffbf,%ecx 0x1c0e : mov %ecx,0xffffff9c(%ebp) 0x1c11 : mov 0xffffffb4(%ebp),%al 0x1c14 : add $0xc0,%al 0x1c16 : mov %al,0xffffffaf(%ebp) 0x1c19 : lea 0xffffffc0(%ebp),%ecx 0x1c1c : mov %ecx,0xffffffa0(%ebp) 0x1c1f : lea 0xffffffbc(%ebp),%eax 0x1c22 : mov %eax,0xffffffa4(%ebp) 0x1c25 : lea 0xffffffb8(%ebp),%ecx 0x1c28 : mov %ecx,0xffffffa8(%ebp) 0x1c2b : mov 0x1012c,%ecx 0x1c31 : xor %edx,%edx 0x1c33 : and $0xfffffff0,%ecx 0x1c36 : lea 0x400(%edx,%ecx,1),%eax 0x1c3d : movb $0x0,%gs:(%eax) 0x1c41 : inc %edx 0x1c42 : cmp $0xff,%edx 0x1c48 : jle 0x1c36 0x1c4a : movw $0x7303,0xffffffe8(%ebp) 0x1c50 : mov 0x1012c,%eax 0x1c55 : shr $0x4,%eax 0x1c58 : mov %ax,0xffffffee(%ebp) 0x1c5c : mov %ax,0xfffffff0(%ebp) 0x1c60 : movw $0x0,0xffffffe0(%ebp) 0x1c66 : movw $0x400,0xffffffcc(%ebp) 0x1c6c : movw $0x100,0xffffffe4(%ebp) 0x1c72 : add $0xfffffff8,%esp 0x1c75 : lea 0xffffffcc(%ebp),%eax 0x1c78 : push %eax 0x1c79 : push $0x21 0x1c7b : call 0x3740 <__dpmi_int> 0x1c80 : add $0x10,%esp 0x1c83 : mov $0xffffffff,%edi 0x1c88 : testb $0x1,0xffffffec(%ebp) 0x1c8c : jne 0x1c94 0x1c8e : xor %edi,%edi 0x1c90 : mov 0xffffffe8(%ebp),%di 0x1c94 : mov 0x1013a,%dx 0x1c9b : mov 0x1012c,%ecx 0x1ca1 : lea 0x40c(%ecx),%esi 0x1ca7 : mov %edx,%gs 0x1ca9 : mov %gs:(%esi),%esi 0x1cac : mov %esi,0xffffffbc(%ebp) 0x1caf : lea 0x408(%ecx),%ebx 0x1cb5 : mov %edx,%gs 0x1cb7 : mov %gs:(%ebx),%ebx 0x1cba : lea 0x404(%ecx),%eax 0x1cc0 : mov %edx,%gs 0x1cc2 : mov %gs:(%eax),%eax 0x1cc5 : imul %eax,%ebx 0x1cc8 : add $0x410,%ecx 0x1cce : mov %ebx,0xffffffc0(%ebp) 0x1cd1 : mov %edx,%gs 0x1cd3 : mov %gs:(%ecx),%edx 0x1cd6 : mov %edx,0xffffffb8(%ebp) 0x1cd9 : add $0xfffffffc,%esp 0x1cdc : push %esi 0x1cdd : push %edx 0x1cde : push %ebx 0x1cdf : mov 0x10150,%eax 0x1ce4 : push %eax 0x1ce5 : push %edi 0x1ce6 : mov 0xffffffb4(%ebp),%edx 0x1ce9 : push %edx 0x1cea : push $0x18f0 0x1cef : call 0x3800 0x1cf4 : mov 0xffffffb8(%ebp),%esi 0x1cf7 : mov 0xffffffc0(%ebp),%edi 0x1cfa : mov %edi,%eax 0x1cfc : imul %esi,%eax 0x1cfe : add $0x20,%esp 0x1d01 : add $0xfffffffc,%esp 0x1d04 : mov %eax,0xffffff94(%ebp) 0x1d07 : mov %edx,0xffffff98(%ebp) 0x1d0a : mov %eax,%ecx 0x1d0c : mov %edx,%ebx 0x1d0e : test %edx,%edx 0x1d10 : jge 0x1d1d 0x1d12 : addl $0x3ff,0xffffff94(%ebp) 0x1d19 : adcl $0x0,0xffffff98(%ebp) 0x1d1d : mov 0xffffff94(%ebp),%eax 0x1d20 : mov 0xffffff98(%ebp),%edx 0x1d23 : shrd $0xa,%edx,%eax 0x1d27 : sar $0xa,%edx 0x1d2a : push %edx 0x1d2b : push %eax 0x1d2c : push %esi 0x1d2d : push %edi 0x1d2e : push %ebx 0x1d2f : push %ecx 0x1d30 : push $0x18b0 0x1d35 : call 0x3800 0x1d3a : add $0x20,%esp 0x1d3d : add $0xfffffff4,%esp 0x1d40 : push $0x18de 0x1d45 : call 0x3800 0x1d4a : movw $0x7302,0xffffffe8(%ebp) 0x1d50 : mov 0xffffffaf(%ebp),%dl 0x1d53 : mov %dl,0xffffffe0(%ebp) 0x1d56 : mov 0x1012c,%eax 0x1d5b : shr $0x4,%eax 0x1d5e : mov %ax,0xffffffee(%ebp) 0x1d62 : movw $0x0,0xffffffcc(%ebp) 0x1d68 : movw $0x100,0xffffffe4(%ebp) 0x1d6e : add $0xfffffff8,%esp 0x1d71 : lea 0xffffffcc(%ebp),%ecx 0x1d74 : push %ecx 0x1d75 : push $0x21 0x1d77 : call 0x3740 <__dpmi_int> 0x1d7c : add $0x20,%esp 0x1d7f : mov $0xffffffff,%edi 0x1d84 : testb $0x1,0xffffffec(%ebp) 0x1d88 : jne 0x1d90 0x1d8a : xor %edi,%edi 0x1d8c : mov 0xffffffe8(%ebp),%di 0x1d90 : mov 0xffffffbc(%ebp),%eax 0x1d93 : add $0xfffffffc,%esp 0x1d96 : push %eax 0x1d97 : mov 0xffffffb8(%ebp),%eax 0x1d9a : push %eax 0x1d9b : mov 0xffffffc0(%ebp),%eax 0x1d9e : push %eax 0x1d9f : mov 0x10150,%eax 0x1da4 : push %eax 0x1da5 : push %edi 0x1da6 : mov 0xffffffb4(%ebp),%eax 0x1da9 : push %eax 0x1daa : push $0x1950 0x1daf : call 0x3800 0x1db4 : mov 0xffffffb8(%ebp),%esi 0x1db7 : mov 0xffffffc0(%ebp),%edi 0x1dba : mov %edi,%eax 0x1dbc : imul %esi,%eax 0x1dbe : add $0x20,%esp 0x1dc1 : add $0xfffffffc,%esp 0x1dc4 : mov %eax,0xffffff94(%ebp) 0x1dc7 : mov %edx,0xffffff98(%ebp) 0x1dca : mov %eax,%ecx 0x1dcc : mov %edx,%ebx 0x1dce : test %edx,%edx 0x1dd0 : jge 0x1ddd 0x1dd2 : addl $0x3ff,0xffffff94(%ebp) 0x1dd9 : adcl $0x0,0xffffff98(%ebp) 0x1ddd : mov 0xffffff94(%ebp),%eax 0x1de0 : mov 0xffffff98(%ebp),%edx 0x1de3 : shrd $0xa,%edx,%eax 0x1de7 : sar $0xa,%edx 0x1dea : push %edx 0x1deb : push %eax 0x1dec : push %esi 0x1ded : push %edi 0x1dee : push %ebx 0x1def : push %ecx 0x1df0 : push $0x18b0 0x1df5 : call 0x3800 0x1dfa : add $0x20,%esp 0x1dfd : add $0xfffffff4,%esp 0x1e00 : push $0x18de 0x1e05 : call 0x3800 0x1e0a : mov 0xffffffa0(%ebp),%edx 0x1e0d : add $0x10,%esp 0x1e10 : push %edx 0x1e11 : mov 0xffffffa4(%ebp),%ecx 0x1e14 : push %ecx 0x1e15 : mov 0xffffffa8(%ebp),%eax 0x1e18 : push %eax 0x1e19 : mov 0xffffff9c(%ebp),%edx 0x1e1c : push %edx 0x1e1d : call 0x1570 0x1e22 : add $0x10,%esp 0x1e25 : xor %edi,%edi 0x1e27 : test %eax,%eax 0x1e29 : jne 0x1e30 0x1e2b : mov $0xffffffff,%edi 0x1e30 : mov 0xffffffbc(%ebp),%eax 0x1e33 : add $0xfffffffc,%esp 0x1e36 : push %eax 0x1e37 : mov 0xffffffb8(%ebp),%eax 0x1e3a : push %eax 0x1e3b : mov 0xffffffc0(%ebp),%eax 0x1e3e : push %eax 0x1e3f : mov 0x10150,%eax 0x1e44 : push %eax 0x1e45 : push %edi 0x1e46 : mov 0xffffffb4(%ebp),%ecx 0x1e49 : push %ecx 0x1e4a : push $0x19b0 0x1e4f : call 0x3800 0x1e54 : mov 0xffffffc0(%ebp),%edi 0x1e57 : mov 0xffffffb8(%ebp),%esi 0x1e5a : mov %edi,%eax 0x1e5c : imul %esi,%eax 0x1e5e : add $0x20,%esp 0x1e61 : add $0xfffffffc,%esp 0x1e64 : mov %eax,0xffffff94(%ebp) 0x1e67 : mov %edx,0xffffff98(%ebp) 0x1e6a : mov %eax,%ecx 0x1e6c : mov %edx,%ebx 0x1e6e : test %edx,%edx 0x1e70 : jge 0x1e7d 0x1e72 : addl $0x3ff,0xffffff94(%ebp) 0x1e79 : adcl $0x0,0xffffff98(%ebp) 0x1e7d : mov 0xffffff94(%ebp),%eax 0x1e80 : mov 0xffffff98(%ebp),%edx 0x1e83 : shrd $0xa,%edx,%eax 0x1e87 : sar $0xa,%edx 0x1e8a : push %edx 0x1e8b : push %eax 0x1e8c : push %esi 0x1e8d : push %edi 0x1e8e : push %ebx 0x1e8f : push %ecx 0x1e90 : push $0x18b0 0x1e95 : call 0x3800 0x1e9a : add $0x20,%esp 0x1e9d : add $0xfffffff4,%esp 0x1ea0 : push $0x18de 0x1ea5 : call 0x3800 0x1eaa : mov 0xffffffa0(%ebp),%edx 0x1ead : push %edx 0x1eae : mov 0xffffffa4(%ebp),%ecx 0x1eb1 : push %ecx 0x1eb2 : mov 0xffffffa8(%ebp),%eax 0x1eb5 : push %eax 0x1eb6 : mov 0xffffff9c(%ebp),%edx 0x1eb9 : push %edx 0x1eba : call 0x1794 0x1ebf : mov %eax,%edi 0x1ec1 : mov 0xffffffbc(%ebp),%eax 0x1ec4 : add $0x20,%esp 0x1ec7 : add $0xfffffffc,%esp 0x1eca : push %eax 0x1ecb : mov 0xffffffb8(%ebp),%eax 0x1ece : push %eax 0x1ecf : mov 0xffffffc0(%ebp),%eax 0x1ed2 : push %eax 0x1ed3 : mov 0x10150,%eax 0x1ed8 : push %eax 0x1ed9 : push %edi 0x1eda : mov 0xffffffb4(%ebp),%ecx 0x1edd : push %ecx 0x1ede : push $0x1a10 0x1ee3 : call 0x3800 0x1ee8 : mov 0xffffffc0(%ebp),%edi 0x1eeb : mov 0xffffffb8(%ebp),%esi 0x1eee : mov %edi,%eax 0x1ef0 : imul %esi,%eax 0x1ef2 : add $0x20,%esp 0x1ef5 : add $0xfffffffc,%esp 0x1ef8 : mov %eax,0xffffff94(%ebp) 0x1efb : mov %edx,0xffffff98(%ebp) 0x1efe : mov %eax,%ecx 0x1f00 : mov %edx,%ebx 0x1f02 : test %edx,%edx 0x1f04 : jge 0x1f11 0x1f06 : addl $0x3ff,0xffffff94(%ebp) 0x1f0d : adcl $0x0,0xffffff98(%ebp) 0x1f11 : mov 0xffffff94(%ebp),%eax 0x1f14 : mov 0xffffff98(%ebp),%edx 0x1f17 : shrd $0xa,%edx,%eax 0x1f1b : sar $0xa,%edx 0x1f1e : push %edx 0x1f1f : push %eax 0x1f20 : push %esi 0x1f21 : push %edi 0x1f22 : push %ebx 0x1f23 : push %ecx 0x1f24 : push $0x18b0 0x1f29 : call 0x3800 0x1f2e : add $0x20,%esp 0x1f31 : add $0xfffffff4,%esp 0x1f34 : push $0x18de 0x1f39 : call 0x3800 0x1f3e : lea 0xffffff78(%ebp),%esp 0x1f44 : xor %eax,%eax 0x1f46 : pop %ebx 0x1f47 : pop %esi 0x1f48 : pop %edi 0x1f49 : mov %ebp,%esp 0x1f4b : pop %ebp 0x1f4c : ret 0x1f4d : nop 0x1f4e : nop 0x1f4f : nop End of assembler dump. Right, MartinS