From d56a014b6e3794e617dc3f2405227fe4727afb9f Mon Sep 17 00:00:00 2001 From: David Xu Date: Tue, 7 Feb 2006 02:29:55 +0000 Subject: [PATCH] Introduce a new proc service routine ps_linfo() to get LWP info. --- gnu/usr.bin/gdb/libgdb/fbsd-threads.c | 14 ++++++++++++++ include/proc_service.h | 1 + 2 files changed, 15 insertions(+) diff --git a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c index e9f83a90d566..b88b73f1f248 100644 --- a/gnu/usr.bin/gdb/libgdb/fbsd-threads.c +++ b/gnu/usr.bin/gdb/libgdb/fbsd-threads.c @@ -1685,3 +1685,17 @@ ps_lcontinue(struct ps_prochandle *ph, lwpid_t lwpid) return PS_ERR; return PS_OK; } + +ps_err_e +ps_linfo(struct ps_prochandle *ph, lwpid_t lwpid, void *info) +{ + if (fbsd_thread_core) { + /* XXX should verify lwpid and make a pseudo lwp info */ + memset(info, 0, sizeof(struct ptrace_lwpinfo)); + return PS_OK; + } + + if (ptrace (PT_LWPINFO, lwpid, info, sizeof(struct ptrace_lwpinfo)) == -1) + return PS_ERR; + return PS_OK; +} diff --git a/include/proc_service.h b/include/proc_service.h index 0299b959df88..c9e6f27b4ef7 100644 --- a/include/proc_service.h +++ b/include/proc_service.h @@ -56,6 +56,7 @@ ps_err_e ps_lgetxmmregs (struct ps_prochandle *, lwpid_t, char *); ps_err_e ps_lsetxmmregs (struct ps_prochandle *, lwpid_t, const char *); #endif ps_err_e ps_lstop(struct ps_prochandle *, lwpid_t); +ps_err_e ps_linfo(struct ps_prochandle *, lwpid_t, void *); ps_err_e ps_pcontinue(struct ps_prochandle *); ps_err_e ps_pdmodel(struct ps_prochandle *, int *); ps_err_e ps_pglobal_lookup(struct ps_prochandle *, const char *, const char *,