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]

[patch]: Remove current_gdbarch from target.c


Hi,

this patch removes the last occurence of current_gdbarch from target.c Tested on x86_64 without
regression.

Ok to commit?


ChangeLog:


	* target.c (target_translate_tls_address): Replace current_gdbarch by
	objfile arch.

Regards,
Markus

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

diff -urpN src/gdb/target.c dev/gdb/target.c
--- src/gdb/target.c	2008-05-13 13:42:06.000000000 +0200
+++ dev/gdb/target.c	2008-05-16 08:31:42.000000000 +0200
@@ -825,9 +825,10 @@ CORE_ADDR
 target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
 {
   volatile CORE_ADDR addr = 0;
+  struct gdbarch *gdbarch = get_objfile_arch (objfile);
 
   if (target_get_thread_local_address_p ()
-      && gdbarch_fetch_tls_load_module_address_p (current_gdbarch))
+      && gdbarch_fetch_tls_load_module_address_p (gdbarch))
     {
       ptid_t ptid = inferior_ptid;
       volatile struct gdb_exception ex;
@@ -837,8 +838,7 @@ target_translate_tls_address (struct obj
 	  CORE_ADDR lm_addr;
 	  
 	  /* Fetch the load module address for this objfile.  */
-	  lm_addr = gdbarch_fetch_tls_load_module_address (current_gdbarch,
-	                                                   objfile);
+	  lm_addr = gdbarch_fetch_tls_load_module_address (gdbarch, objfile);
 	  /* If it's 0, throw the appropriate exception.  */
 	  if (lm_addr == 0)
 	    throw_error (TLS_LOAD_MODULE_NOT_FOUND_ERROR,

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