From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31329 invoked by alias); 15 Apr 2005 20:12:04 -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 31218 invoked from network); 15 Apr 2005 20:12:01 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 15 Apr 2005 20:12:01 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DMXAW-0002fq-MK; Fri, 15 Apr 2005 16:12:00 -0400 Date: Fri, 15 Apr 2005 20:12:00 -0000 From: Daniel Jacobowitz To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] remote.c: Add remote TLS support Message-ID: <20050415201200.GA10217@nevyn.them.org> Mail-Followup-To: Kevin Buettner , gdb-patches@sources.redhat.com References: <20050331162017.0e47552c@ironwood.lan> <20050415130913.50ee721c@ironwood.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050415130913.50ee721c@ironwood.lan> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00167.txt.bz2 Nice to see this checked in. On Fri, Apr 15, 2005 at 01:09:13PM -0700, Kevin Buettner wrote: > +static CORE_ADDR > +remote_get_thread_local_address (ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset) > +{ > + if (remote_protocol_qGetTLSAddr.support != PACKET_DISABLE) > + { > + struct remote_state *rs = get_remote_state (); > + char *buf = alloca (rs->remote_packet_size); > + char *p = buf; > + > + strcpy (p, "qGetTLSAddr:"); > + p += strlen (p); > + p += hexnumstr (p, PIDGET (ptid)); > + *p++ = ','; > + p += hexnumstr (p, offset); > + *p++ = ','; > + p += hexnumstr (p, lm); > + *p++ = '\0'; > + > + putpkt (buf); > + getpkt (buf, rs->remote_packet_size, 0); > + 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. -- Daniel Jacobowitz CodeSourcery, LLC