This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] remote.c: Add remote TLS support
- From: Daniel Jacobowitz <drow at false dot org>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 15 Apr 2005 16:12:00 -0400
- Subject: Re: [RFC] remote.c: Add remote TLS support
- References: <20050331162017.0e47552c@ironwood.lan> <20050415130913.50ee721c@ironwood.lan>
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