This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Oleg Nesterov] PATCH? gdb remote.c: readchar() should pop_target() if SERIAL_ERROR?
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Oleg Nesterov <oleg at redhat dot com>
- Date: Wed, 28 Jul 2010 14:19:47 -0600
- Subject: Re: [Oleg Nesterov] PATCH? gdb remote.c: readchar() should pop_target() if SERIAL_ERROR?
- References: <m3fwzs1l8r.fsf@fleche.redhat.com> <201007282049.14873.pedro@codesourcery.com>
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> Talking in terms of Linux kernel internals, eh?
Yeah, see the discussion on the archer list...
Pedro> ... thus, I have no problems with this. Could you tweak the
Pedro> string to say something like:
Pedro> "Remote communication error. Target disconnected."
Pedro> so that user is informed we're no longer talking to the
Pedro> target?.
Pedro> Okay with that change.
Thank you. Here is the patch I am committing.
I'm putting it in 7.2 as well.
Tom
2010-07-28 Oleg Nesterov <oleg@redhat.com>
* remote.c (readchar): Call pop_target in case of SERIAL_ERROR.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.420
diff -u -r1.420 remote.c
--- remote.c 28 Jul 2010 18:04:19 -0000 1.420
+++ remote.c 28 Jul 2010 20:19:02 -0000
@@ -6667,7 +6667,8 @@
error (_("Remote connection closed"));
/* no return */
case SERIAL_ERROR:
- perror_with_name (_("Remote communication error"));
+ pop_target ();
+ perror_with_name (_("Remote communication error. Target disconnected."));
/* no return */
case SERIAL_TIMEOUT:
break;