Mail Archives: djgpp-workers/2000/01/13/05:27:25
I've been trying to make exceptions work with MWDPMI (you can get the sources
at http://www.helsinki.fi/~peuha/english/djgpp/mwdpmi00.zip). My problem
is with the following piece of code:
/* Pass exception to client */
addl %ebp, %ebp /* Item size now 8 */
cs
addl _current_exception_table, %ebp
pushl $except_return_point /* Return EIP */
cs
pushl 4(%ebp) /* Handler CS */
cs
pushl (%ebp) /* Handler EIP */
movl $gdt_code32_sel, %ebp
xchgl %ebp, 12(%esp) /* Return CS */
lret
If the handler CS:EIP points to code in the server itself, this works
fine, but if it points to the client, the LRET causes a GPF, presumably
because it tries to pop the return CS:EIP into SS:ESP. I don't understand
why does it do that, since this very similar fragment from the interrupt
handler works fine:
addl %ebp, %ebp /* Item size now 8 */
cs
addl _current_software_interrupt_table, %ebp
cs
pushl (%ebp) /* EIP */
cs
movl 4(%ebp), %ebp /* get CS */
xchgl %ebp, 4(%esp)
lret
--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
- Raw text -