aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-thread-db.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-12-19 00:29:11 +0000
committerDoug Evans <dje@google.com>2009-12-19 00:29:11 +0000
commit00f515dab69c7c12fc558402a9a701e28a787523 (patch)
tree36450b1561d8e091d95a75a7f2567f9478fe8d8e /gdb/linux-thread-db.c
parent42853c79aa14e4246cbfa94d41c96375b560cc84 (diff)
downloadgdb-00f515dab69c7c12fc558402a9a701e28a787523.zip
gdb-00f515dab69c7c12fc558402a9a701e28a787523.tar.gz
gdb-00f515dab69c7c12fc558402a9a701e28a787523.tar.bz2
gdb/
* gdb_proc_service.h (psaddr_t): Fix type. * linux-thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix signature to match glibc. (thread_db_get_thread_local_address): Use psaddr_t for type of address to match parameter of td_thr_tls_get_addr_p. Cast through psaddr_t instead of (void*) to match parameter of td_thr_tls_get_addr_p. gdbserver/ * gdb_proc_service.h (psaddr_t): Fix type. * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix signature to match glibc.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r--gdb/linux-thread-db.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index c48b870..77ffa56 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -153,8 +153,8 @@ struct thread_db_info
int event);
td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th,
- void *map_address,
- size_t offset, void **address);
+ psaddr_t map_address,
+ size_t offset, psaddr_t *address);
};
/* List of known processes using thread_db, and the required
@@ -1530,7 +1530,7 @@ thread_db_get_thread_local_address (struct target_ops *ops,
if (thread_info != NULL && thread_info->private != NULL)
{
td_err_e err;
- void *address;
+ psaddr_t address;
struct thread_db_info *info;
info = get_thread_db_info (GET_PID (ptid));
@@ -1544,8 +1544,11 @@ thread_db_get_thread_local_address (struct target_ops *ops,
gdb_assert (lm != 0);
/* Finally, get the address of the variable. */
+ /* Note the cast through uintptr_t: this interface only works if
+ a target address fits in a psaddr_t, which is a host pointer.
+ So a 32-bit debugger can not access 64-bit TLS through this. */
err = info->td_thr_tls_get_addr_p (&thread_info->private->th,
- (void *)(size_t) lm,
+ (psaddr_t)(uintptr_t) lm,
offset, &address);
#ifdef THREAD_DB_HAS_TD_NOTALLOC