This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 3/6] Display per-thread information for threads in FreeBSD cores.
- From: John Baldwin <jhb at freebsd dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, binutils at sourceware dot org
- Date: Mon, 18 Jan 2016 09:05:49 -0800
- Subject: Re: [PATCH v2 3/6] Display per-thread information for threads in FreeBSD cores.
- Authentication-results: sourceware.org; auth=none
- References: <1452721551-657-1-git-send-email-jhb at FreeBSD dot org> <2320320 dot x23qbZCVbY at ralph dot baldwin dot cx> <569CDA29 dot 3050000 at redhat dot com>
On Monday, January 18, 2016 12:27:21 PM Pedro Alves wrote:
> On 01/15/2016 08:13 PM, John Baldwin wrote:
> > On Thursday, January 14, 2016 03:03:50 PM Pedro Alves wrote:
> >> Is this ".thrmisc" section documented somewhere? Could you add a
> >> small comment on what this entry you're skipping means?
> >
> > It is not documented aside from the code unfortunately. :( If I had my
> > way we would be dumping the full ptrace_lwpinfo structure that contains
> > per-LWP info used by the 'nat' target instead (it has other potentially
> > useful information such as the siginfo_t for each thread). At the moment
> > I don't generate a NT_THRMISC note in 'gcore' because 'struct thrmisc' is
> > currently only present in FreeBSD's headers.
>
> I think just having a comment mentioning that this note contains
> the "struct thrmisc" structure, which contains the thread name, would
> be helpful.
Ok.
> But, if this is about the thread name, is there a reason you're hacking it
> through fbsd_core_pid_to_str, rather than hooking this up
> through "thread name" ?
Hmm, would this work for cross-debugging a core file? fbsd_thread_name is
currently only defined for native debugging, whereas core_pid_to_str is a
gdbarch method on the ABI so it can be used to extract thread names from
non-native cores.
Alternatively, would it be best if the core target defined a to_thread_name
method that invoked a new gdbarch method (gdbarch_core_thread_name or the
like) to fetch the thread name?
--
John Baldwin