]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ada-tasks.c (read_known_tasks_array): Use target_gdbarch instead
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:44:23 +0000 (18:44 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 17 Jun 2009 18:44:23 +0000 (18:44 +0000)
of current_gdbarch.
* aix-thread.c (pd_enable): Likewise.
* amd64-linux-nat.c (ps_get_thread_area): Likewise.
* bsd-uthread.c (bsd_uthread_activate): Likewise.
* linux-nat.c (linux_nat_info_proc_cmd): Likewise.
* linux-thread-db.c (enable_thread_event): Likewise.
* monitor.c (monitor_write_memory, monitor_read_memory): Likewise.
* nto-procfs.c (procfs_open): Likewise.
* procfs.c (invalidate_cache, procfs_insert_watchpoint,
info_proc_mappings, info_mappings_callback): Likewise.
* record.c (record_open): Likewise.
* rs6000-nat.c (ARCH64): Likewise.
* solib-darwin.c (darwin_solib_create_inferior_hook): Likewise.
(darwin_bfd_open): Likewise.
* memattr.c (mem_info_command): Likewise.

* windows-nat.c (win32_resume): Use current regcache architecture
instead of current_gdbarch.

* dbug-rom.c (dbug_regname): Remove check against number of
registers in current_gdbarch.
* solib-pa64.c (read_dynamic_info): Remove unused variable.

18 files changed:
gdb/ChangeLog
gdb/ada-tasks.c
gdb/aix-thread.c
gdb/amd64-linux-nat.c
gdb/bsd-uthread.c
gdb/dbug-rom.c
gdb/i386-darwin-nat.c
gdb/linux-nat.c
gdb/linux-thread-db.c
gdb/memattr.c
gdb/monitor.c
gdb/nto-procfs.c
gdb/procfs.c
gdb/record.c
gdb/rs6000-nat.c
gdb/solib-darwin.c
gdb/solib-pa64.c
gdb/windows-nat.c

index 38c8afe54be29746dd13c7167548b2540938f4e2..f6e75c0b5a265264c60c2bd0cc9b02d196e475d1 100644 (file)
@@ -1,3 +1,29 @@
+2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * ada-tasks.c (read_known_tasks_array): Use target_gdbarch instead
+       of current_gdbarch.
+       * aix-thread.c (pd_enable): Likewise.
+       * amd64-linux-nat.c (ps_get_thread_area): Likewise.
+       * bsd-uthread.c (bsd_uthread_activate): Likewise.
+       * linux-nat.c (linux_nat_info_proc_cmd): Likewise.
+       * linux-thread-db.c (enable_thread_event): Likewise.
+       * monitor.c (monitor_write_memory, monitor_read_memory): Likewise.
+       * nto-procfs.c (procfs_open): Likewise.
+       * procfs.c (invalidate_cache, procfs_insert_watchpoint,
+       info_proc_mappings, info_mappings_callback): Likewise.
+       * record.c (record_open): Likewise.
+       * rs6000-nat.c (ARCH64): Likewise.
+       * solib-darwin.c (darwin_solib_create_inferior_hook): Likewise.
+       (darwin_bfd_open): Likewise.
+       * memattr.c (mem_info_command): Likewise.
+
+       * windows-nat.c (win32_resume): Use current regcache architecture
+       instead of current_gdbarch.
+
+       * dbug-rom.c (dbug_regname): Remove check against number of
+       registers in current_gdbarch.
+       * solib-pa64.c (read_dynamic_info): Remove unused variable.
+
 2009-06-17  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * dummy-frame.c (deprecated_pc_in_call_dummy): Add GDBARCH parameter,
index c0d2ed58268d047983b9628d047679426976325d..34a289a5c06aad62ede87a153652c04de3616d10 100644 (file)
@@ -609,7 +609,7 @@ static int
 read_known_tasks_array (void)
 {
   const int target_ptr_byte =
-    gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT;
+    gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT;
   const CORE_ADDR known_tasks_addr = get_known_tasks_addr ();
   const int known_tasks_size = target_ptr_byte * MAX_NUMBER_OF_KNOWN_TASKS;
   gdb_byte *known_tasks = alloca (known_tasks_size);
@@ -632,7 +632,7 @@ read_known_tasks_array (void)
   for (i = 0; i < MAX_NUMBER_OF_KNOWN_TASKS; i++)
     {
       struct type *data_ptr_type =
-        builtin_type (current_gdbarch)->builtin_data_ptr;
+        builtin_type (target_gdbarch)->builtin_data_ptr;
       CORE_ADDR task_id =
         extract_typed_address (known_tasks + i * target_ptr_byte,
                               data_ptr_type);
index 39be0015e64f3e6b4c605068cd2a94b427fc61b5..60eb5e2dadcf00e9dd0d1815848c91e09f6c28ea 100644 (file)
@@ -887,7 +887,7 @@ pd_enable (void)
     return;
 
   /* Check application word size.  */
-  arch64 = register_size (current_gdbarch, 0) == 8;
+  arch64 = register_size (target_gdbarch, 0) == 8;
 
   /* Check whether the application is pthreaded.  */
   stub_name = NULL;
index 149ba2fc674576191499b31ea5b3ed86083b9ef7..7d8461c911659d2a5c5c409d45fe73bfc1fe9e2d 100644 (file)
@@ -341,7 +341,7 @@ ps_err_e
 ps_get_thread_area (const struct ps_prochandle *ph,
                     lwpid_t lwpid, int idx, void **base)
 {
-  if (gdbarch_ptr_bit (current_gdbarch) == 32)
+  if (gdbarch_ptr_bit (target_gdbarch) == 32)
     {
       /* The full structure is found in <asm-i386/ldt.h>.  The second
         integer is the LDT's base_address and that is used to locate
index e84e0f088493a890896eac60b53a76c320572dcb..22962c06ed6b012d0eb651ab212078a4eb2f38f6 100644 (file)
@@ -159,7 +159,7 @@ bsd_uthread_read_memory_address (CORE_ADDR addr)
 static int
 bsd_uthread_activate (struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = current_gdbarch;
+  struct gdbarch *gdbarch = target_gdbarch;
   struct bsd_uthread_ops *ops = gdbarch_data (gdbarch, bsd_uthread_data);
 
   /* Skip if the thread stratum has already been activated.  */
index 4bcb5a67f0171be9e1e98c50171718065d39bc8b..f8886d9044af747403e62c61d7f62f14798c1007 100644 (file)
@@ -90,8 +90,7 @@ dbug_regname (int index)
     /* no float registers */
   };
 
-  if ((index >= (sizeof (regnames) / sizeof (regnames[0]))) 
-      || (index < 0) || (index >= gdbarch_num_regs (current_gdbarch)))
+  if (index >= ARRAY_SIZE (regnames) || index < 0)
     return NULL;
   else
     return regnames[index];
index c444d85c743f9fc6b9101c6224aeee6dfd727bf9..8a90b17a9da2912697909e5f3278e28f68725d2f 100644 (file)
@@ -404,7 +404,7 @@ i386_darwin_dr_get_status (void)
 void
 darwin_check_osabi (darwin_inferior *inf, thread_t thread)
 {
-  if (gdbarch_osabi (current_gdbarch) == GDB_OSABI_UNKNOWN)
+  if (gdbarch_osabi (target_gdbarch) == GDB_OSABI_UNKNOWN)
     {
       /* Attaching to a process.  Let's figure out what kind it is.  */
       x86_thread_state_t gp_regs;
@@ -422,7 +422,7 @@ darwin_check_osabi (darwin_inferior *inf, thread_t thread)
 
       gdbarch_info_init (&info);
       gdbarch_info_fill (&info);
-      info.byte_order = gdbarch_byte_order (current_gdbarch);
+      info.byte_order = gdbarch_byte_order (target_gdbarch);
       info.osabi = GDB_OSABI_DARWIN;
       if (gp_regs.tsh.flavor == x86_THREAD_STATE64)
        info.bfd_arch_info = bfd_lookup_arch (bfd_arch_i386,
index e9e010ea8a8623632029f51906aa27a7165c373d..35114ce3051de868a8cc7a608527c0523b436dc7 100644 (file)
@@ -3791,7 +3791,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
 
          cleanup = make_cleanup_fclose (procfile);
          printf_filtered (_("Mapped address spaces:\n\n"));
-         if (gdbarch_addr_bit (current_gdbarch) == 32)
+         if (gdbarch_addr_bit (target_gdbarch) == 32)
            {
              printf_filtered ("\t%10s %10s %10s %10s %7s\n",
                           "Start Addr",
@@ -3817,7 +3817,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
                 a generic local_address_string instead to print out
                 the addresses; that makes sense to me, too.  */
 
-             if (gdbarch_addr_bit (current_gdbarch) == 32)
+             if (gdbarch_addr_bit (target_gdbarch) == 32)
                {
                  printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
                               (unsigned long) addr,    /* FIXME: pr_addr */
index eedb2cc772373f77abc0ae8f35b645c33daca23f..d6c10fa202e548278ff07595765e5b208e10617e 100644 (file)
@@ -509,7 +509,7 @@ enable_thread_event (int event, CORE_ADDR *bp)
   /* Set up the breakpoint.  */
   gdb_assert (exec_bfd);
   (*bp) = (gdbarch_convert_from_func_ptr_addr
-          (current_gdbarch,
+          (target_gdbarch,
            /* Do proper sign extension for the target.  */
            (bfd_get_sign_extend_vma (exec_bfd) > 0
             ? (CORE_ADDR) (intptr_t) notify.u.bptaddr
index 5b52f8505721922ab935ea934912e22858d87de0..356b4d6194a470b8243a6ecbe759db0d568ef020 100644 (file)
@@ -432,10 +432,10 @@ mem_info_command (char *args, int from_tty)
   printf_filtered ("Num ");
   printf_filtered ("Enb ");
   printf_filtered ("Low Addr   ");
-  if (gdbarch_addr_bit (current_gdbarch) > 32)
+  if (gdbarch_addr_bit (target_gdbarch) > 32)
     printf_filtered ("        ");
   printf_filtered ("High Addr  ");
-  if (gdbarch_addr_bit (current_gdbarch) > 32)
+  if (gdbarch_addr_bit (target_gdbarch) > 32)
     printf_filtered ("        ");
   printf_filtered ("Attrs ");
   printf_filtered ("\n");
@@ -446,14 +446,14 @@ mem_info_command (char *args, int from_tty)
       printf_filtered ("%-3d %-3c\t",
                       m->number,
                       m->enabled_p ? 'y' : 'n');
-      if (gdbarch_addr_bit (current_gdbarch) <= 32)
+      if (gdbarch_addr_bit (target_gdbarch) <= 32)
        tmp = hex_string_custom ((unsigned long) m->lo, 8);
       else
        tmp = hex_string_custom ((unsigned long) m->lo, 16);
       
       printf_filtered ("%s ", tmp);
 
-      if (gdbarch_addr_bit (current_gdbarch) <= 32)
+      if (gdbarch_addr_bit (target_gdbarch) <= 32)
        {
        if (m->hi == 0)
          tmp = "0x100000000";
index fcee96b145621297abfdae0871a2638ef8bd201f..10e588a9f2dbd0f27ccb3d278c9791ed4eaa20f0 100644 (file)
@@ -1412,7 +1412,7 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
   monitor_debug ("MON write %d %s\n", len, paddr (memaddr));
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
-    memaddr = gdbarch_addr_bits_remove (current_gdbarch, memaddr);
+    memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
 
   /* Use memory fill command for leading 0 bytes.  */
 
@@ -1811,7 +1811,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
                 paddr_nz (memaddr), (long) myaddr, len);
 
   if (current_monitor->flags & MO_ADDR_BITS_REMOVE)
-    memaddr = gdbarch_addr_bits_remove (current_gdbarch, memaddr);
+    memaddr = gdbarch_addr_bits_remove (target_gdbarch, memaddr);
 
   if (current_monitor->flags & MO_GETMEM_READ_SINGLE)
     return monitor_read_memory_single (memaddr, myaddr, len);
index 8269de18a592bec01c98206287066574681da01e..c60649bbeebfd52ee785060ed357a3b6e752408a 100644 (file)
@@ -197,7 +197,7 @@ procfs_open (char *arg, int from_tty)
            {
              if (sysinfo->type !=
                  nto_map_arch_to_cputype (gdbarch_bfd_arch_info
-                                          (current_gdbarch)->arch_name))
+                                          (target_gdbarch)->arch_name))
                error (_("Invalid target CPU."));
            }
        }
index 37074b2aac322a598c67c1bf4e4010705dae6935..46a4f4073660e9cad097d301b54b92ec0481b650 100644 (file)
@@ -4473,7 +4473,7 @@ invalidate_cache (procinfo *parent, procinfo *pi, void *ptr)
       if (!proc_set_gregs (pi))        /* flush gregs cache */
        proc_warn (pi, "target_resume, set_gregs",
                   __LINE__);
-  if (gdbarch_fp0_regnum (current_gdbarch) >= 0)
+  if (gdbarch_fp0_regnum (target_gdbarch) >= 0)
     if (pi->fpregs_dirty)
       if (parent == NULL ||
          proc_get_current_thread (parent) != pi->tid)
@@ -5352,7 +5352,7 @@ static int
 procfs_insert_watchpoint (CORE_ADDR addr, int len, int type)
 {
   if (!target_have_steppable_watchpoint
-      && !gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
+      && !gdbarch_have_nonsteppable_watchpoint (target_gdbarch))
     {
       /* When a hardware watchpoint fires off the PC will be left at
         the instruction following the one which caused the
@@ -5756,7 +5756,7 @@ info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
   pr_off = map->pr_off;
 #endif
 
-  if (gdbarch_addr_bit (current_gdbarch) == 32)
+  if (gdbarch_addr_bit (target_gdbarch) == 32)
     printf_filtered ("\t%#10lx %#10lx %#10lx %#10x %7s\n",
                     (unsigned long) map->pr_vaddr,
                     (unsigned long) map->pr_vaddr + map->pr_size - 1,
@@ -5787,7 +5787,7 @@ info_proc_mappings (procinfo *pi, int summary)
     return;    /* No output for summary mode. */
 
   printf_filtered (_("Mapped address spaces:\n\n"));
-  if (gdbarch_ptr_bit (current_gdbarch) == 32)
+  if (gdbarch_ptr_bit (target_gdbarch) == 32)
     printf_filtered ("\t%10s %10s %10s %10s %7s\n",
                     "Start Addr",
                     "  End Addr",
index dfd7487106fc8744eab2ae78ba08ee5e67eb3100..3669eb4714edde378da1c41593c538515d2c8d2f 100644 (file)
@@ -428,7 +428,7 @@ record_open (char *name, int from_tty)
     error (_("Process record target can't debug inferior in asynchronous "
             "mode (target-async)."));
 
-  if (!gdbarch_process_record_p (current_gdbarch))
+  if (!gdbarch_process_record_p (target_gdbarch))
     error (_("Process record: the current architecture doesn't support "
             "record function."));
 
index 3849ce3590a069ea4af92d6d61675e1c1fbee1be..7b91902b207993790d82c1209e6586c39d391957 100644 (file)
@@ -75,7 +75,7 @@
 #ifndef ARCH3264
 # define ARCH64() 0
 #else
-# define ARCH64() (register_size (current_gdbarch, 0) == 8)
+# define ARCH64() (register_size (target_gdbarch, 0) == 8)
 #endif
 
 /* Union of 32-bit and 64-bit versions of ld_info. */
index fcc8b30194f1ce0c36e4a9f0006978fd8ff42f11..4af70c3a4818b4e3d94c8933047b26b269f8361e 100644 (file)
@@ -313,7 +313,7 @@ darwin_solib_create_inferior_hook (void)
     {
       bfd *sub;
       sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object,
-                                   gdbarch_bfd_arch_info (current_gdbarch));
+                                   gdbarch_bfd_arch_info (target_gdbarch));
       if (sub)
        dyld_bfd = sub;
       else
@@ -423,7 +423,7 @@ darwin_bfd_open (char *pathname)
   abfd = solib_bfd_fopen (found_pathname, found_file);
 
   res = bfd_mach_o_fat_extract (abfd, bfd_object,
-                               gdbarch_bfd_arch_info (current_gdbarch));
+                               gdbarch_bfd_arch_info (target_gdbarch));
   if (!res)
     {
       bfd_close (abfd);
index 88f8ff2aeb928d48cb8d8861bdd17b25bdc16554..ee43cca60bfdf15cf7ba7a56be6760aa6b8b06e1 100644 (file)
@@ -213,9 +213,7 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
       Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
       Elf64_Sxword dyn_tag;
       CORE_ADDR        dyn_ptr;
-      char *pbuf;
 
-      pbuf = alloca (gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT);
       dyn_tag = bfd_h_get_64 (symfile_objfile->obfd, 
                              (bfd_byte*) &x_dynp->d_tag);
 
index a90973373cce6a289c9250a5a3d6e94ab7965568..2fa79af65804156a7a7d8c7f79569187ebb86b5a 100644 (file)
@@ -1248,9 +1248,10 @@ windows_resume (struct target_ops *ops,
       if (step)
        {
          /* Single step by setting t bit */
-         windows_fetch_inferior_registers (ops,
-                                           get_current_regcache (),
-                                           gdbarch_ps_regnum (current_gdbarch));
+         struct regcache *regcache = get_current_regcache ();
+         struct gdbarch *gdbarch = get_regcache_arch (regcache);
+         windows_fetch_inferior_registers (ops, regcache,
+                                           gdbarch_ps_regnum (gdbarch));
          th->context.EFlags |= FLAG_TRACE_BIT;
        }