binutils-gdb/gdb/nat
Pedro Alves 96e9210fd6 C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c
Implicit void * -> function pointer conversion doesn't work in C++, so
in C++, we need to cast the result of dlsym.  This adds a few typedefs
and macros that make this easy.  GDBserver's version already had the
CHK macro, so I added it to GDB too.

Tested on x86_64 Fedora 20, native and gdbserver.

gdb/gdbserver/ChangeLog:
2015-08-04  Pedro Alves  <palves@redhat.com>

	* thread-db.c (struct thread_db): Use new typedefs.
	(try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
	CHK calls.
	(disable_thread_event_reporting): Cast result of dlsym to
	destination function pointer type.
	(thread_db_mourn): Use td_ta_delete_ftype.

gdb/ChangeLog:
2015-08-04  Pedro Alves  <palves@redhat.com>

	* nat/gdb_thread_db.h (td_init_ftype, td_ta_new_ftype)
	(td_ta_map_lwp2thr_ftype, td_ta_thr_iter_ftype)
	(td_ta_event_addr_ftype, td_ta_set_event_ftype)
	(td_ta_clear_event_ftype, td_ta_event_getmsg_ftype)
	(td_thr_validate_ftype, td_thr_get_info_ftype)
	(td_thr_event_enable_ftype, td_thr_tls_get_addr_ftype)
	(td_thr_tlsbase_ftype, td_symbol_list_ftype, td_ta_delete_ftype):
	New typedefs.
	* linux-thread-db.c (struct thread_db_info): Use new typedefs.
	(try_thread_db_load_1): Define TDB_VERBOSE_DLSYM, TDB_DLSYM , CHK
	local macros and use them instead of verbose_dlsym and dlsym
	calls.
2015-08-04 09:39:47 +01:00
..
aarch64-linux-hw-point.c Move aarch64_linux_get_debug_reg_capacity to nat/aarch64-linux-hw-point.c 2015-07-21 16:33:41 +01:00
aarch64-linux-hw-point.h Move aarch64_linux_get_debug_reg_capacity to nat/aarch64-linux-hw-point.c 2015-07-21 16:33:41 +01:00
gdb_ptrace.h C++: handle glibc's ptrace(enum __ptrace_request, ...) 2015-07-24 15:12:15 +01:00
gdb_thread_db.h C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c 2015-08-04 09:39:47 +01:00
glibc_thread_db.h
linux-btrace.c Linux: sys/ptrace.h -> nat/gdb_ptrace.h everywhere 2015-07-24 15:14:47 +01:00
linux-btrace.h ari, btrace: avoid unsigned long long 2015-07-15 08:40:57 +02:00
linux-namespaces.c Fix build issue with nat/linux-namespaces.c. 2015-07-14 10:46:16 -05:00
linux-namespaces.h Introduce nat/linux-namespaces.[ch] 2015-06-10 14:28:43 +01:00
linux-nat.h Include header for enum target_stop_reason 2015-05-15 16:00:40 +01:00
linux-osdata.c
linux-osdata.h
linux-personality.c
linux-personality.h
linux-procfs.c Remove linux_proc_pid_get_ns 2015-06-10 14:28:43 +01:00
linux-procfs.h Remove linux_proc_pid_get_ns 2015-06-10 14:28:43 +01:00
linux-ptrace.c Linux: sys/ptrace.h -> nat/gdb_ptrace.h everywhere 2015-07-24 15:14:47 +01:00
linux-ptrace.h Linux: sys/ptrace.h -> nat/gdb_ptrace.h everywhere 2015-07-24 15:14:47 +01:00
linux-waitpid.c
linux-waitpid.h
mips-linux-watch.c Mostly trivial enum fixes 2015-07-31 13:19:53 -04:00
mips-linux-watch.h Mostly trivial enum fixes 2015-07-31 13:19:53 -04:00
ppc-linux.c
ppc-linux.h
x86-cpuid.h
x86-dregs.c
x86-dregs.h
x86-gcc-cpuid.h
x86-linux-dregs.c Linux: sys/ptrace.h -> nat/gdb_ptrace.h everywhere 2015-07-24 15:14:47 +01:00
x86-linux-dregs.h
x86-linux.c
x86-linux.h