delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/01/13/05:27:25

X-Authentication-Warning: sirppi.helsinki.fi: peuha owned process doing -bs
Date: Thu, 13 Jan 2000 10:50:00 +0200 (EET)
From: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
Sender: peuha AT cc DOT helsinki DOT fi
To: djgpp-workers AT delorie DOT com
Subject: MWDPMI exception handling
Message-ID: <Pine.OSF.4.20.0001131047590.31342-100000@sirppi.helsinki.fi>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019