This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Put a NT_PSTATUS note on solaris cores.
On Sunday 11 October 2009 23:35:19, Paul Pluzhnikov wrote:
> On Sun, Oct 11, 2009 at 3:10 PM, Pedro Alves <pedro@codesourcery.com> wrote:
>
> Index: src/gdb/procfs.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- src.orig/gdb/procfs.c 2009-10-09 02:55:25.000000000 +0100
> +++ src/gdb/procfs.c 2009-10-11 22:47:49.000000000 +0100
>
> Looks like your KMail took a hint from my Gmail, and decided to do
> quoted-printable encoding of the patch :-(
> I am having a bit of trouble restoring sanity to it.
:-) Bad KMail!
--
Pedro Alves
2009-06-03 Daniel Gutson <dgutson@codesourcery.com>
gdb/
* procfs.c (procfs_do_thread_registers): If NEW_PROC_API is
defined, use elfcore_write_lwpstatus.
bfd/
* elf.c: Define _STRUCTURED_PROC before including sys/procfs.h.
* bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURED_PROC
before including procfs.h.
(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): Likewise.
* configure.in: Added autoconf probe for the pr_fpreg member.
* configure: Regenerated.
* config.in: Regenerated.
---
bfd/bfd.m4 | 4 +++
bfd/config.in | 3 ++
bfd/configure | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
bfd/configure.in | 1
bfd/elf.c | 2 +
gdb/procfs.c | 2 -
6 files changed, 80 insertions(+), 1 deletion(-)
Index: src/gdb/procfs.c
===================================================================
--- src.orig/gdb/procfs.c 2009-10-09 02:55:25.000000000 +0100
+++ src/gdb/procfs.c 2009-10-11 22:47:49.000000000 +0100
@@ -6063,7 +6063,7 @@ procfs_do_thread_registers (bfd *obfd, p
merged_pid = TIDGET (ptid) << 16 | PIDGET (ptid);
fill_gregset (regcache, &gregs, -1);
-#if defined (UNIXWARE)
+#if defined (UNIXWARE) || defined (NEW_PROC_API)
note_data = (char *) elfcore_write_lwpstatus (obfd,
note_data,
note_size,
Index: src/bfd/elf.c
===================================================================
--- src.orig/bfd/elf.c 2009-09-28 18:03:35.000000000 +0100
+++ src/bfd/elf.c 2009-10-11 22:46:55.000000000 +0100
@@ -7420,6 +7420,8 @@ _bfd_elf_rel_vtable_reloc_fn
out details about the corefile. */
#ifdef HAVE_SYS_PROCFS_H
+/* Needed for new procfs interface on sparc-solaris. */
+# define _STRUCTURED_PROC 1
# include <sys/procfs.h>
#endif
Index: src/bfd/bfd.m4
===================================================================
--- src.orig/bfd/bfd.m4 2009-09-14 18:36:15.000000000 +0100
+++ src/bfd/bfd.m4 2009-10-11 22:46:55.000000000 +0100
@@ -8,6 +8,8 @@ AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE],
AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1,
[AC_TRY_COMPILE([
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>],
[$1 avar],
bfd_cv_have_sys_procfs_type_$1=yes,
@@ -27,6 +29,8 @@ AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBE
AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2,
[AC_TRY_COMPILE([
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>],
[$1 avar; void* aref = (void*) &avar.$2],
bfd_cv_have_sys_procfs_type_member_$1_$2=yes,
Index: src/bfd/configure.in
===================================================================
--- src.orig/bfd/configure.in 2009-09-30 02:36:48.000000000 +0100
+++ src/bfd/configure.in 2009-10-11 22:46:55.000000000 +0100
@@ -500,6 +500,7 @@ changequote([,])dnl
BFD_HAVE_SYS_PROCFS_TYPE(lwpxstatus_t)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_context)
BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_reg)
+ BFD_HAVE_SYS_PROCFS_TYPE_MEMBER(lwpstatus_t, pr_fpreg)
BFD_HAVE_SYS_PROCFS_TYPE(win32_pstatus_t)
fi
fi
Index: src/bfd/configure
===================================================================
--- src.orig/bfd/configure 2009-09-30 02:36:48.000000000 +0100
+++ src/bfd/configure 2009-10-11 22:48:22.000000000 +0100
@@ -13923,6 +13923,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -13958,6 +13960,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -13993,6 +13997,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14028,6 +14034,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14063,6 +14071,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14098,6 +14108,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14133,6 +14145,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14168,6 +14182,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14203,6 +14219,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14238,6 +14256,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14273,6 +14293,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14308,6 +14330,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14343,6 +14367,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14378,6 +14404,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14413,6 +14441,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
@@ -14439,6 +14469,43 @@ $as_echo "#define HAVE_LWPSTATUS_T_PR_RE
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&5
$as_echo "$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpstatus_t.pr_fpreg in sys/procfs.h" >&5
+$as_echo_n "checking for lwpstatus_t.pr_fpreg in sys/procfs.h... " >&6; }
+ if test "${bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
+#include <sys/procfs.h>
+int
+main ()
+{
+lwpstatus_t avar; void* aref = (void*) &avar.pr_fpreg
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg=yes
+else
+ bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg = yes; then
+
+$as_echo "#define HAVE_LWPSTATUS_T_PR_FPREG 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg" >&5
+$as_echo "$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_fpreg" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for win32_pstatus_t in sys/procfs.h" >&5
$as_echo_n "checking for win32_pstatus_t in sys/procfs.h... " >&6; }
if test "${bfd_cv_have_sys_procfs_type_win32_pstatus_t+set}" = set; then :
@@ -14448,6 +14515,8 @@ else
/* end confdefs.h. */
#define _SYSCALL32
+/* Needed for new procfs interface on sparc-solaris. */
+#define _STRUCTURED_PROC 1
#include <sys/procfs.h>
int
main ()
Index: src/bfd/config.in
===================================================================
--- src.orig/bfd/config.in 2009-09-14 18:36:15.000000000 +0100
+++ src/bfd/config.in 2009-10-11 22:46:55.000000000 +0100
@@ -114,6 +114,9 @@
/* Define if <sys/procfs.h> has lwpstatus_t.pr_context. */
#undef HAVE_LWPSTATUS_T_PR_CONTEXT
+/* Define if <sys/procfs.h> has lwpstatus_t.pr_fpreg. */
+#undef HAVE_LWPSTATUS_T_PR_FPREG
+
/* Define if <sys/procfs.h> has lwpstatus_t.pr_reg. */
#undef HAVE_LWPSTATUS_T_PR_REG