aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2005-04-15 20:55:56 +0000
committerKevin Buettner <kevinb@redhat.com>2005-04-15 20:55:56 +0000
commit571dd61707032dd543738c7d3b6de91fda3d3138 (patch)
tree47ba6d60c6a82a8955e7db4699afb3a5f016d0ec /gdb
parent3869131802654869fbe827a727cfe16fb431b92a (diff)
downloadfsf-binutils-gdb-571dd61707032dd543738c7d3b6de91fda3d3138.zip
fsf-binutils-gdb-571dd61707032dd543738c7d3b6de91fda3d3138.tar.gz
fsf-binutils-gdb-571dd61707032dd543738c7d3b6de91fda3d3138.tar.bz2
* remote.c (remote_get_thread_local_address): Throw a more
meaningful exception when remote target doesn't have support for the qGetTLSAddr packet.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/remote.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 98aedfc..60fd193 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2005-04-15 Kevin Buettner <kevinb@redhat.com>
+ * remote.c (remote_get_thread_local_address): Throw a more
+ meaningful exception when remote target doesn't have support
+ for the qGetTLSAddr packet.
+
+2005-04-15 Kevin Buettner <kevinb@redhat.com>
+
* remote.c (remote_protocol_qGetTLSAddr): New static global variable.
(set_remote_protocol_qGetTLSAddr_packet_cmd)
(show_remote_protocol_qGetTLSAddr_packet_cmd)
diff --git a/gdb/remote.c b/gdb/remote.c
index 99b6421..9116617 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5344,6 +5344,7 @@ remote_get_thread_local_address (ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset)
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 ptid, CORE_ADDR lm, CORE_ADDR offset)
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