diff options
author | attilio <attilio@FreeBSD.org> | 2010-11-22 14:42:13 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2010-11-22 14:42:13 +0000 |
commit | 7718cbcbf47164ddaa66a748a050f670b3b37e1d (patch) | |
tree | 8831ac1227984e07e03c6ac1b5cf30bba847610f /sys/kern/sys_process.c | |
parent | 225a98d4466b7d72ce67e249a3976b499437e798 (diff) | |
download | FreeBSD-src-7718cbcbf47164ddaa66a748a050f670b3b37e1d.zip FreeBSD-src-7718cbcbf47164ddaa66a748a050f670b3b37e1d.tar.gz |
Add the ability for GDB to printout the thread name along with other
thread specific informations.
In order to do that, and in order to avoid KBI breakage with existing
infrastructure the following semantic is implemented:
- For live programs, a new member to the PT_LWPINFO is added (pl_tdname)
- For cores, a new ELF note is added (NT_THRMISC) that can be used for
storing thread specific, miscellaneous, informations. Right now it is
just popluated with a thread name.
GDB, then, retrieves the correct informations from the corefile via the
BFD interface, as it groks the ELF notes and create appropriate
pseudo-sections.
Sponsored by: Sandvine Incorporated
Tested by: gianni
Discussed with: dim, kan, kib
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index af6b298..e5d9842 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -93,6 +93,7 @@ struct ptrace_lwpinfo32 { sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct siginfo32 pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ }; #endif @@ -520,6 +521,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, pl32->pl_sigmask = pl->pl_sigmask; pl32->pl_siglist = pl->pl_siglist; siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); + strcpy(pl32->pl_tdname, pl->pl_tdname); } #endif /* COMPAT_FREEBSD32 */ @@ -1164,6 +1166,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) pl->pl_flags |= PL_FLAG_EXEC; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; + strcpy(pl->pl_tdname, td2->td_name); #ifdef COMPAT_FREEBSD32 if (wrap32) ptrace_lwpinfo_to32(pl, pl32); |