diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-17 18:44:23 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-06-17 18:44:23 +0000 |
commit | a97b0ac8cf1c8a5148d8c79908a0ef9378891e31 (patch) | |
tree | e6cb06d4368752a06a3b14a3e1645b05e493cf6d /gdb | |
parent | d80b854b33baf5ebc3940cd5928dc06c8708750d (diff) | |
download | gdb-a97b0ac8cf1c8a5148d8c79908a0ef9378891e31.zip gdb-a97b0ac8cf1c8a5148d8c79908a0ef9378891e31.tar.gz gdb-a97b0ac8cf1c8a5148d8c79908a0ef9378891e31.tar.bz2 |
* 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 26 | ||||
-rw-r--r-- | gdb/ada-tasks.c | 4 | ||||
-rw-r--r-- | gdb/aix-thread.c | 2 | ||||
-rw-r--r-- | gdb/amd64-linux-nat.c | 2 | ||||
-rw-r--r-- | gdb/bsd-uthread.c | 2 | ||||
-rw-r--r-- | gdb/dbug-rom.c | 3 | ||||
-rw-r--r-- | gdb/i386-darwin-nat.c | 4 | ||||
-rw-r--r-- | gdb/linux-nat.c | 4 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 2 | ||||
-rw-r--r-- | gdb/memattr.c | 8 | ||||
-rw-r--r-- | gdb/monitor.c | 4 | ||||
-rw-r--r-- | gdb/nto-procfs.c | 2 | ||||
-rw-r--r-- | gdb/procfs.c | 8 | ||||
-rw-r--r-- | gdb/record.c | 2 | ||||
-rw-r--r-- | gdb/rs6000-nat.c | 2 | ||||
-rw-r--r-- | gdb/solib-darwin.c | 4 | ||||
-rw-r--r-- | gdb/solib-pa64.c | 2 | ||||
-rw-r--r-- | gdb/windows-nat.c | 7 |
18 files changed, 56 insertions, 32 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 38c8afe..f6e75c0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,31 @@ 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, use it instead of current_gdbarch. * frame.h (deprecated_pc_in_call_dummy): Add GDBARCH parameter. diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index c0d2ed5..34a289a 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -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); diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 39be001..60eb5e2 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -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; diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index 149ba2f..7d8461c 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -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 diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index e84e0f0..22962c0 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -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. */ diff --git a/gdb/dbug-rom.c b/gdb/dbug-rom.c index 4bcb5a6..f8886d9 100644 --- a/gdb/dbug-rom.c +++ b/gdb/dbug-rom.c @@ -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]; diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index c444d85..8a90b17 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -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, diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index e9e010e..35114ce 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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 */ diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index eedb2cc..d6c10fa 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -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 diff --git a/gdb/memattr.c b/gdb/memattr.c index 5b52f85..356b4d6 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -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"; diff --git a/gdb/monitor.c b/gdb/monitor.c index fcee96b..10e588a 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -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); diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 8269de1..c60649b 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -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.")); } } diff --git a/gdb/procfs.c b/gdb/procfs.c index 37074b2..46a4f40 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -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", diff --git a/gdb/record.c b/gdb/record.c index dfd7487..3669eb4 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -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.")); diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 3849ce3..7b91902 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -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. */ diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index fcc8b30..4af70c3 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -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); diff --git a/gdb/solib-pa64.c b/gdb/solib-pa64.c index 88f8ff2..ee43cca 100644 --- a/gdb/solib-pa64.c +++ b/gdb/solib-pa64.c @@ -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); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index a909733..2fa79af 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -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; } |