Index: sys/kern/imgact_elf.c =================================================================== --- sys/kern/imgact_elf.c (revision 214027) +++ sys/kern/imgact_elf.c (working copy) @@ -1401,6 +1401,7 @@ fill_regs(thr, &status->pr_reg); fill_fpregs(thr, fpregset); #endif + strcpy(status->pr_tname, thr->td_name); } __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, sizeof *status); Index: sys/kern/sys_process.c =================================================================== --- sys/kern/sys_process.c (revision 214027) +++ sys/kern/sys_process.c (working copy) @@ -93,6 +93,7 @@ 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 @@ 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 @@ 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); Index: sys/sys/procfs.h =================================================================== --- sys/sys/procfs.h (revision 214027) +++ sys/sys/procfs.h (working copy) @@ -34,6 +34,7 @@ typedef struct reg gregset_t; typedef struct fpreg fpregset_t; +typedef char[MAXCOMLEN + 1] thrname_t; /* * These structures define an interface between core files and the debugger. @@ -52,7 +53,7 @@ * for which each element exists in the structure. */ -#define PRSTATUS_VERSION 1 /* Current version of prstatus_t */ +#define PRSTATUS_VERSION 2 /* Current version of prstatus_t */ typedef struct prstatus { int pr_version; /* Version number of struct (1) */ @@ -63,6 +64,7 @@ int pr_cursig; /* Current signal (1) */ pid_t pr_pid; /* Process ID (1) */ gregset_t pr_reg; /* General purpose registers (1) */ + thrname_t pr_tname; /* Thread specific name (2) */ } prstatus_t; typedef gregset_t prgregset_t[1]; Index: sys/sys/ptrace.h =================================================================== --- sys/sys/ptrace.h (revision 214027) +++ sys/sys/ptrace.h (working copy) @@ -106,6 +106,7 @@ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name */ }; /* Argument structure for PT_VM_ENTRY. */