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]

[rfa] Don't refer to previous arch in rs6000_gdbarch_init()


Hello,

The attatched patch removes a reference to the old architecture (via 
TDEP -> gdbarch_tdep (current_gdbarch)) in rs6000_gdbarch_init().

Given that the previous architecture may not be a member of the rs6000 
family, using a value from the previous architectures tdep makes for a 
high risk operation.  I think rs6000 should instead arrange to keep a 
local copy of any stuff it wants to refer to.

Is this change to address the immediate problem ok?

	Andrew
2001-09-25  Andrew Cagney  <ac131313@redhat.com>

	* rs6000-tdep.c (rs6000_gdbarch_init): Don't use the previous
	architecture to infer the wordsize.  Previous architecture may not
	be a PowerPC.

Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.26
diff -p -r1.26 rs6000-tdep.c
*** rs6000-tdep.c	2001/08/01 18:39:23	1.26
--- rs6000-tdep.c	2001/09/26 01:54:14
*************** rs6000_gdbarch_init (struct gdbarch_info
*** 2181,2191 ****
      }
    else
      {
!       tdep = TDEP;
!       if (tdep)
! 	wordsize = tdep->wordsize;
!       else
! 	wordsize = 4;
      }
  
    /* Find a candidate among extant architectures. */
--- 2181,2187 ----
      }
    else
      {
!       wordsize = 4;
      }
  
    /* Find a candidate among extant architectures. */

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