This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Multi-thread core file support for OpenBSD
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: binutils at sourceware dot org
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 1 Jan 2012 13:36:11 +0100 (CET)
- Subject: [PATCH] Multi-thread core file support for OpenBSD
Our core files are modelled after NetBSD's, so this re-uses the NetBSD
code to get the thread/LWP IDs.
ok?
2012-01-01 Mark Kettenis <kettenis@gnu.org>
* elf.c (elfcore_grok_openbsd_note): Initialize core_lwpid.
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.546
diff -u -p -r1.546 elf.c
--- elf.c 13 Dec 2011 14:02:18 -0000 1.546
+++ elf.c 1 Jan 2012 12:32:31 -0000
@@ -8642,6 +8642,11 @@ elfcore_grok_openbsd_procinfo (bfd *abfd
static bfd_boolean
elfcore_grok_openbsd_note (bfd *abfd, Elf_Internal_Note *note)
{
+ int lwp;
+
+ if (elfcore_netbsd_get_lwpid (note, &lwp))
+ elf_tdata (abfd)->core_lwpid = lwp;
+
if (note->type == NT_OPENBSD_PROCINFO)
return elfcore_grok_openbsd_procinfo (abfd, note);