aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 8d7f168..522bed8 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1,6 +1,6 @@
/* Select target systems and architectures at runtime for GDB.
- Copyright (C) 1990-2024 Free Software Foundation, Inc.
+ Copyright (C) 1990-2025 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -1250,11 +1250,21 @@ generic_tls_error (void)
_("Cannot find thread-local variables on this target"));
}
-/* Using the objfile specified in OBJFILE, find the address for the
- current thread's thread-local storage with offset OFFSET. */
+/* See target.h. */
+
CORE_ADDR
-target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
+target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset,
+ const char *name)
{
+ if (!target_has_registers ())
+ {
+ if (name == nullptr)
+ error (_("Cannot translate TLS address without registers"));
+ else
+ error (_("Cannot find address of TLS symbol `%s' without registers"),
+ name);
+ }
+
volatile CORE_ADDR addr = 0;
struct target_ops *target = current_inferior ()->top_target ();
gdbarch *gdbarch = current_inferior ()->arch ();