This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for build failure on UnixWare{2.1.3,7.1.0} in bfd/elf.c:elfcore_write_pstatus


/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../gdb+dejagnu-20020112/bfd -I. -D_GNU_SOURCE    \
 -I. -I../../gdb+dejagnu-20020112/bfd
-I../../gdb+dejagnu-20020112/bfd/../include
-I../../gdb+dejagnu-20020112/bfd/../intl -I../intl   \
-W -Wall -Wstrict-prototypes  -Wmissing-prototypes -g -O2 -c
../../gdb+dejagnu-20020112/bfd/elf.c
gcc -DHAVE_CONFIG_H -I. -I../../gdb+dejagnu-20020112/bfd -I. -D_GNU_SOURCE
-I. \
-I../../gdb+dejagnu-20020112/bfd
-I../../gdb+dejagnu-20020112/bfd/../include
-I../../gdb+dejagnu-20020112/bfd/../intl -I../intl \
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c
../../gdb+dejagnu-20020112/bfd/elf.c -o elf.o
In file included from ../../gdb+dejagnu-20020112/bfd/elf.c:43:
../../gdb+dejagnu-20020112/bfd/../include/libiberty.h:80: warning: function
declaration isn't a prototype
../../gdb+dejagnu-20020112/bfd/elf.c:6133: warning: function declaration
isn't a prototype
../../gdb+dejagnu-20020112/bfd/elf.c:6170: warning: function declaration
isn't a prototype
../../gdb+dejagnu-20020112/bfd/elf.c: In function `elfcore_write_pstatus':
../../gdb+dejagnu-20020112/bfd/elf.c:6594: `prstat' undeclared (first use
in this function)
../../gdb+dejagnu-20020112/bfd/elf.c:6594: (Each undeclared identifier is
reported only once
../../gdb+dejagnu-20020112/bfd/elf.c:6594: for each function it appears
in.)
../../gdb+dejagnu-20020112/bfd/elf.c:6596: structure has no member named
`pr_reg'
../../gdb+dejagnu-20020112/bfd/elf.c:6596: structure has no member named
`pr_reg'
../../gdb+dejagnu-20020112/bfd/elf.c:6588: warning: unused parameter
`cursig'
make[3]: *** [elf.lo] Error 1
make[3]: Leaving directory `/devel/src/gdb+dejagnu-20020112.obj/bfd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/devel/src/gdb+dejagnu-20020112.obj/bfd'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/devel/src/gdb+dejagnu-20020112.obj/bfd'
make: *** [all-bfd] Error 2

Possibly BFD_HAVE_SYS_PROCFS_TYPE_MEMBER could be used
to explicitly check for pr_reg in pstatus_t (and or pr_lwp).
This isn't enough for a build :- gdb/i386v4-nat.c is missing defines.

2002-01-14  Rodney Brown  <rbrown64@csc.com.au>

     * elf.c(elfcore_write_pstatus): Handle UnixWare 2.1.3 and 7.1.0.

--- bfd/elf.c.bu    Fri Jan 11 10:05:21 2002
+++ bfd/elf.c  Mon Jan 14 17:57:08 2002
@@ -6591,9 +6591,23 @@ elfcore_write_pstatus (abfd, buf, bufsiz
   pstatus_t pstat;
   char *note_name = "CORE";

-  memset (&pstat, 0, sizeof (prstat));
+  memset (&pstat, 0, sizeof (pstat));
   pstat.pr_pid = pid;
+#if !defined (HAVE_LWPSTATUS_T)
   memcpy (pstat.pr_reg, gregs, sizeof (pstat.pr_reg));
+#elif defined (HAVE_LWPSTATUS_T_PR_REG)
+  memcpy (pstat.pr_lwp.pr_reg, gregs, sizeof (pstat.pr_lwp.pr_reg));
+#elif defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
+#if !defined(gregs)
+  memcpy (pstat.pr_lwp.pr_context.uc_mcontext.gregs,
+          gregs, sizeof (gregset_t));
+#else
+  memcpy (pstat.pr_lwp.pr_context.uc_mcontext.__gregs,
+         gregs, sizeof (gregset_t));
+#endif
+#else
+#error   FixMe
+#endif
   return elfcore_write_note (abfd, buf, bufsiz,
                    note_name, NT_PSTATUS, &pstat, sizeof (pstat));
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]