From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12732 invoked by alias); 5 Jun 2006 14:33:44 -0000 Received: (qmail 12724 invoked by uid 22791); 5 Jun 2006 14:33:43 -0000 X-Spam-Check-By: sourceware.org Received: from intranet.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Jun 2006 14:33:42 +0000 Received: (qmail 12987 invoked from network); 5 Jun 2006 14:33:40 -0000 Received: from unknown (HELO ?192.168.189.145?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Jun 2006 14:33:40 -0000 Message-ID: <4484407E.7090102@codesourcery.com> Date: Mon, 05 Jun 2006 14:33:00 -0000 From: Nathan Sidwell User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) MIME-Version: 1.0 To: gdb@sources.redhat.com CC: Daniel Jacobowitz Subject: fix fileio closing Content-Type: multipart/mixed; boundary="------------000300030501020704030207" Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00019.txt.bz2 This is a multi-part message in MIME format. --------------000300030501020704030207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 399 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 --------------000300030501020704030207 Content-Type: text/x-patch; name="remote-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="remote-2.patch" Content-length: 1132 2006-06-05 Nathan Sidwell * 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); --------------000300030501020704030207--