This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFC: remote-sim.c -vs- immediate_quit
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 30 Jul 2012 09:14:13 -0600
- Subject: RFC: remote-sim.c -vs- immediate_quit
I would appreciate comments on this patch.
I happened to be looking at immediate_quit again today, and I noticed
the use in remote-sim.c:
static int
gdb_os_poll_quit (host_callback *p)
{
if (deprecated_ui_loop_hook != NULL)
deprecated_ui_loop_hook (0);
if (quit_flag) /* gdb's idea of quit */
{
quit_flag = 0; /* we've stolen it */
return 1;
}
else if (immediate_quit)
{
return 1;
}
return 0;
}
I think this is just wrong... it appears to be treating immediate_quit
as if it were some kind of synonym for quit_flag -- but this is
backward, as immediate_quit affects the operation of the SIGINT handler,
and is not a consequence of it.
I propose the appended as a fix.
What do you think?
Tom
2012-07-30 Tom Tromey <tromey@redhat.com>
* remote-sim.c (gdb_os_poll_quit): Don't check immediate_quit.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f5927f2..b3890b8 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -955,10 +955,6 @@ gdb_os_poll_quit (host_callback *p)
quit_flag = 0; /* we've stolen it */
return 1;
}
- else if (immediate_quit)
- {
- return 1;
- }
return 0;
}