diff options
author | David Taylor <taylor@redhat.com> | 1997-10-24 21:04:39 +0000 |
---|---|---|
committer | David Taylor <taylor@redhat.com> | 1997-10-24 21:04:39 +0000 |
commit | 022278948f2034198be6cdc95cb4bc9b71122698 (patch) | |
tree | 5f7781a60687fb368524c0b324d5cd28a812cfaa /gdb/sol-thread.c | |
parent | c14d0cc015fa03494f029143e529cb71cc906eec (diff) | |
download | gdb-022278948f2034198be6cdc95cb4bc9b71122698.zip gdb-022278948f2034198be6cdc95cb4bc9b71122698.tar.gz gdb-022278948f2034198be6cdc95cb4bc9b71122698.tar.bz2 |
fix for PR 13618 -- gdb incorrectly reports thread information.
If other systems besides nm-sun4sol2 exhibit the problem, they may need
definitions of FIND_NEW_THREADS and a corresponding support function.
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r-- | gdb/sol-thread.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index cc61c6a..aa69c0d 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1239,6 +1239,43 @@ solaris_pid_to_str (pid) } +/* Worker bee for find_new_threads + Callback function that gets called once per USER thread (i.e., not + kernel) thread. */ + +static int +sol_find_new_threads_callback(th, ignored) + const td_thrhandle_t *th; + void *ignored; +{ + td_err_e retval; + td_thrinfo_t ti; + int pid; + + if ((retval = p_td_thr_get_info(th, &ti)) != TD_OK) + { + return -1; + } + pid = BUILD_THREAD(ti.ti_tid, PIDGET(inferior_pid)); + if (!in_thread_list(pid)) + add_thread(pid); + + return 0; +} + +void +sol_find_new_threads() +{ + if (inferior_pid == -1) + { + printf_filtered("No process.\n"); + return; + } + p_td_ta_thr_iter (main_ta, sol_find_new_threads_callback, (void *)0, + TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, + TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); +} + #ifdef MAINTENANCE_CMDS /* Worker bee for info sol-thread command. This is a callback function that gets called once for each Solaris thread (ie. not kernel thread) in the |