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: [PATCH] Ctrl-D


Daniel Jacobowitz wrote:
OK for HEAD with or without that change, as you prefer.  I'd recommend
this for 6.6 now that it's in HEAD; Joel, is that OK?

Committed to both HEAD and gdb_6_6-branch with the suggested change.


The final patch is attached.

Andrew
2006-12-06  Andrew Stubbs  <andrew.stubbs@st.com>

	* event-top.c (command_handler): On EOF, print 'quit' and run quit
	command via execute_command such that hooks and trace work.
	* utils.c (defaulted_query): On EOF, print default answer and newline.

Index: src/gdb/event-top.c
===================================================================
--- src.orig/gdb/event-top.c	2006-12-06 10:49:25.000000000 +0000
+++ src/gdb/event-top.c	2006-12-06 13:52:46.000000000 +0000
@@ -501,7 +501,10 @@ command_handler (char *command)
      but GDB is still alive. In such a case, we just quit gdb
      killing the inferior program too. */
   if (command == 0)
-    quit_command ((char *) 0, stdin == instream);
+    {
+      printf_unfiltered ("quit\n");
+      execute_command ("quit", stdin == instream);
+    }
 
   time_at_cmd_start = get_run_time ();
 
Index: src/gdb/utils.c
===================================================================
--- src.orig/gdb/utils.c	2006-12-06 10:49:26.000000000 +0000
+++ src/gdb/utils.c	2006-12-06 13:54:01.000000000 +0000
@@ -1230,6 +1230,7 @@ defaulted_query (const char *ctlstr, con
       clearerr (stdin);		/* in case of C-d */
       if (answer == EOF)	/* C-d */
 	{
+	  printf_filtered ("EOF [assumed %c]\n", def_answer);
 	  retval = def_value;
 	  break;
 	}

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