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]

Re: [RFA] infcmd.c: Fix UI problem in attach_command


On Jun 27 20:11, Eli Zaretskii wrote:
> > Date: Sat, 26 Jun 2004 14:11:21 +0200
> > From: Corinna Vinschen <vinschen@redhat.com>
> > 
> > Before trying to load the executable's symbol table, attach_command
> > calls target_terminal_inferior().
> 
> Do you (or anyone else, like Elena) know why do we relinquish the
> terminal to the inferior while loading the symbol table?  It sounds
> like a strange thing to do at this point.

I don't know and it sounds strange to me as well.  I've tested a simlified
patch which just moves the call to target_terminal_inferior right before
the normal_stop call.  It works as good as my original patch, but I'm not
sure if there's a specific situation which requires an early switch to
the inferior.

Corinna


	* infcmd.c (attach_command): Move call to target_terminal_inferior
	behind loading symbol table.

Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.117
diff -u -p -r1.117 infcmd.c
--- infcmd.c	20 Jun 2004 18:10:14 -0000	1.117
+++ infcmd.c	28 Jun 2004 11:11:15 -0000
@@ -1788,9 +1788,6 @@ attach_command (char *args, int from_tty
      based on what modes we are starting it with.  */
   target_terminal_init ();
 
-  /* Install inferior's terminal modes.  */
-  target_terminal_inferior ();
-
   /* Set up execution context to know that we should return from
      wait_for_inferior as soon as the target reports a stop.  */
   init_wait_for_inferior ();
@@ -1849,6 +1846,9 @@ attach_command (char *args, int from_tty
    */
   target_post_attach (PIDGET (inferior_ptid));
 
+  /* Install inferior's terminal modes.  */
+  target_terminal_inferior ();
+
   normal_stop ();
 
   if (deprecated_attach_hook)


-- 
Corinna Vinschen
Cygwin Co-Project Leader
Red Hat, Inc.


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