This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[rfc] [02/17] Get rid of current_gdbarch in corelow.c



Hi,


this patch gets rid of some of the current_gdbarch's in corelow.c

Is this ok to commit?

ChangeLog:


* corelow.c (get_core_registers): Use get_regcache_arch to get at the current architecture by regcache. (core_read_description): Use core_gdbarch instead of current_gdbarch.


-- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com




diff -urpN src/gdb/corelow.c dev/gdb/corelow.c
--- src/gdb/corelow.c	2007-09-10 23:14:10.000000000 +0200
+++ dev/gdb/corelow.c	2007-10-11 08:10:56.000000000 +0200
@@ -501,7 +501,7 @@ get_core_registers (struct regcache *reg
 			     ".reg-xfp", 3, "extended floating-point", 0);
 
   /* Supply dummy value for all registers not found in the core.  */
-  for (i = 0; i < gdbarch_num_regs (current_gdbarch); i++)
+  for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
     if (!regcache_valid_p (regcache, i))
       regcache_raw_supply (regcache, i, NULL);
 }
@@ -643,8 +643,8 @@ core_file_thread_alive (ptid_t tid)
 static const struct target_desc *
 core_read_description (struct target_ops *target)
 {
-  if (gdbarch_core_read_description_p (current_gdbarch))
-    return gdbarch_core_read_description (current_gdbarch, target, core_bfd);
+  if (gdbarch_core_read_description_p (core_gdbarch))
+    return gdbarch_core_read_description (core_gdbarch, target, core_bfd);
 
   return NULL;
 }




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