From de43d7d0059427148461aede30bb07db993fae4b Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Sat, 16 Oct 1993 06:42:02 +0000 Subject: * breakpoint.c (breakpoint_thread_match break_command_1): Thread-specific breakpoint support. * breakpoint.h (struct breakpoint): Add thread id field. * fork-child.c (fork_inferior): Move call to init_thread_list() back a bit so that init_trace_fun can do thread functions. * hppa-tdep.c (restore_pc_queue): Add pid to call to target_wait. * hppab-nat.c (child_resume): Handle default pid. * hppah-nat.c (child_resume): Handle default pid. * i386lynx-nat.c (child_wait): New arg pid. * inflow.c (kill_command): Reset thread list. * infptrace.c (child_resume): Handle default pid. * infrun.c: Thread-specific breakpoint support. * inftarg.c (child_wait): Add pid arg. * osfsolib.c (solib_create_inferior_hook): Add pid to call to target_resume. * procfs.c: Multi-thread support. * remote-bug.c (bug_wait): Add pid arg. * remote-hms.c (hms_wait): Add pid arg. * remote-mips.c (mips_wait): Add pid arg. * remote-mon.c (monitor_wait): Add pid arg. * remote-nindy.c (nindy_wait): Add pid arg. * remote-sim.c (gdbsim_wait): Add pid arg. * remote-udi.c (udi_wait): Add pid arg. * remote-vx.c (vx_wait): Add pid arg. * remote-z8k.c (sim_wait): Add pid arg. * remote.c (remote_wait): Add pid arg. * solib.c (solib_create_inferior_hook): Add pid to call to target_resume. * target.h (struct target_ops): Add pid arg to to_wait and to_notice_signals. * thread.c (valid_thread_id): New func to validate thread #s. * (pid_to_thread_id): New func to do the obvious. * thread.h: Prototypes for above. * coff-solib.c (coff_solib_add): Use nameoffset field to locate filename. --- gdb/thread.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gdb/thread.c') diff --git a/gdb/thread.c b/gdb/thread.c index fdc13bc..f14b41f 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -51,6 +51,8 @@ static void prune_threads PARAMS ((void)); static void thread_switch PARAMS ((int pid)); +static struct thread_info * find_thread_id PARAMS ((int num)); + void init_thread_list () { @@ -97,6 +99,32 @@ find_thread_id (num) } int +valid_thread_id (num) + int num; +{ + struct thread_info *tp; + + for (tp = thread_list; tp; tp = tp->next) + if (tp->num == num) + return 1; + + return 0; +} + +int +pid_to_thread_id (pid) + int pid; +{ + struct thread_info *tp; + + for (tp = thread_list; tp; tp = tp->next) + if (tp->pid == pid) + return tp->num; + + return 0; +} + +int in_thread_list (pid) int pid; { -- cgit v1.1