This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] undefine SIGHUP if function kill not available...


On Wed, Jan 07, 2009 at 03:58:32PM +0400, Joel Brobecker wrote:
> I have just seen Mark's comments (thank you!) about this patch, so I just
> downgraded this request to a request for comments.
> 
> Here is the problem: 
> 
> In event-top.c, some code that is conditional on SIGHUP being defined
> also uses kill(). On x86_64-windows, the MinGW signal.h now defines
> SIGHUP, but kill is still not available.  So the approach I took for
> now was to pretend that SIGHUP is not defined if kill is not available.
> This is clearly a hack, hence the comment I added.

Here is a new patch that replaces calls to "kill (getpid (), ...)"
by calls to "raise".

2009-01-08  Joel Brobecker  <brobecker@adacore.com>

        * event-top.c (async_disconnect, async_stop_sig): use "raise"
        instead of "kill" to raise a signal.

Tested on x86-linux, although I doubt that the testcase actually
exercises this part of the code. I tried to trigger the signal
handler that calls the "raise", but somehow it doesn't happen.
I wonder if this happens only when the inferior is still running...

In any case, it looks relatively straightforward, but I'd rather
have the confirmation from someone who's experienced with signals.

Thanks,
-- 
Joel

Attachment: raise.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]