aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-delegates.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-06-25 10:16:55 -0600
committerTom Tromey <tromey@redhat.com>2014-07-07 09:06:14 -0600
commitf0f9ff9530992cb86c7022310af223b2721117d1 (patch)
tree8ce203cef87c35218567961b74b6f755f901e25c /gdb/target-delegates.c
parent3bb9e7b43fb3bef0ecfef14b9185661afbe5f4c5 (diff)
downloadgdb-f0f9ff9530992cb86c7022310af223b2721117d1.zip
gdb-f0f9ff9530992cb86c7022310af223b2721117d1.tar.gz
gdb-f0f9ff9530992cb86c7022310af223b2721117d1.tar.bz2
convert to_get_thread_local_address to use target delegation
This converts to_get_thread_local_address to use TARGET_DEFAULT_NORETURN. One possible oddity is that this changes the text of the kind of exception thrown in some cases. This doesn't seem to be a problem; in fact perhaps the final call to 'error' in target_translate_tls_address should be changed to call generic_tls_error. 2014-07-07 Tom Tromey <tromey@redhat.com> * target.h (struct target_ops) <to_get_thread_local_address>: Use TARGET_DEFAULT_NORETURN. * target.c (generic_tls_error): New function. (target_translate_tls_address): Don't search target stack. * target-delegates.c: Rebuild. * ppc-linux-tdep.c (ppc_linux_spe_context): Don't search target stack. * linux-thread-db.c (thread_db_get_thread_local_address): Unconditionally call beneath target.
Diffstat (limited to 'gdb/target-delegates.c')
-rw-r--r--gdb/target-delegates.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index eac7018..a92c46a 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -767,6 +767,19 @@ tdefault_goto_bookmark (struct target_ops *self, const gdb_byte *arg1, int arg2)
tcomplain ();
}
+static CORE_ADDR
+delegate_get_thread_local_address (struct target_ops *self, ptid_t arg1, CORE_ADDR arg2, CORE_ADDR arg3)
+{
+ self = self->beneath;
+ return self->to_get_thread_local_address (self, arg1, arg2, arg3);
+}
+
+static CORE_ADDR
+tdefault_get_thread_local_address (struct target_ops *self, ptid_t arg1, CORE_ADDR arg2, CORE_ADDR arg3)
+{
+ generic_tls_error ();
+}
+
static enum target_xfer_status
delegate_xfer_partial (struct target_ops *self, enum target_object arg1, const char *arg2, gdb_byte *arg3, const gdb_byte *arg4, ULONGEST arg5, ULONGEST arg6, ULONGEST *arg7)
{
@@ -1781,6 +1794,8 @@ install_delegators (struct target_ops *ops)
ops->to_get_bookmark = delegate_get_bookmark;
if (ops->to_goto_bookmark == NULL)
ops->to_goto_bookmark = delegate_goto_bookmark;
+ if (ops->to_get_thread_local_address == NULL)
+ ops->to_get_thread_local_address = delegate_get_thread_local_address;
if (ops->to_xfer_partial == NULL)
ops->to_xfer_partial = delegate_xfer_partial;
if (ops->to_memory_map == NULL)
@@ -1995,6 +2010,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_make_corefile_notes = dummy_make_corefile_notes;
ops->to_get_bookmark = tdefault_get_bookmark;
ops->to_goto_bookmark = tdefault_goto_bookmark;
+ ops->to_get_thread_local_address = tdefault_get_thread_local_address;
ops->to_xfer_partial = tdefault_xfer_partial;
ops->to_memory_map = tdefault_memory_map;
ops->to_flash_erase = tdefault_flash_erase;