diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2005-10-13 09:31:59 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2005-10-13 09:31:59 +0000 |
commit | 16451949d7083391405bb46c06a2fadac01f5c42 (patch) | |
tree | 85c570c1c9b46020ef962d4e4f685a1266fc0be5 /gdb | |
parent | 4d443107ba8c5dccc370a701135e4bacd2adc9a4 (diff) | |
download | gdb-16451949d7083391405bb46c06a2fadac01f5c42.zip gdb-16451949d7083391405bb46c06a2fadac01f5c42.tar.gz gdb-16451949d7083391405bb46c06a2fadac01f5c42.tar.bz2 |
* Makefile.in (linux-thread-db.o): Depend on $(gdbcore_h).
* linux-thread-db.c (enable_thread_event): Extend pointer value as
specified by target.
(thread_db_get_thread_local_address): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 18 |
3 files changed, 23 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 13a0717..b02727d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2005-10-13 Andreas Schwab <schwab@suse.de> + + * Makefile.in (linux-thread-db.o): Depend on $(gdbcore_h). + + * linux-thread-db.c (enable_thread_event): Extend pointer value as + specified by target. + (thread_db_get_thread_local_address): Likewise. + 2005-10-09 Joel Brobecker <brobecker@adacore.com> * i386-tdep.c (i386_reg_struct_return_p): Allow array types as well. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 8ea5329..02eaa44 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2182,7 +2182,7 @@ linux-nat.o: linux-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdb_string_h) \ linux-thread-db.o: linux-thread-db.c $(defs_h) $(gdb_assert_h) \ $(gdb_proc_service_h) $(gdb_thread_db_h) $(bfd_h) $(exceptions_h) \ $(gdbthread_h) $(inferior_h) $(symfile_h) $(objfiles_h) $(target_h) \ - $(regcache_h) $(solib_svr4_h) + $(regcache_h) $(solib_svr4_h) $(gdbcore_h) lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(regcache_h) m2-exp.o: m2-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 6bd5b42..3c71bea 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -36,6 +36,7 @@ #include "target.h" #include "regcache.h" #include "solib-svr4.h" +#include "gdbcore.h" #ifdef HAVE_GNU_LIBC_VERSION_H #include <gnu/libc-version.h> @@ -505,9 +506,14 @@ enable_thread_event (td_thragent_t *thread_agent, int event, CORE_ADDR *bp) return err; /* Set up the breakpoint. */ - (*bp) = gdbarch_convert_from_func_ptr_addr (current_gdbarch, - (CORE_ADDR) notify.u.bptaddr, - ¤t_target); + gdb_assert (exec_bfd); + (*bp) = (gdbarch_convert_from_func_ptr_addr + (current_gdbarch, + /* Do proper sign extension for the target. */ + (bfd_get_sign_extend_vma (exec_bfd) > 0 + ? (CORE_ADDR) (intptr_t) notify.u.bptaddr + : (CORE_ADDR) (uintptr_t) notify.u.bptaddr), + ¤t_target)); create_thread_event_breakpoint ((*bp)); return TD_OK; @@ -1277,7 +1283,11 @@ thread_db_get_thread_local_address (ptid_t ptid, (("%s")), thread_db_err_str (err)); /* Cast assuming host == target. Joy. */ - return (CORE_ADDR) address; + /* Do proper sign extension for the target. */ + gdb_assert (exec_bfd); + return (bfd_get_sign_extend_vma (exec_bfd) > 0 + ? (CORE_ADDR) (intptr_t) address + : (CORE_ADDR) (uintptr_t) address); } if (target_beneath->to_get_thread_local_address) |