]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2007-11-07 Markus Deuling <deuling@de.ibm.com>
authorMarkus Deuling <deuling@de.ibm.com>
Wed, 7 Nov 2007 06:53:41 +0000 (06:53 +0000)
committerMarkus Deuling <deuling@de.ibm.com>
Wed, 7 Nov 2007 06:53:41 +0000 (06:53 +0000)
* shnbsd-tdep.c (shnbsd_supply_gregset, shnbsd_collect_gregset): Use
get_regcache_arch to get at the current architecture by regcache.
* xstormy16-tdep.c (xstormy16_frame_prev_register): Use get_frame_arch
to get at the current architecture by frame_info.
* fbsd-nat.c (fbsd_make_corefile_notes): Use get_regcache_arch to get
at the current architecture by regcache.
* gnu-v3-abi.c (gnuv3_skip_trampoline): Use get_frame_arch to get at
the current architecture by frame_info.
(build_gdb_vtable_type): Replace current_gdbarch by gdbarch.
* aix-thread.c (special_register_p): Add gdbarch as parameter.
(fetch_regs_kernel_thread, store_regs_kernel_thread): Add gdbarch to
caller of special_register_p.

gdb/ChangeLog
gdb/aix-thread.c
gdb/fbsd-nat.c
gdb/gnu-v3-abi.c
gdb/shnbsd-tdep.c
gdb/xstormy16-tdep.c

index 3e169d005c0e96f1ad1e190d88b31a528520dfea..8049d36374dc8b2af0831b86a6c914a7b7923378 100644 (file)
@@ -1,3 +1,18 @@
+2007-11-07  Markus Deuling  <deuling@de.ibm.com>
+
+       * shnbsd-tdep.c (shnbsd_supply_gregset, shnbsd_collect_gregset): Use
+       get_regcache_arch to get at the current architecture by regcache.
+       * xstormy16-tdep.c (xstormy16_frame_prev_register): Use get_frame_arch
+       to get at the current architecture by frame_info.
+       * fbsd-nat.c (fbsd_make_corefile_notes): Use get_regcache_arch to get
+       at the current architecture by regcache.
+       * gnu-v3-abi.c (gnuv3_skip_trampoline): Use get_frame_arch to get at
+       the current architecture by frame_info.
+       (build_gdb_vtable_type): Replace current_gdbarch by gdbarch.
+       * aix-thread.c (special_register_p): Add gdbarch as parameter.
+       (fetch_regs_kernel_thread, store_regs_kernel_thread): Add gdbarch to
+       caller of special_register_p.
+
 2007-11-07  Markus Deuling  <deuling@de.ibm.com>
 
        * infcall.c (call_function_by_hand): Use get_frame_arch to get at the
index a941ea7d63d2a075b1e9fec0d14f87a483965022..794e7db0c0cbb45a4209f2473bd79d8b35deaf7f 100644 (file)
@@ -1060,11 +1060,11 @@ supply_fprs (struct regcache *regcache, double *vals)
 
 /* Predicate to test whether given register number is a "special" register.  */
 static int
-special_register_p (int regno)
+special_register_p (struct gdbarch *gdbarch, int regno)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  return regno == gdbarch_pc_regnum (current_gdbarch)
+  return regno == gdbarch_pc_regnum (gdbarch)
       || regno == tdep->ppc_ps_regnum
       || regno == tdep->ppc_cr_regnum
       || regno == tdep->ppc_lr_regnum
@@ -1237,7 +1237,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
 
   /* Special-purpose registers.  */
 
-  if (regno == -1 || special_register_p (regno))
+  if (regno == -1 || special_register_p (gdbarch, regno))
     {
       if (arch64)
        {
@@ -1554,7 +1554,7 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
 
   /* Special-purpose registers.  */
 
-  if (regno == -1 || special_register_p (regno))
+  if (regno == -1 || special_register_p (gdbarch, regno))
     {
       if (arch64)
        {
index 75775ecc039ba03bac8413e94a28579112d88713..2caf9bb57ef6473d1b75ed55017849bedd8dd90a 100644 (file)
@@ -143,8 +143,8 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
 char *
 fbsd_make_corefile_notes (bfd *obfd, int *note_size)
 {
-  struct gdbarch *gdbarch = current_gdbarch;
   const struct regcache *regcache = get_current_regcache ();
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   gregset_t gregs;
   fpregset_t fpregs;
   char *note_data = NULL;
index c3e07a10675ad8428b29427265445df1bafc9c53..a76db90874a983e3c4a9de761e32f6f79c9d47e0 100644 (file)
@@ -98,9 +98,7 @@ enum {
    described above, laid out appropriately for ARCH.
 
    We use this function as the gdbarch per-architecture data
-   initialization function.  We assume that the gdbarch framework
-   calls the per-architecture data initialization functions after it
-   sets current_gdbarch to the new architecture.  */
+   initialization function.  */
 static void *
 build_gdb_vtable_type (struct gdbarch *arch)
 {
@@ -116,7 +114,7 @@ build_gdb_vtable_type (struct gdbarch *arch)
   /* ARCH can't give us the true ptrdiff_t type, so we guess.  */
   struct type *ptrdiff_type
     = init_type (TYPE_CODE_INT,
-                gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT, 0,
+                gdbarch_ptr_bit (arch) / TARGET_CHAR_BIT, 0,
                  "ptrdiff_t", 0);
 
   /* We assume no padding is necessary, since GDB doesn't know
@@ -680,12 +678,12 @@ static CORE_ADDR
 gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
 {
   CORE_ADDR real_stop_pc, method_stop_pc;
+  struct gdbarch *gdbarch = get_frame_arch (frame);
   struct minimal_symbol *thunk_sym, *fn_sym;
   struct obj_section *section;
   char *thunk_name, *fn_name;
   
-  real_stop_pc = gdbarch_skip_trampoline_code
-                  (current_gdbarch, frame, stop_pc);
+  real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
   if (real_stop_pc == 0)
     real_stop_pc = stop_pc;
 
@@ -709,7 +707,7 @@ gnuv3_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
 
   method_stop_pc = SYMBOL_VALUE_ADDRESS (fn_sym);
   real_stop_pc = gdbarch_skip_trampoline_code
-                  (current_gdbarch, frame, method_stop_pc);
+                  (gdbarch, frame, method_stop_pc);
   if (real_stop_pc == 0)
     real_stop_pc = method_stop_pc;
 
index 8fbb950700d286c64c518476cf7d61f4f8e0bcd3..d0be64b4fbff1b0d994ccdd40fc50c36c4c9d315 100644 (file)
@@ -67,14 +67,14 @@ shnbsd_supply_gregset (const struct regset *regset,
                       struct regcache *regcache,
                       int regnum, const void *gregs, size_t len)
 {
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   const gdb_byte *regs = gregs;
   int i;
 
   gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
 
-  if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == -1)
-    regcache_raw_supply (regcache,
-                        gdbarch_pc_regnum (current_gdbarch),
+  if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+    regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
                         regs + (0 * 4));
 
   if (regnum == SR_REGNUM || regnum == -1)
@@ -106,13 +106,14 @@ shnbsd_collect_gregset (const struct regset *regset,
                        const struct regcache *regcache,
                        int regnum, void *gregs, size_t len)
 {
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   gdb_byte *regs = gregs;
   int i;
 
   gdb_assert (len >= SHNBSD_SIZEOF_GREGS);
 
-  if (regnum == gdbarch_pc_regnum (current_gdbarch) || regnum == -1)
-    regcache_raw_collect (regcache, gdbarch_pc_regnum (current_gdbarch),
+  if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
+    regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch),
                          regs + (0 * 4));
 
   if (regnum == SR_REGNUM || regnum == -1)
index 42d854605d3311b96b095e3b71fc2161d0df7905..21d9cc3712ab22d879edaa9e85b9acbe2ed187c2 100644 (file)
@@ -706,7 +706,7 @@ xstormy16_frame_prev_register (struct frame_info *next_frame,
         {
           /* Read the value in from memory.  */
           read_memory (*addrp, valuep,
-                       register_size (current_gdbarch, regnum));
+                       register_size (get_frame_arch (next_frame), regnum));
         }
       return;
     }