public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* fix fileio closing
@ 2006-06-05 14:33 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2006-06-05 14:33 UTC (permalink / raw)
  To: gdb; +Cc: Daniel Jacobowitz

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

I noticed that opening a new remote connection would perform some irreversible 
actions (closing fileio, reopening things), before asking if that was ok.

This patch reorders the initialization so the prompting happens earlier. ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


[-- Attachment #2: remote-2.patch --]
[-- Type: text/x-patch, Size: 1132 bytes --]

2006-06-05  Nathan Sidwell  <nathan@codesourcery.com>

	* gdb/remote.c (remote_open_1): Do preopen tasks before
	irreversably destroying state.

Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.202.2.4
diff -c -3 -p -r1.202.2.4 remote.c
*** gdb/remote.c	24 May 2006 08:00:02 -0000	1.202.2.4
--- gdb/remote.c	5 Jun 2006 14:27:56 -0000
*************** remote_open_1 (char *name, int from_tty,
*** 2178,2192 ****
    if (!async_p)
      wait_forever_enabled_p = 1;
  
    remote_fileio_reset ();
    
    reopen_exec_file ();
    reread_symbols ();
  
-   target_preopen (from_tty);
- 
-   unpush_target (target);
- 
    remote_desc = remote_serial_open (name);
    if (!remote_desc)
      perror_with_name (name);
--- 2178,2192 ----
    if (!async_p)
      wait_forever_enabled_p = 1;
  
+   target_preopen (from_tty);
+ 
+   unpush_target (target);
+ 
    remote_fileio_reset ();
    
    reopen_exec_file ();
    reread_symbols ();
  
    remote_desc = remote_serial_open (name);
    if (!remote_desc)
      perror_with_name (name);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-05 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-05 14:33 fix fileio closing Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).