From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31673 invoked by alias); 15 Apr 2005 21:02:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31651 invoked from network); 15 Apr 2005 21:02:28 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Apr 2005 21:02:28 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j3FL2Sj6023478 for ; Fri, 15 Apr 2005 17:02:28 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j3FL2SO16165 for ; Fri, 15 Apr 2005 17:02:28 -0400 Received: from localhost.localdomain (vpn50-9.rdu.redhat.com [172.16.50.9]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j3FL2Rjs012543 for ; Fri, 15 Apr 2005 17:02:28 -0400 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id j3FL2MMH012003 for ; Fri, 15 Apr 2005 14:02:22 -0700 Date: Fri, 15 Apr 2005 21:02:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: Re: [RFC] remote.c: Add remote TLS support Message-ID: <20050415140222.0e173d06@ironwood.lan> In-Reply-To: <20050415201200.GA10217@nevyn.them.org> References: <20050331162017.0e47552c@ironwood.lan> <20050415130913.50ee721c@ironwood.lan> <20050415201200.GA10217@nevyn.them.org> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-04/txt/msg00169.txt.bz2 On Fri, 15 Apr 2005 16:12:00 -0400 Daniel Jacobowitz wrote: > > + if (packet_ok (buf, &remote_protocol_qGetTLSAddr) == PACKET_OK) > > + { > > + ULONGEST result; > > + > > + unpack_varlen_hex (buf, &result); > > + return result; > > + } > > + else > > + { > > + struct exception e > > + = { RETURN_ERROR, TLS_GENERIC_ERROR, > > + "Remote target failed to process qGetTLSAddr request" }; > > + throw_exception (e); > > + > > + } > > + } > > + else > > + { > > + struct exception e > > + = { RETURN_ERROR, TLS_GENERIC_ERROR, > > + "TLS not supported or disabled on this target" }; > > + throw_exception (e); > > + } > > + /* Not reached. */ > > + return 0; > > +} > > + > > static void > > init_remote_ops (void) > > { > > You're still throwing the wrong exception if the packet is autodetected > as unavailable, as far as I can tell. You'll throw the "failed to > process" message. I apologize for missing this in your earlier review. I've checked the following change in to handle this case. * remote.c (remote_get_thread_local_address): Throw a more meaningful exception when remote target doesn't have support for the qGetTLSAddr packet. Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.182 diff -u -p -r1.182 remote.c --- remote.c 15 Apr 2005 19:58:59 -0000 1.182 +++ remote.c 15 Apr 2005 20:45:26 -0000 @@ -5344,6 +5344,7 @@ remote_get_thread_local_address (ptid_t struct remote_state *rs = get_remote_state (); char *buf = alloca (rs->remote_packet_size); char *p = buf; + enum packet_result result; strcpy (p, "qGetTLSAddr:"); p += strlen (p); @@ -5356,13 +5357,21 @@ remote_get_thread_local_address (ptid_t putpkt (buf); getpkt (buf, rs->remote_packet_size, 0); - if (packet_ok (buf, &remote_protocol_qGetTLSAddr) == PACKET_OK) + result = packet_ok (buf, &remote_protocol_qGetTLSAddr); + if (result == PACKET_OK) { ULONGEST result; unpack_varlen_hex (buf, &result); return result; } + else if (result == PACKET_UNKNOWN) + { + struct exception e + = { RETURN_ERROR, TLS_GENERIC_ERROR, + "Remote target doesn't support qGetTLSAddr packet" }; + throw_exception (e); + } else { struct exception e