delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/25/06:23:07

Date: Fri, 25 Oct 1996 12:21:48 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: function _exit() and about dbgcom.c
Message-Id: <Pine.HPP.3.95.961025120545.12946C-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

Hi all,

I have a question about the exit code (not the return value, but
realy the code of the function _exit()).

In that function is an cli instruction with the commant, that
user may have hooked some interrupts. I understand this and there
are commonly not problems with it, because after this in 0x21 is
called, which enables interrupts after leaving this interrupt. But
now come the problem with the debuggers.

In dbgcom.c the int 0x21 is hooked in a way, the the ah=0x4c function
is bypassed. So if the debuggee calls _exit() interrupts are disabled.
This is in most common usage not a problem, because most of the
debuggers call some interrupts after exiting the debuggee. But I
had the problem (with the integrated debugger in RHIDE) that I
show the user the return value of the debugge and waiting then
for a key press or mouse. I found, that at this point interrupts
are disabled so there helps only a reset. After cahnging it
by calling enable() after exiting the debugge the problem was
solved. But is this the correct way or should it be done in
dbgcom.c ?

And related to this topic an other hint/wish. Because dbgcom.c
hooks the int 0x21 AH=0x4c all the files, which are still open
at this point from the debugge are not closed. Because I'm probably
the only person, which use the new feature of GDB 4.16 in killing
and restarting the debugge without leaving GDB nobody else saw
this problem. But you can test it by debugging a program, which opens
some files and restarting it in GDB before the files are closed.

Now my wish. Is there someone, who has alrady some code, which
can determine all the files, which were opened by a program when
all the information about the psp and so on are available or
has someone an idea how this can be done?

Robert

- Raw text -


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