🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8906

patches for gdb-4.6 on aix ps/2 1.2.1 ...

#8906
From: Minh Tran-Le
Date: Sat, 18 Jul 1992 19:26
1631 lines
47121 bytes
Here are some patches to gdb-4.6 for people that want to run it under
aix ps/2.  It can only be compiled with gcc and it can only debug
standard COFF debug format (like the one generated by gcc, the standard 
aix ps/2 C compiler does not generate COFF debug).

Configure it with:  ./configure i386-aix

Minh Tran-Le.
---------------------------------------------------------------------------
*** ./gdb/config/i386aix.mh-	Wed Jul 15 17:09:42 1992
--- ./gdb/config/i386aix.mh	Wed Jul 15 17:09:42 1992
***************
*** 0 ****
--- 1,12 ----
+ # Host: IBM PS/2 (i386) running AIX PS/2
+ XDEPFILES= infptrace.o i386-xdep.o i387-tdep.o
+ XM_FILE= xm-i386aix.h
+ XM_CLIBS= -lPW
+ SYSV_DEFINE=-DSYSV -D_AIX -D_I386
+ REGEX=regex.o
+ REGEX1=regex.o
+ TERMCAP=-lcurses
+ # Use gcc. Only coff output can be debugged
+ CC=gcc
+ MINUS_G=-O2 -fno-strength-reduce
+ LDFLAGS=-shlib
*** ./gdb/config/i386aix.mt-	Wed Jul 15 17:09:42 1992
--- ./gdb/config/i386aix.mt	Wed Jul 15 17:09:42 1992
***************
*** 0 ****
--- 1,3 ----
+ # Target: IBM PS/2 (i386) running AIX PS/2
+ TDEPFILES= exec.o i386-tdep.o i386-pinsn.o
+ TM_FILE= tm-i386aix.h
*** ./gdb/alldeps.mak-	Tue Jul 14 19:49:33 1992
--- ./gdb/alldeps.mak	Wed Jul 15 16:42:15 1992
***************
*** 218,221 ****
--- 218,223 ----
  ./config/i386aout.mt\
  ./config/i386mach.mh\
+ ./config/i386aix.mh\
+ ./config/i386aix.mt\
  ./config/i386sco.mh\
  ./config/i386sco.mt\
*** ./gdb/dbxread.c-	Tue Jul 14 00:34:21 1992
--- ./gdb/dbxread.c	Wed Jul 15 16:50:18 1992
***************
*** 38,43 ****
--- 38,45 ----
  #include <sys/types.h>
  #include <fcntl.h>
+ #ifndef _AIX
  #define L_SET 0
  #define L_INCR 1
+ #endif /* _AIX */
  #endif
  
*** ./gdb/configure.in-	Wed Jul  8 01:01:38 1992
--- ./gdb/configure.in	Wed Jul 15 16:49:22 1992
***************
*** 101,104 ****
--- 101,105 ----
  	sequent)	gdb_host=symmetry ;;
  	ncr)	gdb_host=ncr3000 ;;
+ 	ibm)	gdb_host=i386aix ;;
  	*)
  		case "${host_os}" in
***************
*** 109,112 ****
--- 110,114 ----
  		scosysv*) gdb_host=i386sco ;;
  		mach)	gdb_host=i386mach ;;
+ 		aix)	gdb_host=i386aix ;;
  		linux)	gdb_host=linux ;;
  		esac
***************
*** 310,313 ****
--- 312,316 ----
  	sequent)	gdb_target=symmetry ;;
  	ncr)	gdb_target=ncr3000 ;;
+ 	ibm)	gdb_target=i386aix ;;
  	*)
  		case "${target_os}" in
***************
*** 319,322 ****
--- 322,326 ----
  		coff)	gdb_target=i386v ;;
  		aout)	gdb_target=i386aout ;;
+ 		aix)	gdb_target=i386aix ;;
  		linux)	gdb_target=linux ;;
  		esac
*** ./gdb/infptrace.c-	Mon Jul  6 10:10:53 1992
--- ./gdb/infptrace.c	Wed Jul 15 17:04:50 1992
***************
*** 31,35 ****
  #include <signal.h>
  #include <sys/ioctl.h>
! #ifndef USG
  #include <sys/ptrace.h>
  #endif
--- 31,35 ----
  #include <signal.h>
  #include <sys/ioctl.h>
! #if !defined(USG) || defined(_AIX)
  #include <sys/ptrace.h>
  #endif
*** ./gdb/i386-tdep.c-	Mon Jul  6 10:10:52 1992
--- ./gdb/i386-tdep.c	Wed Jul 15 16:51:57 1992
***************
*** 679,680 ****
--- 679,717 ----
  
  #endif /* GET_LONGJMP_TARGET */
+ 
+ #ifdef I386_AIX_TARGET
+ #include <sys/ptrace.h>
+ 
+ void
+ i386_extract_return_value(type, regbuf, valbuf)
+      struct type *type;
+      char regbuf[REGISTER_BYTES];
+      char *valbuf;
+ {
+   if (TYPE_CODE_FLT == TYPE_CODE(type))
+     {
+       double d;
+       /* 387 %st(0), gcc uses this */
+       i387_to_double(&regbuf[REGISTER_BYTE(FP0_REGNUM)], &d);
+       switch (TYPE_LENGTH(type))
+ 	{
+ 	case 4:			/* float */
+ 	  {
+ 	    float f = (float) d;
+ 	    bcopy(&f, valbuf, 4); 
+ 	    break;
+ 	  }
+ 	case 8:			/* double */
+ 	  bcopy(&d, valbuf, 8);
+ 	  break;
+ 	default:
+ 	  error("Unknown floating point size");
+ 	  break;
+ 	}
+     }
+   else
+     { 
+       bcopy (regbuf, valbuf, TYPE_LENGTH (type)); 
+     }
+ }
+ #endif
*** ./gdb/i386-xdep.c-	Wed Jun 24 10:32:49 1992
--- ./gdb/i386-xdep.c	Wed Jul 15 16:59:09 1992
***************
*** 38,41 ****
--- 38,48 ----
  #include <sys/stat.h>
  
+ #ifdef _AIX
+ # include <stddef.h>
+ # include <sys/ptrace.h>
+ #endif
+ 
+ extern int errno;
+ 
  #include <sys/reg.h>
  #include "ieee-float.h"
***************
*** 47,50 ****
--- 54,62 ----
  /* this table must line up with REGISTER_NAMES in m-i386.h */
  /* symbols like 'EAX' come from <sys/reg.h> */
+ 
+ #ifdef _AIX
+ # define UESP USP
+ #endif
+ 
  static int regmap[] = 
  {
***************
*** 83,89 ****
  }
  
! #if 0
! /* mauro@olympus 1991.10.20 -- compiling the following code causes
!    undefined symbols at link time, specifically: corechan, have_inferior_p */
  struct env387 
  {
--- 95,103 ----
  }
  
! #ifdef _AIX
! /* The code below only work on the aix ps/2 (i386-ibm-aix) -
!  * mtranle@paris - Sat Apr 11 10:34:12 1992
!  */
! 
  struct env387 
  {
***************
*** 137,141 ****
    printf (":%s\n", local_hex_string(ep->operand));
    
!   top = (ep->status >> 11) & 7;
    
    printf ("regno  tag  msb              lsb  value\n");
--- 151,155 ----
    printf (":%s\n", local_hex_string(ep->operand));
    
!   top = 7- ((ep->status >> 11) & 7);
    
    printf ("regno  tag  msb              lsb  value\n");
***************
*** 146,150 ****
        printf ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
        
!       switch ((ep->tag >> (fpreg * 2)) & 3) 
  	{
  	case 0: printf ("valid "); break;
--- 160,164 ----
        printf ("%s %d: ", fpreg == top ? "=>" : "  ", fpreg);
        
!       switch ((ep->tag >> ((7 - fpreg) * 2)) & 3) 
  	{
  	case 0: printf ("valid "); break;
***************
*** 156,173 ****
  	printf ("%02x", ep->regs[fpreg][i]);
        
!       ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg],
! 			       &val);
!       printf ("  %g\n", val);
!     }
!   if (ep->r0)
!     warning ("reserved0 is %s\n", local_hex_string(ep->r0));
!   if (ep->r1)
!     warning ("reserved1 is %s\n", local_hex_string(ep->r1));
!   if (ep->r2)
!     warning ("reserved2 is %s\n", local_hex_string(ep->r2));
!   if (ep->r3)
!     warning ("reserved3 is %s\n", local_hex_string(ep->r3));
  }
  
  #ifndef U_FPSTATE
  #define U_FPSTATE(u) u.u_fpstate
--- 170,351 ----
  	printf ("%02x", ep->regs[fpreg][i]);
        
!       i387_to_double ((char *)ep->regs[fpreg], (char *)&val);
!       printf ("  %#g\n", val);
!     }
! }
! 
! static struct env387 core_env387;
! 
! void
! i386_float_info ()
! {
!   struct env387 fps;
!   int fpsaved = 0;
! 
!   if (inferior_pid)
!     {
!       char buf[10];
!       unsigned short status;
! 
!       ptrace (PT_READ_FPR, inferior_pid, buf, offsetof(struct env387, status));
!       memcpy (&status, buf, sizeof (status));
!       fpsaved = status;
!     }
!   else
!     {
!       if ((fpsaved = core_env387.status) != 0)
! 	memcpy(&fps, &core_env387, sizeof(fps));
!     }
!   
!   if (fpsaved == 0) 
!     {
!       printf ("no floating point status saved\n");
!       return;
!     }
! 
!   if (inferior_pid)
!     {
!       int offset;
!       for (offset = 0; offset < sizeof(fps); offset += 10)
! 	{
! 	  char buf[10];
! 	  ptrace (PT_READ_FPR, inferior_pid, buf, offset);
! 	  memcpy ((char *)&fps.control + offset, buf,
! 		  MIN(10, sizeof(fps) - offset));
! 	}
!     } 
! 
!   print_387_status (0, (struct env387 *)&fps);
! }
! 
! /* Fetch one register.  */
! static void
! fetch_register (regno)
!      int regno;
! {
!   char buf[MAX_REGISTER_RAW_SIZE];
!   if (regno < FP0_REGNUM)
!     *(int *)buf = ptrace (PT_READ_GPR, inferior_pid,
! 			  PT_REG(regmap[regno]), 0, 0);
!   else
!     ptrace (PT_READ_FPR, inferior_pid, buf,
! 	    (regno - FP0_REGNUM)*10 + offsetof(struct env387, regs));
!   supply_register (regno, buf);
! }
! 
! void
! fetch_inferior_registers (regno)
!      int regno;
! {
!   if (regno < 0)
!     for (regno = 0; regno < NUM_REGS; regno++)
!       fetch_register (regno);
!   else
!     fetch_register (regno);
! }
! 
! /* store one register */
! static void
! store_register (regno)
!      int regno;
! {
!   char buf[80];
!   extern char registers[];
!   errno = 0;
!   if (regno < FP0_REGNUM)
!     ptrace (PT_WRITE_GPR, inferior_pid, PT_REG(regmap[regno]),
! 	    *(int *) &registers[REGISTER_BYTE (regno)], 0);
!   else
!     ptrace (PT_WRITE_FPR, inferior_pid, &registers[REGISTER_BYTE (regno)],
! 	    (regno - FP0_REGNUM)*10 + offsetof(struct env387, regs));
! 
!   if (errno != 0)
!     {
!       sprintf (buf, "writing register number %d", regno);
!       perror_with_name (buf);
!     }
! }
! 
! /* Store our register values back into the inferior.
!    If REGNO is -1, do this for all registers.
!    Otherwise, REGNO specifies which register (so we can save time).  */
! void
! store_inferior_registers (regno)
!      int regno;
! {
!   if (regno < 0)
!     for (regno = 0; regno < NUM_REGS; regno++)
!       store_register (regno);
!   else
!     store_register (regno);
! }
! 
! #ifndef CD_AX			/* defined in sys/i386/coredump.h */
! # define CD_AX	0
! # define CD_BX	1
! # define CD_CX	2
! # define CD_DX	3
! # define CD_SI	4
! # define CD_DI	5
! # define CD_BP	6
! # define CD_SP	7
! # define CD_FL	8
! # define CD_IP	9
! # define CD_CS	10
! # define CD_DS	11
! # define CD_ES	12
! # define CD_FS	13
! # define CD_GS	14
! # define CD_SS	15
! #endif
! 
! /*
!  * The order here in core_regmap[] has to be the same as in 
!  * regmap[] above.
!  */
! static int core_regmap[] = 
! {
!   CD_AX, CD_CX, CD_DX, CD_BX,
!   CD_SP, CD_BP, CD_SI, CD_DI,
!   CD_IP, CD_FL, CD_CS, CD_SS,
!   CD_DS, CD_ES, CD_FS, CD_GS,
! };
! 
! void
! fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
!      char *core_reg_sect;
!      unsigned core_reg_size;
!      int which;
!      unsigned int reg_addr;	/* ignored */
! {
! 
!   if (which == 0)
!     {
!       /* Integer registers */
! 
! #define cd_regs(n) ((int *)core_reg_sect)[n]
! #define regs(n) *((int *) &registers[REGISTER_BYTE (n)])
! 
!       int i;
!       for (i = 0; i < FP0_REGNUM; i++)
! 	regs(i) = cd_regs(core_regmap[i]);
!     }
!   else if (which == 2)
!     {
!       /* Floating point registers */
! 
!       if (core_reg_size >= sizeof (core_env387))
! 	memcpy (&core_env387, core_reg_sect, core_reg_size);
!       else
! 	fprintf (stderr, "Couldn't read float regs from core file\n");
!     }
  }
  
+ #else /* not _AIX */
+ 
+ #if 0
+ /* mauro@olympus 1991.10.20 -- compiling the following code causes
+    undefined symbols at link time, specifically: corechan, have_inferior_p */
+ 
  #ifndef U_FPSTATE
  #define U_FPSTATE(u) u.u_fpstate
***************
*** 249,250 ****
--- 427,429 ----
  }
  #endif /* mauro@olympus 1991.10.20 */
+ #endif /* not _AIX */
*** ./gdb/i387-tdep.c-	Sat Mar 14 17:08:38 1992
--- ./gdb/i387-tdep.c	Wed Jul 15 17:03:38 1992
***************
*** 49,52 ****
--- 49,57 ----
     the callers.  */
  
+ #ifdef i386
+ /* These 2 conversion function are here because the one in i387-tdep.c
+  * does'nt work yet because of a buf in converting (unsigned long) to
+  * (double).
+  */
  void
  i387_to_double (from, to)
***************
*** 54,57 ****
--- 59,112 ----
       char *to;
  {
+   long *lp;
+   /* push extended mode on 387 stack, then pop in double mode
+    *
+    * first, set exception masks so no error is generated -
+    * number will be rounded to inf or 0, if necessary 
+    */
+   asm ("pushl %eax"); 		/* grab a stack slot */
+   asm ("fstcw (%esp)");		/* get 387 control word */
+   asm ("movl (%esp),%eax");	/* save old value */
+   asm ("orl $0x3f,%eax");	/* mask all exceptions */
+   asm ("pushl %eax");
+   asm ("fldcw (%esp)");		/* load new value into 387 */
+   
+   asm ("movl 8(%ebp),%eax");
+   asm ("fldt (%eax)");		/* push extended number on 387 stack */
+   asm ("fwait");
+   asm ("movl 12(%ebp),%eax");
+   asm ("fstpl (%eax)");		/* pop double */
+   asm ("fwait");
+   
+   asm ("popl %eax");		/* flush modified control word */
+   asm ("fnclex");		/* clear exceptions */
+   asm ("fldcw (%esp)");		/* restore original control word */
+   asm ("popl %eax");		/* flush saved copy */
+ }
+ 
+ void
+ double_to_i387 (from, to)
+      char *from;
+      char *to;
+ {
+   /* push double mode on 387 stack, then pop in extended mode
+    * no errors are possible because every 64-bit pattern
+    * can be converted to an extended
+    */
+   asm ("movl 8(%ebp),%eax");
+   asm ("fldl (%eax)");
+   asm ("fwait");
+   asm ("movl 12(%ebp),%eax");
+   asm ("fstpt (%eax)");
+   asm ("fwait");
+ }
+ 
+ #else /* not i386 */
+ 
+ void
+ i387_to_double (from, to)
+      char *from;
+      char *to;
+ {
    ieee_extended_to_double (&ext_format_i387, from, (double *)to);
  }
***************
*** 64,67 ****
--- 119,123 ----
    double_to_ieee_extended (&ext_format_i387, (double *)from, to);
  }
+ #endif /* i386 */
  
  void
***************
*** 125,128 ****
  	  (status & 0x0100) != 0);
    
!   printf ("top %d\n", (status >> 11) & 7);
  }
--- 181,184 ----
  	  (status & 0x0100) != 0);
    
!   printf ("top %d\n", 7 - (status >> 11) & 7);
  }
*** ./gdb/mipsread.c-	Mon Jul  6 10:10:58 1992
--- ./gdb/mipsread.c	Wed Jul 15 17:05:52 1992
***************
*** 61,66 ****
--- 61,68 ----
  #ifdef USG
  #include <sys/types.h>
+ #ifndef _AIX
  #define L_SET 0
  #define L_INCR 1
+ #endif /* _AIX */
  #endif
  
*** ./gdb/tm-i386aix.h-	Wed Jul 15 17:09:06 1992
--- ./gdb/tm-i386aix.h	Wed Jul 15 17:09:06 1992
***************
*** 0 ****
--- 1,161 ----
+ /* Macro defintions for IBM AIX PS/2 (i386).
+    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ 
+ This file is part of GDB.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+ 
+ /*
+  * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
+  * Revision:	13-Jun-92 20:55:05
+  */
+ 
+ #ifndef TM_I386AIX_H
+ #define TM_I386AIX_H 1
+ 
+ #include "tm-i386v.h"
+ #include <sys/reg.h>
+ 
+ #ifndef I386
+ # define I386 1
+ #endif
+ #ifndef I386_AIX_TARGET
+ # define I386_AIX_TARGET 1
+ #endif
+ 
+ /* number of traps that happen between exec'ing the shell 
+  * to run an inferior, and when we finally get to 
+  * the inferior code.  This is 2 on most implementations.
+  */
+ #undef  START_INFERIOR_TRAPS_EXPECTED
+ #define START_INFERIOR_TRAPS_EXPECTED 2
+ 
+ /* code to execute to print interesting information about the
+  * floating point processor (if any)
+  * No need to define if there is nothing to do.
+  */
+ #define FLOAT_INFO { i386_float_info (); }
+ 
+ /* Number of machine registers */
+ #undef  NUM_REGS
+ #define NUM_REGS 24 /* 16+8 */
+ 
+ /* Initializer for an array of names of registers.
+    There should be NUM_REGS strings in this initializer.  */
+ 
+ /* the order of the first 8 registers must match the compiler's 
+  * numbering scheme (which is the same as the 386 scheme)
+  * also, this table must match regmap in i386-pinsn.c.
+  */
+ #undef  REGISTER_NAMES
+ #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
+ 			 "esp", "ebp", "esi", "edi", \
+ 			 "eip", "eflags", "cs", "ss", \
+ 			 "ds", "es", "fs", "gs", \
+ 			 "st0", "st1", "st2", "st3", \
+ 			 "st4", "st5", "st6", "st7", \
+ 			 }
+ 
+ /* Register numbers of various important registers.
+    Note that some of these values are "real" register numbers,
+    and correspond to the general registers of the machine,
+    and some are "phony" register numbers which are too large
+    to be actual register numbers as far as the user is concerned
+    but do serve to get the desired values when passed to read_register.  */
+ 
+ #undef  FP_REGNUM
+ #define FP_REGNUM 5	/* (ebp) Contains address of executing stack frame */
+ #undef  SP_REGNUM
+ #define SP_REGNUM 4	/* (usp) Contains address of top of stack */
+ 
+ #undef  PC_REGNUM
+ #define PC_REGNUM 8	/* (eip) Contains program counter */
+ #undef  PS_REGNUM 
+ #define PS_REGNUM 9	/* (eflags) Contains processor status */
+ 
+ #define FP0_REGNUM 16   /*  (st0) 387 register */
+ 
+ /* Total amount of space needed to store our copies of the machine's
+    register state, the array `registers'.  */
+ /* 16 i386 registers and 8 i387 registers */
+ #undef REGISTER_BYTES
+ #define REGISTER_BYTES (16*4 + 8*10)
+ 
+ /* Index within `registers' of the first byte of the space for
+    register N.  */
+ #undef REGISTER_BYTE
+ #define REGISTER_BYTE(N) \
+   ((N < FP0_REGNUM) ? (N * 4) : \
+    (((N - FP0_REGNUM) * 10) + 64))
+  
+ /* Number of bytes of storage in the actual machine representation
+  * for register N.  All registers are 4 bytes, except 387 st(0) - st(7),
+  * which are 80 bits each. 
+  */
+ #undef REGISTER_RAW_SIZE
+ #define REGISTER_RAW_SIZE(N) \
+   ((N < FP0_REGNUM) ? 4 : 10)
+ 
+ /* Largest value REGISTER_RAW_SIZE can have.  */
+ #undef MAX_REGISTER_RAW_SIZE
+ #define MAX_REGISTER_RAW_SIZE 10
+ 
+ /* Nonzero if register N requires conversion
+    from raw format to virtual format.  */
+ #undef REGISTER_CONVERTIBLE
+ #define REGISTER_CONVERTIBLE(N) \
+   ((N < FP0_REGNUM) ? 0 : 1)
+ 
+ /* Convert data from raw format for register REGNUM
+    to virtual format for register REGNUM.  */
+ #undef REGISTER_CONVERT_TO_VIRTUAL
+ #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+   ((REGNUM < FP0_REGNUM) ? bcopy ((FROM), (TO), 4) : \
+    i387_to_double((FROM), (TO)))
+ 
+ /* Convert data from virtual format for register REGNUM
+    to raw format for register REGNUM.  */
+ #undef REGISTER_CONVERT_TO_RAW
+ #define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+   ((REGNUM < FP0_REGNUM) ? bcopy ((FROM), (TO), 4) : \
+    double_to_i387((FROM), (TO)))
+ 
+ /* Return the GDB type object for the "standard" data type
+    of data in register N.  */
+ #undef REGISTER_VIRTUAL_TYPE
+ #define REGISTER_VIRTUAL_TYPE(N) \
+   ((N < FP0_REGNUM) ? builtin_type_int : \
+    builtin_type_double)
+ 
+ /* Extract from an array REGBUF containing the (raw) register state
+    a function return value of type TYPE, and copy that, in virtual format,
+    into VALBUF.  */
+ #undef  EXTRACT_RETURN_VALUE
+ #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+   i386_extract_return_value (TYPE,REGBUF,VALBUF)
+ 
+ /* Write into appropriate registers a function return value
+    of type TYPE, given in virtual format.  */
+ #undef STORE_RETURN_VALUE
+ #define STORE_RETURN_VALUE(TYPE,VALBUF) \
+   {    	       	       	       	       	       	       	       	       	     \
+     if (TYPE_CODE (TYPE) == TYPE_CODE_FLT)				     \
+       write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF),	     \
+ 			    TYPE_LENGTH (TYPE));			     \
+     else								     \
+       write_register_bytes (0, (VALBUF), TYPE_LENGTH (TYPE));  		     \
+   }
+ 
+ #endif /* TM_I386AIX_H */
*** ./gdb/xm-i386aix.h-	Wed Jul 15 17:09:06 1992
--- ./gdb/xm-i386aix.h	Wed Jul 15 17:09:06 1992
***************
*** 0 ****
--- 1,48 ----
+ /* Macro defintions for AIX PS/2 (i386)
+    Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
+ 
+ This file is part of GDB.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+ 
+ /*
+  * Changed for IBM AIX ps/2 by Minh Tran Le (tranle@intellicorp.com)
+  * Revision:	11-Apr-92 11:03:36
+  */
+ 
+ #include "xm-i386v.h"
+ #include "limits.h"
+ 
+ /* This is from <sys/param.h> */
+ #ifdef  MAXPATHLEN
+ #undef  MAXPATHLEN
+ #endif
+ #define MAXPATHLEN 1024
+ 
+ #define HAVE_STRSTR
+ 
+ /* This is the amount to subtract from u.u_ar0
+    to get the offset in the core file of the register values.  */
+ #undef  KERNEL_U_ADDR
+ #define KERNEL_U_ADDR 0xf03fd000
+ 
+ /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
+ #define FETCH_INFERIOR_REGISTERS
+ 
+ #define index strchr
+ #define rindex strrchr
+ 
+ /* Use setpgid instead of setpgrp on AIX */
+ #define NEED_POSIX_SETPGID
*** ./gdb/coffread.c-	Mon Jul  6 10:10:40 1992
--- ./gdb/coffread.c	Wed Jul 15 16:45:56 1992
***************
*** 1921,1925 ****
  	    INIT_CPLUS_SPECIFIC(type);
  	    TYPE_LENGTH (type) = 0;
- 	    TYPE_LENGTH (type) = 0;
  	    TYPE_FIELDS (type) = 0;
  	    TYPE_NFIELDS (type) = 0;
--- 1921,1924 ----
***************
*** 1935,1941 ****
  
        case T_ENUM:
! 	return coff_read_enum_type (cs->c_symnum,
  				    aux->x_sym.x_misc.x_lnsz.x_size,
  				    aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
  
        case T_MOE:
--- 1934,1954 ----
  
        case T_ENUM:
! 	if (cs->c_naux != 1)
! 	  {
! 	    /* anonymous enum type */
! 	    type = coff_alloc_type (cs->c_symnum);
! 	    TYPE_CODE (type) = TYPE_CODE_ENUM;
! 	    TYPE_NAME (type) = concat ("enum ", "<opaque>", NULL);
! 	    TYPE_LENGTH (type) = 0;
! 	    TYPE_FIELDS (type) = 0;
! 	    TYPE_NFIELDS (type) = 0;
! 	  }
! 	else
! 	  {
! 	    type = coff_read_enum_type (cs->c_symnum,
  				    aux->x_sym.x_misc.x_lnsz.x_size,
  				    aux->x_sym.x_fcnary.x_fcn.x_endndx.l);
+ 	  }
+ 	return type;
  
        case T_MOE:
*** ./bfd/config/i386aix.mh-	Wed Jul 15 16:39:31 1992
--- ./bfd/config/i386aix.mh	Wed Jul 15 16:39:31 1992
***************
*** 0 ****
--- 1,4 ----
+ HDEFINES=-DFASCIST_FDOPEN
+ CC=gcc
+ RANLIB=/bin/true
+ MINUS_G=-O2 -fno-strength-reduce
*** ./bfd/config/i386-coff.mt-	Tue Dec  3 23:40:38 1991
--- ./bfd/config/i386-coff.mt	Wed Jul 15 16:39:04 1992
***************
*** 1,2 ****
  # Target:  Intel 386 running coff.
! TDEFAULTS = -DDEFAULT_VECTOR=i386coff_vec
--- 1,2 ----
  # Target:  Intel 386 running coff.
! TDEFAULTS = -DDEFAULT_VECTOR=i386coff_vec -DSELECT_ARCHITECTURES=bfd_i386_arch
*** ./bfd/hosts/i386aix.h-	Wed Jul 15 16:40:14 1992
--- ./bfd/hosts/i386aix.h	Wed Jul 15 16:40:14 1992
***************
*** 0 ****
--- 1,68 ----
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <utime.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <sys/file.h>
+ #ifndef O_ACCMODE
+ #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
+ #endif
+ #define SEEK_SET 0
+ #define SEEK_CUR 1
+ 
+ #define	POSIX_UTIME
+ 
+ /* Some things that need to be defined in order to make code written for
+    BSD Unix compile under System V Unix.  */
+ 
+ #include <memory.h>
+ #define bcmp(b1,b2,len)		memcmp(b1,b2,len)
+ #define bcopy(src,dst,len)	memcpy(dst,src,len)
+ #define bzero(s,n)		memset(s,0,n)
+ 
+ #include <string.h>
+ #define index(s,c)		strchr(s,c)
+ #define rindex(s,c)		strrchr(s,c)
+ 
+ /*
+  * Might not need these. Leave them out for now.
+  *
+ #ifdef SEEK_SET
+ #	ifndef L_SET
+ #		define L_SET SEEK_SET
+ #	endif
+ # endif
+ 
+ #ifdef SEEK_CUR
+ #	ifndef L_INCR
+ #		define L_INCR SEEK_CUR
+ #	endif
+ # endif
+  */
+ 
+ #ifndef DONTDECLARE_MALLOC
+ extern PTR  EXFUN(malloc,(unsigned));
+ extern PTR  EXFUN(realloc, (PTR, unsigned));
+ extern void EXFUN(free,(PTR));
+ #endif
+ 
+ /* EXACT TYPES */
+ typedef char int8e_type;
+ typedef unsigned char uint8e_type;
+ typedef short int16e_type;
+ typedef unsigned short uint16e_type;
+ typedef int int32e_type;
+ typedef unsigned int uint32e_type;
+ 
+ /* CORRECT SIZE OR GREATER */
+ typedef char int8_type;
+ typedef unsigned char uint8_type;
+ typedef short int16_type;
+ typedef unsigned short uint16_type;
+ typedef int int32_type;
+ typedef unsigned int uint32_type;
+ 
+ #include "fopen-same.h"
*** ./bfd/configure.in-	Wed Jul  8 01:01:12 1992
--- ./bfd/configure.in	Wed Jul 15 18:00:46 1992
***************
*** 83,86 ****
--- 83,87 ----
  		sysv* | scosysv*) my_host=i386v ;;
  		mach*)	my_host=i386mach ;;
+ 		aix*)	my_host=i386aix ;;
  		msdos*)	my_host=dose ;;
  		linux)	my_host=i386linux ;;
***************
*** 186,189 ****
--- 187,191 ----
  m680[01234]0-none-os68k	) bfd_target=m68k-aout ;;
  i386-sco-*		) bfd_target=i386-coff ;;
+ i386-*-aix*		) bfd_target=i386-coff ;;
  
  a29k-none-aout		) bfd_target=a29k-aout ;;
*** ./bfd/archures.c-	Tue Jun 23 15:10:10 1992
--- ./bfd/archures.c	Wed Jul 15 15:49:16 1992
***************
*** 566,569 ****
--- 566,570 ----
  	}
  
+ #ifndef SELECT_ARCHITECTURES
      switch (number) 
      {
***************
*** 609,612 ****
--- 610,666 ----
  	return false;
      }
+ #else /* SELECT_ARCHITECTURES */
+     switch (number) 
+     {
+ #if SELECT_ARCHITECTURES == bfd_arch_m68k
+       case 68010:
+       case 68020:
+       case 68030:
+       case 68040:
+       case 68332:
+       case 68050:        
+       case 68000: 
+ 	arch = bfd_arch_m68k; 
+ 	break;
+ 
+ #elif SELECT_ARCHITECTURES == bfd_arch_i386
+       case 386: 
+       case 80386:
+       case 486:
+ 	arch = bfd_arch_i386;
+ 	break;
+ 
+       case 29000: 
+ 	arch = bfd_arch_a29k;
+ 	break;
+ 
+ #elif SELECT_ARCHITECTURES == bfd_arch_a29k
+       case 32016:
+       case 32032:
+       case 32132:
+       case 32232:
+       case 32332:
+       case 32432:
+       case 32532:  
+       case 32000: 
+ 	arch = bfd_arch_ns32k; 
+ 	break;
+ 
+ #elif SELECT_ARCHITECTURES == bfd_arch_i860
+       case 860:
+       case 80860: 
+ 	arch = bfd_arch_i860; 
+ 	break;
+ 
+ #elif SELECT_ARCHITECTURES == bfd_arch_rs6000
+       case 6000:
+ 	arch = bfd_arch_rs6000;
+ 	break;
+ #endif
+ 
+       default:  
+ 	return false;
+     }
+ #endif /* SELECT_ARCHITECTURES */
      if (arch != info->arch) 
       return false;
*** ./bfd/coff-i386.c-	Fri Jan 24 14:43:55 1992
--- ./bfd/coff-i386.c	Wed Jul 15 15:54:51 1992
***************
*** 24,27 ****
--- 24,33 ----
  #include "sysdep.h"
  #include "libbfd.h"
+ 
+ #if defined(_AIX)
+ #include <stddef.h>
+ #include <signal.h>
+ #endif
+ 
  #include "obstack.h"
  #include "coff/i386.h"
***************
*** 66,69 ****
--- 72,280 ----
  #include "coffcode.h"
  
+ #if defined(_AIX) && defined(_I386)
+ /* maybe this could work on some other i386 but I have not tried it
+  * mtranle@paris - Tue Sep 24 12:49:35 1991
+  */
+ 
+ #ifndef COR_MAGIC
+ # define COR_MAGIC "core"
+ #endif
+ 
+ /* need this cast because ptr is really void * */
+ #define core_hdr(bfd) \
+     (((bfd->tdata.trad_core_data))->hdr)
+ #define core_section(bfd,n) \
+     (((bfd)->tdata.trad_core_data)->sections[n])
+ #define core_regsec(bfd) \
+     (((bfd)->tdata.trad_core_data)->reg_section)
+ #define core_reg2sec(bfd) \
+     (((bfd)->tdata.trad_core_data)->reg2_section)
+ 
+ /* These are stored in the bfd's tdata */
+ struct trad_core_struct {
+   struct corehdr *hdr;		/* core file header */
+   asection *reg_section;
+   asection *reg2_section;
+   asection *sections[MAX_CORE_SEGS];
+ };
+ 
+ static bfd_target *
+ DEFUN(i3coff_core_file_p,(abfd),
+       bfd *abfd)
+ {
+   int i,n;
+   unsigned char longbuf[4];	/* Raw bytes of various header fields */
+   int core_size = CORHDRSIZ;
+   struct corehdr *core;
+   struct mergem {
+     struct trad_core_struct coredata;
+     struct corehdr internal_core;
+   } *mergem;
+ 
+   bfd_error = system_call_error;
+ 
+   if (bfd_read ((PTR)longbuf, 1, sizeof (longbuf), abfd) != sizeof (longbuf))
+     return 0;
+ 
+   if (strncmp(longbuf,COR_MAGIC,4)) return 0;
+ 
+   if (bfd_seek (abfd, 0L, false) < 0) return 0;
+ 
+   mergem = (struct mergem *)bfd_zalloc (abfd, sizeof (struct mergem));
+   if (mergem == NULL)
+     {
+       bfd_error = no_memory;
+       return 0;
+     }
+ 
+   core = &mergem->internal_core;
+ 
+   if ((bfd_read ((PTR) core, 1, core_size, abfd)) != core_size)
+     {
+       bfd_error = system_call_error;
+       bfd_release (abfd, (char *)mergem);
+       return 0;
+     }
+ 
+   set_tdata (abfd, &mergem->coredata);
+   core_hdr (abfd) = core;
+ 
+   /* create the sections.  This is raunchy, but bfd_close wants to reclaim
+      them */
+   core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
+   if (core_regsec (abfd) == NULL)
+     {
+     loser:
+       bfd_error = no_memory;
+       bfd_release (abfd, (char *)mergem);
+       return 0;
+     }
+   core_reg2sec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
+   if (core_reg2sec (abfd) == NULL)
+     {
+     loser1:
+       bfd_release (abfd, core_regsec (abfd));
+       goto loser;
+     }
+ 
+   for (i=0, n=0 ; (i < MAX_CORE_SEGS) && (core->cd_segs[i].cs_type) ; i++)
+     {
+       if (core->cd_segs[i].cs_offset == 0)
+ 	continue;
+       core_section (abfd,n) =
+ 	(asection *) bfd_zalloc (abfd, sizeof (asection));
+       if (core_section (abfd,n) == NULL)
+ 	{
+ 	  int j;
+ 	  if (n > 0)
+ 	    {
+ 	      for (j=0; j < n; j++)
+ 		bfd_release (abfd, core_section(abfd, j));
+ 	    }
+ 	  bfd_release (abfd, (char *)mergem);
+ 	  goto loser1;
+ 	}
+ 
+       switch (core->cd_segs[i].cs_type)
+ 	{
+ 	case COR_TYPE_DATA:
+ 	  core_section (abfd, n)->name = ".data";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_LOAD +
+ 					   SEC_HAS_CONTENTS);
+ 	  break;
+ 	case COR_TYPE_STACK:
+ 	  core_section (abfd, n)->name = ".stack";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_LOAD +
+ 					   SEC_HAS_CONTENTS);
+ 	  break;
+ 	case COR_TYPE_LIBDATA:
+ 	  core_section (abfd, n)->name = ".libdata";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_HAS_CONTENTS);
+ 	  break;
+ 	case COR_TYPE_WRITE:
+ 	  core_section (abfd, n)->name = ".writeable";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_HAS_CONTENTS);
+ 	  break;
+ 	case COR_TYPE_MSC:
+ 	  core_section (abfd, n)->name = ".misc";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_HAS_CONTENTS);
+ 	  break;
+ 	default:
+ 	  core_section (abfd, n)->name = ".unknown";
+ 	  core_section (abfd, n)->flags = (SEC_ALLOC + SEC_HAS_CONTENTS);
+ 	  break;
+ 	}
+       core_section (abfd, n)->_raw_size = core->cd_segs[i].cs_len;
+       core_section (abfd, n)->vma       = core->cd_segs[i].cs_address;
+       core_section (abfd, n)->filepos   = core->cd_segs[i].cs_offset;
+       core_section (abfd, n)->alignment_power = 2;
+       core_section (abfd, n)->next      = NULL;
+       if (n > 0)
+ 	core_section (abfd, (n-1))->next = core_section (abfd, n);
+ 
+       abfd->section_count = ++n;
+     }
+ 
+   core_regsec (abfd)->name = ".reg";
+   core_reg2sec (abfd)->name = ".reg2";
+ 
+   core_regsec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+   core_reg2sec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+ 
+   core_regsec (abfd)->_raw_size = sizeof(core->cd_regs);
+   core_reg2sec (abfd)->_raw_size = sizeof(core->cd_fpregs);
+ 
+   core_regsec (abfd)->vma = -1;
+   core_reg2sec (abfd)->vma = -1;
+ 
+   /* We'll access the regs afresh in the core file, like any section: */
+   core_regsec (abfd)->filepos = (file_ptr)offsetof(struct corehdr,cd_regs);
+   core_reg2sec (abfd)->filepos = (file_ptr)offsetof(struct corehdr,
+ 						    cd_fpregs);
+ 
+   /* add the 2 reg fake sections to abfd */
+   abfd->section_count += 2;
+   abfd->sections = core_regsec (abfd);
+   core_regsec (abfd)->next = core_reg2sec (abfd);
+   core_reg2sec (abfd)->next = core_section (abfd, 0);
+ 
+   return abfd->xvec;
+ }
+ 
+ static char *
+ DEFUN(i3coff_core_file_failing_command,(abfd),
+       bfd *abfd)
+ {
+   return core_hdr (abfd)->cd_comm;
+ }
+ 
+ static int
+ DEFUN(i3coff_core_file_failing_signal,(abfd),
+       bfd *abfd)
+ {
+   return core_hdr (abfd)->cd_cursig;
+ }
+ 
+ static boolean
+ DEFUN(i3coff_core_file_matches_executable_p, (core_bfd, exec_bfd),
+       bfd *core_bfd AND
+       bfd *exec_bfd)
+ {
+   return true;			/* FIXME, We have no way of telling at this
+ 				   point */
+ }
+ 
+ #undef	coff_core_file_failing_command
+ #define	coff_core_file_failing_command 	     i3coff_core_file_failing_command
+ #undef	coff_core_file_failing_signal
+ #define	coff_core_file_failing_signal	     i3coff_core_file_failing_signal
+ #undef	coff_core_file_matches_executable_p
+ #define	coff_core_file_matches_executable_p  i3coff_core_file_matches_executable_p
+ 
+ #else /* not _AIX && _I386 */
+ #define i3coff_core_file_p i3coff_object_p
+ 
+ #endif /* not _AIX && _I386 */
+ 
  #define coff_write_armap bsd_write_armap
  
***************
*** 93,97 ****
  /* Note that we allow an object file to be treated as a core file as well. */
      {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
!        bfd_generic_archive_p, i3coff_object_p},
      {bfd_false, coff_mkobject, _bfd_gen
eric_mkarchive, /* bfd_set_format */
         bfd_false},
--- 304,308 ----
  /* Note that we allow an object file to be treated as a core file as well. */
      {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */
!        bfd_generic_archive_p, i3coff_core_file_p},
      {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
         bfd_false},
*** ./bfd/coffcode.h-	Tue Jun 23 15:10:15 1992
--- ./bfd/coffcode.h	Wed Jul 15 16:32:19 1992
***************
*** 1048,1051 ****
--- 1048,1054 ----
  #ifdef I386MAGIC
    case I386MAGIC:
+ #ifdef I386SVMAGIC
+   case I386SVMAGIC:		/* System V C Compiler aix ps2 */
+ #endif
      arch = bfd_arch_i386;
      machine = 0;
*** ./bfd/ChangeLog-	Tue Jul 14 14:08:33 1992
--- ./bfd/ChangeLog	Wed Jul 15 17:20:56 1992
***************
*** 1,2 ****
--- 1,29 ----
+ Wed Jul 15 17:20:35 1992  Minh Tran-Le (mtranle@paris)
+ 
+ 	* configure.in: added new target for i386-ibm-aix.
+ 
+ 	* Makefile.in: modified to pass SELECT_ARCHITECTURES while
+ 	compiling archures.c
+ 
+ 	* archures.c: bfd_default_scan modified to the minimum when
+ 	SELECT_ARCHITECTURES is defined.
+ 
+ 	* coff-i386.c: added new code for handling core files on i386aix.
+ 	  - new functions added: i3coff_core_file_p,
+ 	    i3coff_core_file_failing_command,
+ 	    i3coff_core_file_failing_signal,
+ 	    i3coff_core_file_matches_executable_p.
+ 
+ 	* coffcode.h (coff_real_object_p): added case for I386SVMAGIC
+ 	  for i386aix which can use either I386SVMAGIC or I386MAGIC.
+ 
+ 	* hosts/i386aix.h: new file for i386aix host (i386-ibm-aix).
+ 	same as host/i386v.h
+ 
+ 	* config/i386aix.mh: new file for i386aix host (i386-ibm-aix).
+ 
+ 	* config/i386-coff.mt: added define for SELECT_ARCHITECTURES to
+ 	bfd_i386_arch
+ 
  Tue Jul 14 14:06:28 1992  Stu Grossman  (grossman at cygnus.com)
  
*** ./bfd/Makefile.in-	Tue Jun 23 15:10:09 1992
--- ./bfd/Makefile.in	Wed Jul 15 15:43:13 1992
***************
*** 134,137 ****
--- 134,140 ----
  	$(CC) $(CFLAGS) -c $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
  
+ archures.o: archures.c
+ 	$(CC) $(CFLAGS) -c $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) -DMINIMIZE=$(MINIMIZE) $(TDEFAULTS) $<
+ 
  subdir_do: force
  	@for i in $(DODIRS); do \
*** ./include/coff/i386.h-	Wed Jun 10 07:59:18 1992
--- ./include/coff/i386.h	Wed Jul 15 17:18:07 1992
***************
*** 1,3 ****
! /*** coff information for M68K */
  
  
--- 1,3 ----
! /*** coff information for Intel 386 */
  
  
***************
*** 30,35 ****
  
  
! #define	I386MAGIC	0x14c
! #define I386BADMAG(x) (((x).f_magic!=I386MAGIC))
  
  
--- 30,42 ----
  
  
! #ifdef _AIX
! # define I386MAGIC	0565	/* Danbury AIX C compiler 	*/
! # define I386SVMAGIC	0514	/* System V C Compiler 		*/
! # define I386BADMAG(x)  (((x).f_magic!=I386MAGIC) && \
! 			 ((x).f_magic!=I386SVMAGIC))
! #else /* not _AIX */
! # define I386MAGIC	0x14c
! # define I386BADMAG(x) (((x).f_magic!=I386MAGIC))
! #endif /* not _AIX */
  
  
***************
*** 56,59 ****
--- 63,67 ----
  
  #define AOUTSZ (sizeof(AOUTHDR))
+ #define AOUTHDRSZ (sizeof(AOUTHDR))
  
  #define OMAGIC          0404    /* object files, eg as output */
***************
*** 316,319 ****
--- 324,395 ----
  #define RELSZ 10
  
+ /*
+  *   relocation types for all products and generics
+  */
+ 
+ /*
+  * All generics
+  *	reloc. already performed to symbol in the same section
+  */
+ #define  R_ABS		0
+ 
+ /*
+  * X86 generic
+  *	8-bit offset reference in 8-bits
+  *	8-bit offset reference in 16-bits 
+  *	12-bit segment reference
+  *	auxiliary relocation entry
+  */
+ #define	R_OFF8		07
+ #define R_OFF16		010
+ #define	R_SEG12		011
+ #define	R_AUX		013
+ 
+ /*
+  * B16 and X86 generics
+  *	16-bit direct reference
+  *	16-bit "relative" reference
+  *	16-bit "indirect" (TV) reference
+  */
+ #define  R_DIR16	01
+ #define  R_REL16	02
+ #define  R_IND16	03
+ 
+ /*
+  * 3B generic
+  *	24-bit direct reference
+  *	24-bit "relative" reference
+  *	16-bit optimized "indirect" TV reference
+  *	24-bit "indirect" TV reference
+  *	32-bit "indirect" TV reference
+  */
+ #define  R_DIR24	04
+ #define  R_REL24	05
+ #define  R_OPT16	014
+ #define  R_IND24	015
+ #define  R_IND32	016
+ 
+ /* 
+  * XL generics
+  *	10-bit direct reference
+  *	10-bit "relative" reference
+  *	32-bit "relative" reference
+  */
+ #define	R_DIR10		025
+ #define R_REL10		026
+ #define R_REL32		027
+ 
+ /*
+  * 3B and M32 generics
+  *	32-bit direct reference
+  */
+ #define  R_DIR32	06
+ 
+ /*
+  * M32 generic
+  *	32-bit direct reference with bytes swapped
+  */
+ #define  R_DIR32S	012
+ 
  #define DEFAULT_DATA_SECTION_ALIGNMENT 4
  #define DEFAULT_BSS_SECTION_ALIGNMENT 4
***************
*** 321,322 ****
--- 397,530 ----
  /* For new sections we havn't heard of before */
  #define DEFAULT_SECTION_ALIGNMENT 4
+ 
+ 
+ /* ------------------------------------------------------------------------- */
+ 
+ #if defined(_AIX) && defined(_I386)
+ 
+ /* -- from uinfo.h -- */
+ 
+ #define UINFOSIZ        64      /* size of user info buffer             */
+ typedef char uinfo_t[UINFOSIZ];
+ 
+ struct env387 
+ {
+   unsigned short control;
+   unsigned short r0;
+   unsigned short status;
+   unsigned short r1;
+   unsigned short tag;
+   unsigned short r2;
+   unsigned long eip;
+   unsigned short code_seg;
+   unsigned short opcode;
+   unsigned long operand;
+   unsigned short operand_seg;
+   unsigned short r3;
+   unsigned char regs[8][10];
+ };
+ 
+ #define	CD_NAMELEN 16	/* length of most names in this header		*/
+ #define	CORHDRSIZ	2048	/* size to which header is padded out	*/
+ #define	MAX_CORE_SEGS	32	/* maximum segments in a core dump	*/
+ #define NUM_FREGS	1			/* # of saved FP regs	*/
+ 
+ /*
+  * These are defined such that 286 and 386 kernels can produce
+  * compatible dumps.
+  */
+ #define CD_AX	0
+ #define CD_BX	1
+ #define CD_CX	2
+ #define CD_DX	3
+ #define CD_SI	4
+ #define CD_DI	5
+ #define CD_BP	6
+ #define CD_SP	7
+ #define CD_FL	8
+ #define CD_IP	9
+ #define CD_CS	10
+ #define CD_DS	11
+ #define CD_ES	12
+ #define CD_FS	13
+ #define CD_GS	14
+ #define CD_SS	15
+ #define NUM_REGS	16
+ 
+ #ifndef SPATHLEN
+ # define SPATHLEN 16			/* sys/param.h 			*/
+ #endif
+ #ifndef NSIG
+ # define NSIG 63			/* sys/signal.h 		*/
+ # define SIGSETSZ ((NSIG+31)/32)
+   typedef struct ksigmask {
+ 	 unsigned long sigs[SIGSETSZ];
+        } ksigmask_t;
+ #endif
+ 
+ struct corehdr
+ {
+ 	char	cd_magic[4];		/* COR_MAGIC = "core"		*/
+ 
+ 	/* general information about the dump itself */
+ 	struct dumpseg {		/* table of contents for dump	*/
+ 		long	cs_type;	/* seg. type; see below		*/
+ 		long	cs_len;		/* length (in bytes) of segment	*/
+ 		long	cs_offset;	/* offset (in dump) of segment	*/
+ 		long	cs_address;	/* address segment had in mem	*/
+ 	} cd_segs[MAX_CORE_SEGS];
+ 
+ 	/* general information about the process */
+ 	char	cd_comm[CD_NAMELEN];	/* command being run		*/
+ 	char	cd_mach[CD_NAMELEN];	/* type of machine it ran on	*/
+ 	char	cd_site[CD_NAMELEN];	/* name of site it ran on	*/
+ 	long	cd_ldtype;		/* type of load module running	*/
+ 	char	cd_intsize;		/* sizeof(int)			*/
+ 	char	cd_dptrsize;		/* sizeof(char *)		*/
+ 	char	cd_tptrsize;		/* sizeof(int (*)())		*/
+ 	char	cd_unused;
+ 
+ 	/* user-mode program state */
+ 	long	cd_regs[NUM_REGS];	/* user-mode general registers	*/
+ 	struct env387 cd_fpregs;	/* user-mode floating-point state */
+ 
+ 	/* kernel-mode program state */
+ 	int	(*cd_sig[NSIG])();	/* disposition of signals	*/
+ 	ksigmask_t cd_sigmask;		/* signals to be blocked	*/
+ 	ksigmask_t cd_sigpend;		/* signals currently pending	*/
+ 	long	cd_cursig;		/* signal that caused the dump	*/
+ 
+ 	long	cd_pid;			/* process ID of the corpse	*/
+ 	long	cd_ppid;		/* parent process ID of corpse	*/
+ 	short	cd_uid;			/* process effective user ID	*/
+ 	short	cd_ruid;		/* process real user ID		*/
+ 	short	cd_gid;			/* process effective group ID	*/
+ 	short	cd_rgid;		/* process real group ID	*/
+ 
+ 	uinfo_t	cd_uinfo;		/* buffer of user information	*/
+ 	char	cd_locname[32];		/* name of /local		*/
+ 	char	cd_uvers[CD_NAMELEN];	/* user version string		*/
+ 	unsigned short cd_spath[SPATHLEN];	/* sitepath		*/
+ };
+ 
+ #if 0 /* defined(NOCHECKS) */
+ /* this will generate an error if sizeof(struct corehdr) > CORHDRSIZ */
+ struct { char xxcdxx[CORHDRSIZ+1-sizeof(struct corehdr)]; };
+ #endif	/* ! NOCHECKS */
+ 
+ /*
+  * segment types (in cs_type)
+  *	each segment in the address space appears here, whether or not it
+  *	is actually dumped.  Read/only segments will not actually be dumped.
+  *	A segment that is not in the dump will have a cs_offset of zero.
+  */
+ #define	COR_TYPE_CODE		'x'	/* process code - NOT IN DUMP	*/
+ #define	COR_TYPE_DATA		'd'	/* process data segment		*/
+ #define	COR_TYPE_STACK		's'	/* process stack segment	*/
+ #define COR_TYPE_LIBCODE	'X'	/* shared lib code - NOT IN DUMP*/
+ #define COR_TYPE_LIBDATA	'D'	/* shared lib data		*/
+ #define COR_TYPE_READ		'r'	/* other read/only - NOT IN DUMP*/
+ #define COR_TYPE_WRITE		'w'	/* other writeable		*/
+ #define	COR_TYPE_MSC		'?'	/* other, mapped in segment	*/
+ 
+ #endif /* _AIX && _I386 */
*** ./include/coff/ChangeLog-	Fri Jun 12 23:00:37 1992
--- ./include/coff/ChangeLog	Wed Jul 15 17:19:40 1992
***************
*** 1,2 ****
--- 1,8 ----
+ Wed Jul 15 17:19:13 1992  Minh Tran-Le (mtranle@paris)
+ 
+ 	* i386.h:
+ 	  - Added defines for magic number on i386aix.
+ 	  - Added structure env387 and corehdr for handling core on i386aix.
+ 
  Fri Jun 12 20:11:04 1992  John Gilmore  (gnu at cygnus.com)
  
*** ./libiberty/strsignal.c-	Mon Jul  6 10:12:03 1992
--- ./libiberty/strsignal.c	Wed Jul 15 17:30:01 1992
***************
*** 186,189 ****
--- 186,210 ----
    SIGLWP, "SIGLWP", "Signal LWP",
  #endif
+ #if defined (SIGMSG)
+   SIGMSG, "MSG", "HFT input data pending",
+ #endif
+ #if defined (SIGDANGER)
+   SIGDANGER, "DANGER", "system crash imminent",
+ #endif
+ #if defined (SIGMIGRATE)
+   SIGMIGRATE, "MIGRATE", "migrate process to another CPU",
+ #endif
+ #if defined (SIGPRE)
+   SIGPRE, "PRE", "programming error",
+ #endif
+ #if defined (SIGGRANT)
+   SIGGRANT, "GRANT", "HFT monitor mode granted",
+ #endif
+ #if defined (SIGRETRACT)
+   SIGRETRACT, "RETRACT", "HFT monitor mode retracted",
+ #endif
+ #if defined (SIGSOUND)
+   SIGSOUND, "SOUND", "HFT sound sequence has completed",
+ #endif
    0, NULL, NULL
  };
*** ./readline/config/mh-aix-	Wed Jul 15 17:33:56 1992
--- ./readline/config/mh-aix	Wed Jul 15 17:33:56 1992
***************
*** 0 ****
--- 1,5 ----
+ # Define USG as -DUSG if you are using a System V operating system.
+ USG = -DAIX -DHAVE_UNISTD_H
+ RANLIB = /bin/true
+ INSTALL_PROG = cp
+ 
*** ./readline/sysdep-aix.h-	Fri Nov 22 09:07:38 1991
--- ./readline/sysdep-aix.h	Wed Jul 15 17:33:08 1992
***************
*** 1,5 ****
--- 1,9 ----
  /* System-dependent stuff for AIX 3.1 on RS/6000 */
  
+ #ifdef __GNUC__
+ #define alloca __builtin_alloca
+ #else
  #pragma alloca
+ #endif /* __GNUC__ */
  #include <sys/types.h>
  #include <dirent.h>
*** ./readline/configure.in-	Thu Jun 25 16:16:17 1992
--- ./readline/configure.in	Wed Jul 15 17:32:09 1992
***************
*** 40,46 ****
  	;;
  aix*)
- 	host_makefile_frag=config/mh-sysv
  	case "${host_cpu}" in
  	rs6000)	files=sysdep-aix.h
  	esac
  	;;
--- 40,50 ----
  	;;
  aix*)
  	case "${host_cpu}" in
  	rs6000)	files=sysdep-aix.h
+ 		host_makefile_frag=config/mh-sysv
+ 		;;
+ 	i386)	files=sysdep-aix.h
+ 		host_makefile_frag=config/mh-aix
+ 		;;
  	esac
  	;;
*** ./config.sub-	Tue Jul 14 19:45:49 1992
--- ./config.sub	Wed Jul 15 14:31:15 1992
***************
*** 109,112 ****
--- 109,116 ----
  		os=-sysv32
  		;;
+ 	i386-aix*)
+ 		basic_machine=i386-ibm
+ 		os=-aix
+ 		;;
  	i386-sco* | i386sco | sco)
  		basic_machine=i386-unknown
-------
Technical Details
Message-ID: <9207181928.AA26238@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!intellicorp.com!TRANLE

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,2b8568d565aa30dd,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-07-18 06:53:56 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!intellicorp.com!TRANLE
From: TRANLE@intellicorp.com (Minh Tran-Le)
Subject: patches for gdb-4.6 on aix ps/2 1.2.1 ...
Message-ID: <9207181928.AA26238@life.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Reply-To: tranle@intellicorp.com
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 18 Jul 1992 19:26:04 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 1632