From: sjoerd DOT s DOT bakker AT tip DOT nl (sjoerd DOT s DOT bakker AT tip DOT nl) Newsgroups: comp.os.msdos.djgpp Subject: Re: My INT 1 handler crashes under Windows 95 Date: Thu, 17 Dec 1998 16:48:36 GMT Organization: WorldOnline News server Lines: 24 Message-ID: <367d35d7.28434683@news.worldonline.nl> References: <366e8532 DOT 81397 AT news DOT worldonline DOT nl> NNTP-Posting-Host: vp233-110.worldonline.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.worldonline.nl 913913203 17248 195.241.233.110 (17 Dec 1998 16:46:43 GMT) X-Complaints-To: abuse AT worldonline DOT nl NNTP-Posting-Date: 17 Dec 1998 16:46:43 GMT X-Newsreader: Forte Agent 1.5/32.451 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Wed, 16 Dec 1998 10:18:20 +0200, Eli Zaretskii wrote: > >On Wed, 9 Dec 1998 sjoerd DOT s DOT bakker AT tip DOT nl wrote: > >> The following test-code installs a protected mode INT 1 (single-step) >> handler that runs well with CWSDPMI but crashes under Windows 95 with >> a registerdump caused by SIGTRAP. > >INT 1 is not a hardware interrupt in the normal sense. Try installing a >signal handler for SIGTRAP instead. You will probably need to make the >handler do a longjmp (instead of returning to the caller), to prevent the >program from crashing. If I do a longjmp, then I will lose track of the executing program and I want to trace each instruction. Longjmp restores the stack-segment and -pointer, so there would be no way to get back to the instruction following the one that caused SIGTRAP. I had tried a normal return from the signal handler, but I got a SIGTRAP registerdump with an error message about the handler not being able to return... as to be expected since the cause of the exception (TRAP-flag set) still exists after returning.