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>
+
+ * 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,
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);
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);
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;
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
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. */
/* 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];
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;
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,
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",
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 */
/* 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
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");
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";
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. */
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);
{
if (sysinfo->type !=
nto_map_arch_to_cputype (gdbarch_bfd_arch_info
- (current_gdbarch)->arch_name))
+ (target_gdbarch)->arch_name))
error (_("Invalid target CPU."));
}
}
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)
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
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,
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",
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."));
#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. */
{
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
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);
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);
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;
}