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 to bfd/aix5ppc-core.c for gdb-6.3 with gcc 4 on AIX5.1


powerpc-ibm-aix5.1.0.0 gcc version 4.0.1

/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I.
-I../../gdb-6.3/bfd \
  -I. -D_GNU_SOURCE -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE -DAIX_CORE \
  -DAIX_WEAK_SUPPORT -I. -I../../gdb-6.3/bfd
-I../../gdb-6.3/bfd/../include \
  -I../../gdb-6.3/bfd/../intl -I../intl -W -Wall -Wstrict-prototypes \
  -Wmissing-prototypes -g -O2 -c -o aix5ppc-core.lo \
  ../../gdb-6.3/bfd/aix5ppc-core.c
gcc -DHAVE_CONFIG_H -I. -I../../gdb-6.3/bfd -I. -D_GNU_SOURCE
-DAIX_5_CORE \
  -DAIX_CORE_DUMPX_CORE -DAIX_CORE -DAIX_WEAK_SUPPORT -I.
-I../../gdb-6.3/bfd \
  -I../../gdb-6.3/bfd/../include -I../../gdb-6.3/bfd/../intl -I../intl
-W \
  -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -c \
  ../../gdb-6.3/bfd/aix5ppc-core.c -o aix5ppc-core.o
../../gdb-6.3/bfd/aix5ppc-core.c: In function 'xcoff64_core_p':
../../gdb-6.3/bfd/aix5ppc-core.c:120: error: invalid lvalue in
assignment
../../gdb-6.3/bfd/aix5ppc-core.c:223: warning: \
  assignment discards qualifiers from pointer target type

>From a look at aix5ppc-core.c with the CVSWeb interface, the patch for
the return_value warning conflicts with the latest delta.
Since xcoff64_core_p returns a const bfd_target *, I'd prefer declaring
return_value as const.

Diff for /src/bfd/aix5ppc-core.c between version 1.7 and 1.8
version 1.7, 2005/03/03 11:40:55 	version 1.8, 2005/04/18 12:10:57
 	 
-   return_value = abfd->xvec;    /* This is garbage for now.  */
+   return_value = (bfd_target *) abfd->xvec;     /* This is garbage for
now.  */

No current employer disclaimer.
No testsuite run.


2005-07-12  Rodney Brown  <rbrown@bravurasolutions.com.au>

	* aix5ppc-core.c (core_hdr): #define as LHS varient.
	(xcoff64_core_p): Constify return_value variable.

--- bfd/aix5ppc-core.c.orig	Thu Jun 24 14:46:14 2004
+++ bfd/aix5ppc-core.c	Tue Jul 12 00:37:16 2005
@@ -1,5 +1,5 @@
 /* IBM RS/6000 "XCOFF" back-end for BFD.
-   Copyright 2001, 2002, 2004
+   Copyright 2001, 2002, 2004, 2005
    Free Software Foundation, Inc.
    Written by Tom Rix
    Contributed by Redhat.
@@ -44,7 +44,7 @@ int xcoff64_core_file_failing_signal
 #include <sys/ldr.h>
 #include <core.h>
 
-#define	core_hdr(abfd)		((struct core_dumpxx *)
abfd->tdata.any)
+#define	core_hdr(abfd)		(abfd->tdata.any)	/* gcc 4
support */
 
 #define CHECK_FILE_OFFSET(s, v) \
   ((bfd_signed_vma)(v) < 0 || (bfd_signed_vma)(v) >
(bfd_signed_vma)(s).st_size)
@@ -60,7 +60,7 @@ xcoff64_core_p (abfd)
   bfd_vma ld_offset;
   bfd_size_type i;
   struct vm_infox vminfo;
-  bfd_target *return_value = NULL;
+  const bfd_target *return_value = NULL;
 
   /* Get the header.  */
   if (bfd_seek (abfd, 0, SEEK_SET) != 0)
@@ -228,6 +228,9 @@ xcoff64_core_p (abfd)
 
   return return_value;
 }
+
+#undef core_hdr		/* gcc 4.0 support */
+#define	core_hdr(abfd)		((struct core_dumpxx *)
abfd->tdata.any)
 
 /* Return `TRUE' if given core is from the given executable.  */
 


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