This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: RFA: bfd/rs6000-core.c 64-bit support


On 13-Jun-2000, I wrote:

>I'm in the process of testing it on AIX 4.1

It turned out that some changes were necessary.  After applying the
appended patch and another that I'll post in the "AIX 64-bit mega-patch"
thread, there are three 4.1 GDB regressions and no 4.3 regressions.

The 4.1 regressions are kind of interesting: in AIX 4.x 32-bit binaries,
the a.out header stores a pointer to the entry point instead of the entry
point itself.  GDB doesn't realize that, so when it sets a breakpoint at
the entry point as part of the setup for a "call" command, it actually
writes a breakpoint pattern to the data section, changing the program's
behavior in surprising ways.

The fix probably will be a BFD patch to dereference the entry point when
an object file is opened.

On 13-Jun-2000, Kevin Buettner wrote:

>Feel free to check these changes in if your tests on AIX 4.1 go well.

After applying the extra patch, I think the tests can be characterized as
having gone well, so I'll check in my changes if there are no objections.
I'll merge this patch with the original before committing.

Nick

[ChangeLog is unchanged.]

Index: bfd/rs6000-core.c
===================================================================
diff -up bfd/rs6000-core.c bfd/rs6000-core.c
--- bfd/rs6000-core.c	Fri Jun 16 11:32:58 2000
+++ bfd/rs6000-core.c	Thu Jun 15 12:07:16 2000
@@ -79,9 +79,15 @@ Foundation, Inc., 59 Temple Place - Suit
    the previous 4.1 structure, core_dump.
 
    AIX_CORE_DUMPX_CORE is defined (by configure) on AIX 4.3+, and
-   CORE_VERSION_1 is defined (by AIX core.h) on AIX 4.1+.
+   CORE_VERSION_1 is defined (by AIX core.h) as 2 on AIX 4.3+ and as 1 on AIX
+   4.1 and 4.2.  AIX pre-4.1 (aka 3.x) either doesn't define CORE_VERSION_1
+   or else defines it as 0. */
 
-   The following union and macros allow this module to compile on all AIX
+#if defined(CORE_VERSION_1) && !CORE_VERSION_1
+# undef CORE_VERSION_1
+#endif
+
+/* The following union and macros allow this module to compile on all AIX
    versions and to handle both core_dumpx and core_dump on 4.3+.  CNEW_*()
    and COLD_*() macros respectively retrieve core_dumpx and core_dump
    values. */
@@ -202,7 +208,7 @@ typedef union {
 #ifdef AIX_CORE_DUMPX_CORE
 # define CNEW_CONTEXT64(c)	(c).c_flt.hctx.r64
 #else
-# define CNEW_CONTEXT64(c)	0
+# define CNEW_CONTEXT64(c)	c
 #endif
 
 /* Return the struct mstsave pointer from struct core_dumpx C. */
@@ -210,7 +216,7 @@ typedef union {
 #ifdef AIX_CORE_DUMPX_CORE
 # define CNEW_MSTSAVE(c)	(c).c_flt.hctx.r32
 #else
-# define CNEW_MSTSAVE(c)	0
+# define CNEW_MSTSAVE(c)	c
 #endif
 
 /* Return the struct mstsave pointer from struct core_dump C. */
@@ -320,7 +326,7 @@ rs6000coff_core_p (abfd)
   if (CORE_NEW (core))
     {
       c_flag = core.new.c_flag;
-      c_stack = core.new.c_stack;
+      c_stack = (file_ptr) core.new.c_stack;
       c_size = core.new.c_size;
       c_stackend = CNEW_STACKORG (core.new) + c_size;
       c_lsize = CNEW_LSIZE (core.new);
@@ -505,9 +511,9 @@ rs6000coff_core_p (abfd)
     if (CORE_NEW (core))
       {
 	c_datasize = CNEW_DATASIZE (core.new);
-	c_data = core.new.c_data;
+	c_data = (file_ptr) core.new.c_data;
 	c_vmregions = core.new.c_vmregions;
-	c_vmm = core.new.c_vmm;
+	c_vmm = (file_ptr) core.new.c_vmm;
       }
     else
       {
@@ -545,7 +551,7 @@ rs6000coff_core_p (abfd)
 	  {
 	    ldi_core = ldinfo.l64.ldinfo_core;
 	    ldi_datasize = ldinfo.l64.ldinfo_datasize;
-	    ldi_dataorg = ldinfo.l64.ldinfo_dataorg;
+	    ldi_dataorg = (bfd_vma) ldinfo.l64.ldinfo_dataorg;
 	    ldi_next = ldinfo.l64.ldinfo_next;
 	  }
 	else
@@ -588,7 +594,7 @@ rs6000coff_core_p (abfd)
 
 	    if (CORE_NEW (core))
 	      {
-		vminfo_addr = vminfo.new.vminfo_addr;
+		vminfo_addr = (bfd_vma) vminfo.new.vminfo_addr;
 		vminfo_size = vminfo.new.vminfo_size;
 		vminfo_offset = vminfo.new.vminfo_offset;
 	      }

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