delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/09/09:32:02

Message-ID: <B0000061324@stargate.astr.lu.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: Robert Hoehne <robert DOT hoehne AT gmx DOT net>, djgpp-workers AT delorie DOT com,
muller AT cerbere DOT u-strasbg DOT fr
Date: Sat, 9 Jan 1999 16:31:49 +0200
MIME-Version: 1.0
Subject: Re: debug GDB with itself
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3696AB40.CDA81D7C@gmx.net>
X-mailer: Pegasus Mail for Win32 (v3.01d)
Reply-To: djgpp-workers AT delorie DOT com

On 9 Jan 99, at 0:05, Robert Hoehne wrote:

> Pierre Muller wrote :
> > 
> >    Following Eli Zaretskii proposals I send you
> > I context diff for
> > 
> >    include/debug/dbgcom.h
> >   and
> > 
> >    src/debug/common/dbgcom.c
> 
> Now I took some time to check your patches.
> 
> 
> Why do you such complicated things when saving/restoring
> the FPU? If you look in src/debug/fsdb/fullscr.c you will
> find already a versiion of saving/restoring the FPU which seems
> to me much shorter and better to look at.

FSDB saves FPU state itself. gdb-4.17 (with unofficial patches for DJGPP from 
Robert) does the same in the same way as FSDB. So I think we should either 
modify both and do FPU saving in run_child() in the way it is done in FSDB or
remove saving it from dbgcom.c at all. Otherwise all debuggers that saves
it theirself will not able to modify FPU state (it may be not actual immediatelly,
but who knows when it will be needed)
 
> To your exception handler hooking I cannot say so much,
> since I can't overlook it, but if I see it right, you are
> disabling at all, that the debugged program can hook the
> keyboard interrupt (0x09). Is this right? If yes, I don't
> think this is good, since many people use allegro and allegro
> hooks that intterupt.

My latest tests shows that there are more problems than I expected.
At first exception that was caused by __djgpp_hw_exception()
(it is by invalidating DS and SS) should be processed in the same
application where it is raised

If debugger does not allow to hook keyboard interrupt then SIGINT
should be processed also there. I tested debugee really doesn't get
SIGINT even if it is hooked there. Also we should forbid to hook
real mode interrupt 0x1B (Ctrl-Break) as it also calls __djgpp_hw_exception
(I was not able to get it not crashing debugger otherwise)

The next problem is floating point exceptions. Currently I still have the
same problem I had earlier with Ctrl-Break (the results of 
__djgpp_hw_exception is not undone, that is dangerous)

So what can we do:
	one way could be disabling hooking exceptions in debugee at all.
	Possible problems:  we have to also forbid hooking some interrupts
	including keyboard one. We still will be able to debug programs 
	that doesn't hook keyboard (except signal handling of course)

       Other way would be make stubs for all needed interrupts and exceptions
	in dbgcom.c and call handlers set by program being debugged from these
       stubs. 

I would prefer the second way as first one is perhaps too restrictive.
 
Andris

- Raw text -


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