This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
fix fileio closing
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gdb at sources dot redhat dot com
- Cc: Daniel Jacobowitz <dan at codesourcery dot com>
- Date: Mon, 05 Jun 2006 15:32:30 +0100
- Subject: fix fileio closing
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
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);