[patch]: Remove current_gdbarch from target.c

Markus Deuling
2008-05-19T09:09:33Z

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

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

[-- Attachment #2: diff-target --]
[-- Type: text/plain, Size: 1098 bytes --]

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,