Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Put a NT_PSTATUS note on solaris cores.
@ 2009-10-09  1:36 Pedro Alves
  2009-10-11 21:21 ` Paul Pluzhnikov
  0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-10-09  1:36 UTC (permalink / raw)
  To: gdb-patches

This patch makes is to that cores generated with gdb's gcore on
solaris also get an NT_PSTATUS note.  It is from this note that gdb can
extract the original pid of the process from the core.  From higher
up on procfs.c, I see that pstatus_t is assumed to be defined when
NEW_PROC_API is defined, so I think this is safe to not break builds.
NEW_PROC_API is also always defined on unixware hosts.  I'm not
caring for older solaris not using the new proc api.

That bit of ifdefed code wasn't building without the stop_signal
tweak, meaning that the unixware build has been broken
for months and nobody complained.

Checked in.

-- 
Pedro Alves

2009-10-09  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* procfs.c (procfs_make_note_section): Always output a NT_PSTATUS
	note when NEW_PROC_API is defined.

---
 gdb/procfs.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: src/gdb/procfs.c
===================================================================
--- src.orig/gdb/procfs.c	2009-08-08 14:38:01.000000000 +0100
+++ src/gdb/procfs.c	2009-10-09 02:24:06.000000000 +0100
@@ -6126,6 +6126,7 @@ procfs_make_note_section (bfd *obfd, int
   struct procfs_corefile_thread_data thread_args;
   gdb_byte *auxv;
   int auxv_len;
+  enum target_signal stop_signal;
 
   if (get_exec_file (0))
     {
@@ -6150,7 +6151,9 @@ procfs_make_note_section (bfd *obfd, int
 					       fname,
 					       psargs);
 
-#ifdef UNIXWARE
+  stop_signal = find_stop_signal ();
+
+#ifdef NEW_PROC_API
   fill_gregset (get_current_regcache (), &gregs, -1);
   note_data = elfcore_write_pstatus (obfd, note_data, note_size,
 				     PIDGET (inferior_ptid),
@@ -6160,7 +6163,7 @@ procfs_make_note_section (bfd *obfd, int
   thread_args.obfd = obfd;
   thread_args.note_data = note_data;
   thread_args.note_size = note_size;
-  thread_args.stop_signal = find_stop_signal ();
+  thread_args.stop_signal = stop_signal;
   proc_iterate_over_threads (pi, procfs_corefile_thread_callback, &thread_args);
 
   /* There should be always at least one thread.  */


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-09  1:36 Put a NT_PSTATUS note on solaris cores Pedro Alves
@ 2009-10-11 21:21 ` Paul Pluzhnikov
  2009-10-11 22:10   ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Pluzhnikov @ 2009-10-11 21:21 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Thu, Oct 8, 2009 at 6:36 PM, Pedro Alves <pedro@codesourcery.com> wrote:

> 2009-10-09  Pedro Alves  <pedro@codesourcery.com>
>
>        gdb/
>        * procfs.c (procfs_make_note_section): Always output a NT_PSTATUS
>        note when NEW_PROC_API is defined.

This causes build failure on 32-bit solaris-10:

gcc -g -O2      \
        -o gdb gdb.o libgdb.a \
           ../readline/libreadline.a ../opcodes/libopcodes.a
../bfd/libbfd.a ./../intl/libintl.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a    -ldl -lcurses -lz -lsocket -lnsl -lm
    -lpython2.4 -lexpat ../libiberty/libiberty.a  gnulib/libgnu.a
Undefined                       first referenced
 symbol                             in file
elfcore_write_pstatus               libgdb.a(procfs.o)
ld: fatal: Symbol referencing errors. No output written to gdb
collect2: ld returned 1 exit status

bfd/elf.c defines elfcore_write_pstatus only when HAVE_PSTATUS_T
From bfd/config.log:

configure:14057: checking for pstatus_t in sys/procfs.h
configure:14075: gcc -c -g -O2  conftest.c >&5
conftest.c: In function `main':
conftest.c:81: error: `pstatus_t' undeclared (first use in this function)

This appears to be a bfd configury bug: AFAIC, pstatus_t is defined if
'#include <procfs.h>, but not if '#include <sys/procfs.h>', because
the former defines _STRUCTURED_PROC to 1, and the latter to 0.

Not sure what the proper fix is.

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 21:21 ` Paul Pluzhnikov
@ 2009-10-11 22:10   ` Pedro Alves
  2009-10-11 22:35     ` Paul Pluzhnikov
  2009-10-11 22:53     ` Pedro Alves
  0 siblings, 2 replies; 10+ messages in thread
From: Pedro Alves @ 2009-10-11 22:10 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb-patches, Daniel Gutson

On Sunday 11 October 2009 22:21:14, Paul Pluzhnikov wrote:
> On Thu, Oct 8, 2009 at 6:36 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> 
> > 2009-10-09  Pedro Alves  <pedro@codesourcery.com>
> >
> >        gdb/
> >        * procfs.c (procfs_make_note_section): Always output a NT_PSTATUS
> >        note when NEW_PROC_API is defined.
> 
> This causes build failure on 32-bit solaris-10:

Meeh.  I guess I'll just revert this until the below is resolved,
since I made GDB cope without this note.

> conftest.c:81: error: `pstatus_t' undeclared (first use in this function)
> 
> This appears to be a bfd configury bug: AFAIC, pstatus_t is defined if
> '#include <procfs.h>, but not if '#include <sys/procfs.h>', because
> the former defines _STRUCTURED_PROC to 1, and the latter to 0.
> 
> Not sure what the proper fix is.

Ah, this rings a bell.  We have the patch below as local change
here.  Sorry I didn't notice this.  This was needed to make solaris gdb
grok system gcore generated cores correctly.  It basically switches
GDB to output the "new" core format using lwpstatus_t notes, if it
is already assuming the new procfs format (NEW_PROC_API).

It may be perhaps better to make bfd and gdb's configury to try
including <procfs.h> if available, and fall back to <sys/procfs.h>
otherwise, if available.  I'm not sure why things weren't
done that way.  This way does look a bit simpler, though not
as clean.  Maybe Daniel remembers (?).

-- 
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
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 22:10   ` Pedro Alves
@ 2009-10-11 22:35     ` Paul Pluzhnikov
  2009-10-11 22:40       ` Pedro Alves
  2009-10-11 22:53     ` Pedro Alves
  1 sibling, 1 reply; 10+ messages in thread
From: Paul Pluzhnikov @ 2009-10-11 22:35 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Daniel Gutson

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.

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 22:35     ` Paul Pluzhnikov
@ 2009-10-11 22:40       ` Pedro Alves
  2009-10-11 23:21         ` Paul Pluzhnikov
  0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-10-11 22:40 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb-patches, Daniel Gutson

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

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

[-- Attachment #2: structured.diff --]
[-- Type: text/x-diff, Size: 8797 bytes --]

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
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 22:10   ` Pedro Alves
  2009-10-11 22:35     ` Paul Pluzhnikov
@ 2009-10-11 22:53     ` Pedro Alves
  1 sibling, 0 replies; 10+ messages in thread
From: Pedro Alves @ 2009-10-11 22:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Paul Pluzhnikov, Daniel Gutson

On Sunday 11 October 2009 23:10:25, Pedro Alves wrote:
> Meeh. ?I guess I'll just revert this until the below is resolved,
> since I made GDB cope without this note.

Done.  I didn't revert the bit that unbroke unixware's build.

-- 
Pedro Alves

2009-10-11  Pedro Alves  <pedro@codesourcery.com>

	* procfs.c (procfs_make_note_section): Go back to only outputing
	an NT_PSTATUS note when UNIXWARE is defined.

---
 gdb/procfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: src/gdb/procfs.c
===================================================================
--- src.orig/gdb/procfs.c	2009-10-11 23:36:07.000000000 +0100
+++ src/gdb/procfs.c	2009-10-11 23:36:42.000000000 +0100
@@ -6153,7 +6153,7 @@ procfs_make_note_section (bfd *obfd, int
 
   stop_signal = find_stop_signal ();
 
-#ifdef NEW_PROC_API
+#ifdef UNIXWARE
   fill_gregset (get_current_regcache (), &gregs, -1);
   note_data = elfcore_write_pstatus (obfd, note_data, note_size,
 				     PIDGET (inferior_ptid),


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 22:40       ` Pedro Alves
@ 2009-10-11 23:21         ` Paul Pluzhnikov
  2009-10-31 16:34           ` Paul Pluzhnikov
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Pluzhnikov @ 2009-10-11 23:21 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Daniel Gutson

On Sun, Oct 11, 2009 at 3:40 PM, Pedro Alves <pedro@codesourcery.com> wrote:

>> I am having a bit of trouble restoring sanity to it.

Turns out it's the Solaris patch that was causing me trouble.

> structured.diff

With that it builds fine.

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-11 23:21         ` Paul Pluzhnikov
@ 2009-10-31 16:34           ` Paul Pluzhnikov
  2009-10-31 21:00             ` Pedro Alves
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Pluzhnikov @ 2009-10-31 16:34 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Daniel Gutson

On Sun, Oct 11, 2009 at 4:21 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> On Sun, Oct 11, 2009 at 3:40 PM, Pedro Alves <pedro@codesourcery.com> wrote:

>> structured.diff
>
> With that it builds fine.

Should this be committed?
[GDB currently doesn't build on Solaris 10 without it.]

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-31 16:34           ` Paul Pluzhnikov
@ 2009-10-31 21:00             ` Pedro Alves
  2009-10-31 23:26               ` Paul Pluzhnikov
  0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-10-31 21:00 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb-patches, Daniel Gutson

On Saturday 31 October 2009 16:34:46, Paul Pluzhnikov wrote:
> On Sun, Oct 11, 2009 at 4:21 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> > On Sun, Oct 11, 2009 at 3:40 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> 
> >> structured.diff
> >
> > With that it builds fine.
> 
> Should this be committed?
> [GDB currently doesn't build on Solaris 10 without it.]

It doesn't?  I thought I had reverted the problematic patch.  How
is it failing currently?

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Put a NT_PSTATUS note on solaris cores.
  2009-10-31 21:00             ` Pedro Alves
@ 2009-10-31 23:26               ` Paul Pluzhnikov
  0 siblings, 0 replies; 10+ messages in thread
From: Paul Pluzhnikov @ 2009-10-31 23:26 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Daniel Gutson

On Sat, Oct 31, 2009 at 2:01 PM, Pedro Alves <pedro@codesourcery.com> wrote:

> How is it failing currently?

It's actually the bfd part that doesn't build; sorry for confusion:

make[3]: Entering directory `/export/home/paul/gdb-cvs/build/bfd'
/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../src/bfd -I. -I../../src/bfd -I../../src/bfd/../include
-I./../intl -DBINDIR='"/usr/local/bin"'  -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -g -O0 -MT elf.lo -MD -MP -MF
.deps/elf.Tpo -c -o elf.lo ../../src/bfd/elf.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../src/bfd -I.
-I../../src/bfd -I../../src/bfd/../include -I./../intl
-DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Werror -g -O0 -MT elf.lo -MD -MP -MF
.deps/elf.Tpo -c ../../src/bfd/elf.c -o elf.o
../../src/bfd/elf.c:7624: error: syntax error before "elfcore_psinfo_t"
../../src/bfd/elf.c:7624: warning: type defaults to `int' in
declaration of `elfcore_psinfo_t'
../../src/bfd/elf.c:7624: warning: data definition has no type or storage class
../../src/bfd/elf.c:7626: error: syntax error before "elfcore_psinfo32_t"
../../src/bfd/elf.c:7626: warning: type defaults to `int' in
declaration of `elfcore_psinfo32_t'
../../src/bfd/elf.c:7626: warning: data definition has no type or storage class
../../src/bfd/elf.c: In function `elfcore_grok_psinfo':
../../src/bfd/elf.c:7662: error: syntax error before "psinfo"
../../src/bfd/elf.c:7664: error: `psinfo' undeclared (first use in
this function)
../../src/bfd/elf.c:7664: error: (Each undeclared identifier is
reported only once
../../src/bfd/elf.c:7664: error: for each function it appears in.)
../../src/bfd/elf.c:7678: error: syntax error before "psinfo"
../../src/bfd/elf.c: In function `elfcore_grok_pstatus':
../../src/bfd/elf.c:7719: error: `pstatus_t' undeclared (first use in
this function)
../../src/bfd/elf.c:7725: error: syntax error before "pstat"
../../src/bfd/elf.c:7727: error: `pstat' undeclared (first use in this function)
../../src/bfd/elf.c:7732: error: `pstatus32_t' undeclared (first use
in this function)
../../src/bfd/elf.c:7735: error: syntax error before "pstat"
../../src/bfd/elf.c: In function `elfcore_grok_lwpstatus':
../../src/bfd/elf.c:7754: error: `lwpstatus_t' undeclared (first use
in this function)
../../src/bfd/elf.c:7754: error: syntax error before "lwpstat"
../../src/bfd/elf.c:7760: error: `lwpstat' undeclared (first use in
this function)
../../src/bfd/elf.c:7793: error: syntax error before ')' token
../../src/bfd/elf.c: In function `elfcore_write_prpsinfo':
../../src/bfd/elf.c:8421: error: `psinfo32_t' undeclared (first use in
this function)
../../src/bfd/elf.c:8421: error: syntax error before "data"
../../src/bfd/elf.c:8428: error: `data' undeclared (first use in this function)
../../src/bfd/elf.c:8438: error: `psinfo_t' undeclared (first use in
this function)
../../src/bfd/elf.c:8438: error: syntax error before "data"
../../src/bfd/elf.c: In function `elfcore_write_lwpstatus':
../../src/bfd/elf.c:8512: error: `lwpstatus_t' undeclared (first use
in this function)
../../src/bfd/elf.c:8512: error: syntax error before "lwpstat"
../../src/bfd/elf.c:8515: error: `lwpstat' undeclared (first use in
this function)
../../src/bfd/elf.c: In function `elfcore_write_pstatus':
../../src/bfd/elf.c:8549: error: `pstatus32_t' undeclared (first use
in this function)
../../src/bfd/elf.c:8549: error: syntax error before "pstat"
../../src/bfd/elf.c:8551: error: `pstat' undeclared (first use in this function)
../../src/bfd/elf.c:8560: error: `pstatus_t' undeclared (first use in
this function)
../../src/bfd/elf.c:8560: error: syntax error before "pstat"
make[3]: *** [elf.lo] Error 1
make[3]: Leaving directory `/export/home/paul/gdb-cvs/build/bfd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/export/home/paul/gdb-cvs/build/bfd'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/export/home/paul/gdb-cvs/build/bfd'
make: *** [all-bfd] Error 2



-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-31 23:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-09  1:36 Put a NT_PSTATUS note on solaris cores Pedro Alves
2009-10-11 21:21 ` Paul Pluzhnikov
2009-10-11 22:10   ` Pedro Alves
2009-10-11 22:35     ` Paul Pluzhnikov
2009-10-11 22:40       ` Pedro Alves
2009-10-11 23:21         ` Paul Pluzhnikov
2009-10-31 16:34           ` Paul Pluzhnikov
2009-10-31 21:00             ` Pedro Alves
2009-10-31 23:26               ` Paul Pluzhnikov
2009-10-11 22:53     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox