[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] gdb interrupt patch.
From: |
reinhard . jessich |
Subject: |
Re: [Simulavr-devel] gdb interrupt patch. |
Date: |
Wed, 2 Jan 2002 13:28:14 +0100 |
On Wed, 02 Jan 2002, Theodore A. Roth wrote:
>
> It was an easy hack. With the attached patch, you can hit C-c in gdb while
> the sim is chugging away and the interrupt will propagate done to the sim
> which will stop.
>
> Oh, this also includes Tor Ringstad's patch to clean up the SIGINT
> handling stuff in gdbserver.c
>
> Give it a whirl and tell me what I messed up. ;)
I haven't compiled it until now, but I think it will work. I am sure you have
tested it.
I have done code reading only and I thing you have forgotten to add a
return -2; and remove the gdb_send_reply( fd, "S04" );
in the case block if 0x03 is received in gdb_pre_parse_packet.
Maybe I am wrong, but gdb send 0x03 only in case of a break (or does send it
more?) and then I can't see how you break the loop in gdb_continue, if you
return 0 instead of a negative value.
I think I should test it and not thinking about a problem, that doesn't exist.
I am happy to see, that you have found the bug with the not uninstalled signal
handler. I started to write an email concerning this bug. Now it is fixed, but.
As far as I remember, you should install the ignore function to a signal
handler after you have got it. So
static void catch_sigint( int sig )
{
if (sig == SIGINT)
{
signal(SIGINT, SIG_IGN);
__got_SIGINT++;
}
}
the correct code.
For the short term this is enough, but for the long term I think we should
handle all signals on a central point and remember them in the core. I am sure
there will be other loops in the future, which must be breaked if someone
enters <cntr-c>. But we should implement what we need, at the point when we
need it, not now.
I will test the patch in the evening.
Regards,
Reinhard
--
Ing. Reinhard Jessich mailto: address@hidden
A-1190 Vienna, Goergengasse 2/2/1 phone: +43/1/3692600
http://members.telering.at/jessich mobile: +43/664/1735439