This is the mail archive of the gdb-patches@sources.redhat.com 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]

[RFA/RFC] QUIT doesn't seem to be working !?


Hello,

it's bizarre, we noticed that we were unable to interrupt certain
commands that can be time greedy. For instance, when messing up in the
addresses given to the "disass" command, it can take GDB a loooooong
time to print all instructions. Unexpectedly, hitting Control-C did not
interrupt the command.

I see in disassemble_command() that there is a call to QUIT in the while
loop that prints all instructions. But this macro tests for quit_flag
to see if we should stop now or not. However, handle_sigint() does
not set this flag when Control-C is pressed, unless immediate_quit is
set. But immediate_quit is not really what we are looking for, because
it tells GDB that SIGINT events should be processed immediately, which
obviously means that GDB does not wait for the next call to QUIT to
perform the abortion.

So far, what handle_sigint() does is set the "ready" flag in GDB's
SIGINT async signal handler. This flag seems to take effect only
at the top-level loop level. So in our case, its effect arrives too
late.

So I couldn't understand how QUIT was working....

I applied the following change, which allows GDB to aboart at QUIT
points if the user has pressed C-c. But I feel like I'm missing
something...

2003-08-12  J. Brobecker  <brobecker@gnat.com>

        * event-top.c (handle_sigint): Set quit_flag.

Comments? Ok to apply?

-- 
Joel

Attachment: event-top.c.diff
Description: Text document


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