From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78377 invoked by alias); 24 Mar 2016 22:32:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 78366 invoked by uid 89); 24 Mar 2016 22:32:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Mar 2016 22:32:25 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 1B947811D2 for ; Thu, 24 Mar 2016 22:32:24 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2OMWKUo005407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 24 Mar 2016 18:32:22 -0400 Date: Thu, 24 Mar 2016 22:32:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Gary Benson Subject: [patchv2 1/2] Workaround gdbserver<7.7 for setfs Message-ID: <20160324223220.GA2548@host1.jankratochvil.net> References: <20160319201842.GA16540@host1.jankratochvil.net> <56F13963.9040204@redhat.com> <20160322131604.GA24312@host1.jankratochvil.net> <56F14F1E.5010606@redhat.com> <20160323211547.GA17400@host1.jankratochvil.net> <20160324220933.GA27445@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZPt4rx8FFjLCG7dd" Content-Disposition: inline In-Reply-To: <20160324220933.GA27445@host1.jankratochvil.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00500.txt.bz2 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 28 There was a bug in patchv1. --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="move1.patch" Content-length: 3700 gdb/ChangeLog 2016-03-24 Jan Kratochvil Code cleanup. * remote.c (packet_ok): Move it after remote_protocol_packets. diff --git a/gdb/remote.c b/gdb/remote.c index af0a08a..bb027cf 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1301,59 +1301,6 @@ packet_check_result (const char *buf) return PACKET_UNKNOWN; } -static enum packet_result -packet_ok (const char *buf, struct packet_config *config) -{ - enum packet_result result; - - if (config->detect != AUTO_BOOLEAN_TRUE - && config->support == PACKET_DISABLE) - internal_error (__FILE__, __LINE__, - _("packet_ok: attempt to use a disabled packet")); - - result = packet_check_result (buf); - switch (result) - { - case PACKET_OK: - case PACKET_ERROR: - /* The stub recognized the packet request. */ - if (config->support == PACKET_SUPPORT_UNKNOWN) - { - if (remote_debug) - fprintf_unfiltered (gdb_stdlog, - "Packet %s (%s) is supported\n", - config->name, config->title); - config->support = PACKET_ENABLE; - } - break; - case PACKET_UNKNOWN: - /* The stub does not support the packet. */ - if (config->detect == AUTO_BOOLEAN_AUTO - && config->support == PACKET_ENABLE) - { - /* If the stub previously indicated that the packet was - supported then there is a protocol error. */ - error (_("Protocol error: %s (%s) conflicting enabled responses."), - config->name, config->title); - } - else if (config->detect == AUTO_BOOLEAN_TRUE) - { - /* The user set it wrong. */ - error (_("Enabled packet %s (%s) not recognized by stub"), - config->name, config->title); - } - - if (remote_debug) - fprintf_unfiltered (gdb_stdlog, - "Packet %s (%s) is NOT supported\n", - config->name, config->title); - config->support = PACKET_DISABLE; - break; - } - - return result; -} - enum { PACKET_vCont = 0, PACKET_X, @@ -1496,6 +1443,59 @@ enum { static struct packet_config remote_protocol_packets[PACKET_MAX]; +static enum packet_result +packet_ok (const char *buf, struct packet_config *config) +{ + enum packet_result result; + + if (config->detect != AUTO_BOOLEAN_TRUE + && config->support == PACKET_DISABLE) + internal_error (__FILE__, __LINE__, + _("packet_ok: attempt to use a disabled packet")); + + result = packet_check_result (buf); + switch (result) + { + case PACKET_OK: + case PACKET_ERROR: + /* The stub recognized the packet request. */ + if (config->support == PACKET_SUPPORT_UNKNOWN) + { + if (remote_debug) + fprintf_unfiltered (gdb_stdlog, + "Packet %s (%s) is supported\n", + config->name, config->title); + config->support = PACKET_ENABLE; + } + break; + case PACKET_UNKNOWN: + /* The stub does not support the packet. */ + if (config->detect == AUTO_BOOLEAN_AUTO + && config->support == PACKET_ENABLE) + { + /* If the stub previously indicated that the packet was + supported then there is a protocol error. */ + error (_("Protocol error: %s (%s) conflicting enabled responses."), + config->name, config->title); + } + else if (config->detect == AUTO_BOOLEAN_TRUE) + { + /* The user set it wrong. */ + error (_("Enabled packet %s (%s) not recognized by stub"), + config->name, config->title); + } + + if (remote_debug) + fprintf_unfiltered (gdb_stdlog, + "Packet %s (%s) is NOT supported\n", + config->name, config->title); + config->support = PACKET_DISABLE; + break; + } + + return result; +} + /* Returns the packet's corresponding "set remote foo-packet" command state. See struct packet_config for more details. */ --ZPt4rx8FFjLCG7dd--