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]

fix jump_command in async mode.


The jump command may call query to ask the user for confirmation:

      if (!query ("Line %d is not in `%s'.  Jump anyway? ", sal.line,
		  SYMBOL_PRINT_NAME (fn)))
	{
	  error (_("Not confirmed."));
	  /* NOTREACHED */
	}

However, before that, in sync_execution mode, it already disabled
stdin with an async_disable_stdin call, which is bad when you're
going to ask the user for input...

This patch moves the stdin disabling to after the query call, before
proceeding the inferior.

This makes jump.exp pass cleanly with the linux native async support
patch I'll post next.

-- 
Pedro Alves
2008-03-14  Pedro Alves  <pedro@codesourcery.com>

	* infcmd.c (jump_command): Postpone disabling stdin until after
	the possible query.

---
 gdb/infcmd.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c	2008-03-14 06:00:52.000000000 +0000
+++ src/gdb/infcmd.c	2008-03-14 06:02:36.000000000 +0000
@@ -913,14 +913,6 @@ jump_command (char *arg, int from_tty)
   if (async_exec && !target_can_async_p ())
     error (_("Asynchronous execution not supported on this target."));
 
-  /* If we are not asked to run in the bg, then prepare to run in the
-     foreground, synchronously. */
-  if (!async_exec && target_can_async_p ())
-    {
-      /* Simulate synchronous execution */
-      async_disable_stdin ();
-    }
-
   if (!arg)
     error_no_arg (_("starting address"));
 
@@ -974,6 +966,14 @@ jump_command (char *arg, int from_tty)
       printf_filtered (".\n");
     }
 
+  /* If we are not asked to run in the bg, then prepare to run in the
+     foreground, synchronously. */
+  if (!async_exec && target_can_async_p ())
+    {
+      /* Simulate synchronous execution */
+      async_disable_stdin ();
+    }
+
   clear_proceed_status ();
   proceed (addr, TARGET_SIGNAL_0, 0);
 }

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