diff options
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gdb/target.c b/gdb/target.c index 8d7f168..a854a98 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 (); @@ -3194,8 +3204,8 @@ target_ops::fileio_fstat (int fd, struct stat *sb, fileio_error *target_errno) } int -target_ops::fileio_stat (struct inferior *inf, const char *filename, - struct stat *sb, fileio_error *target_errno) +target_ops::fileio_lstat (struct inferior *inf, const char *filename, + struct stat *sb, fileio_error *target_errno) { *target_errno = FILEIO_ENOSYS; return -1; @@ -3321,17 +3331,17 @@ target_fileio_fstat (int fd, struct stat *sb, fileio_error *target_errno) /* See target.h. */ int -target_fileio_stat (struct inferior *inf, const char *filename, - struct stat *sb, fileio_error *target_errno) +target_fileio_lstat (struct inferior *inf, const char *filename, + struct stat *sb, fileio_error *target_errno) { for (target_ops *t = default_fileio_target (); t != NULL; t = t->beneath ()) { - int ret = t->fileio_stat (inf, filename, sb, target_errno); + int ret = t->fileio_lstat (inf, filename, sb, target_errno); if (ret == -1 && *target_errno == FILEIO_ENOSYS) continue; - target_debug_printf_nofunc ("target_fileio_stat (%s) = %d (%d)", + target_debug_printf_nofunc ("target_fileio_lstat (%s) = %d (%d)", filename, ret, ret != -1 ? 0 : *target_errno); return ret; |