2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.texinfo (Server): Document libthread-db-search-path.

gdbserver/
2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
	* configure.ac: Adjust.
	* linux-low.h (struct process_info_private): Move members to struct
	thread_db.
	(thread_db_free, thread_db_handle_monitor_command): New prototype.
	* linux-low.c (linux_remove_process): Adjust.
	(linux_wait_for_event_1, linux_look_up_symbols): Likewise.
	* server.c (handle_query): Move code ...
	(handle_monitor_command): ... here. New function.
	* target.h (struct target_ops): New member.
	* thread-db.c (struct thread_db): New.
	(libthread_db_search_path): New variable.
	(thread_db_create_event, thread_db_enable_reporting)
	(find_one_thread, maybe_attach_thread, find_new_threads_callback)
	(thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
	(try_thread_db_load_1, dladdr_to_soname): New functions.
	(try_thread_db_load, thread_db_load_search): New functions.
	(thread_db_init): Search for libthread_db.
	(thread_db_free): New function.
	(thread_db_handle_monitor_command): Likewise.
	* config.in: Regenerate.
	* configure: Regenerate.
This commit is contained in:
Paul Pluzhnikov
2009-10-09 00:31:01 +00:00
parent 37e124c9c3
commit cdbfd4198e
11 changed files with 432 additions and 343 deletions

View File

@ -261,8 +261,14 @@ linux_add_process (int pid, int attached)
static void
linux_remove_process (struct process_info *process)
{
free (process->private->arch_private);
free (process->private);
struct process_info_private *priv = process->private;
#ifdef USE_THREAD_DB
thread_db_free (process);
#endif
free (priv->arch_private);
free (priv);
remove_process (process);
}
@ -1122,7 +1128,7 @@ linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options)
&& !event_child->stepping
&& (
#ifdef USE_THREAD_DB
(current_process ()->private->thread_db_active
(current_process ()->private->thread_db != NULL
&& (WSTOPSIG (*wstat) == __SIGRTMIN
|| WSTOPSIG (*wstat) == __SIGRTMIN + 1))
||
@ -2642,11 +2648,10 @@ linux_look_up_symbols (void)
#ifdef USE_THREAD_DB
struct process_info *proc = current_process ();
if (proc->private->thread_db_active)
if (proc->private->thread_db != NULL)
return;
proc->private->thread_db_active
= thread_db_init (!linux_supports_tracefork_flag);
thread_db_init (!linux_supports_tracefork_flag);
#endif
}
@ -3171,7 +3176,12 @@ static struct target_ops linux_target_ops = {
linux_supports_non_stop,
linux_async,
linux_start_non_stop,
linux_supports_multi_process
linux_supports_multi_process,
#ifdef USE_THREAD_DB
thread_db_handle_monitor_command
#else
NULL
#endif
};
static void