(deprecated_current_gdbarch_select_hack): Set it.
* gdbarch.c, gdbarch.h: Regenerate.
* arch-utils.c (gdbarch_update_p): Use target_gdbarch instead
of current_gdbarch.
* target-descriptions.c (target_find_description): Likewise.
* arm-tdep.c (arm_update_current_architecture): Likewise.
(show_fp_model, arm_show_abi, arm_show_fallback_mode,
arm_show_force_mode): Likewise.
* mips-tdep.c (show_mask_address, show_mipsfpu_command,
show_mips_abi): Likewise.
* mep-tdep.c (me_module_register_set, current_me_module): Likewise.
* target.c (target_translate_tls_address): Use target_gdbarch
instead of current_gdbarch.
* remote.c (struct packet_reg): Likewise.
(get_remote_arch_state, packet_reg_from_regnum,
packet_reg_from_pnum, remote_check_symbols, remote_wait,
remote_address_masked, remote_insert_breakpoint,
remote_insert_hw_breakpoint, remote_read_description): Likewise.
* remote-m32r-sdi.c (m32r_resume, m32r_wait): Likewise.
* remote-mips.c (mips_open, mips_common_breakpoint): Likewise.
* cris-tdep.c (cris_can_use_hardware_watchpoint): Likewise.
* solib.c (solib_open, solib_map_sections, solib_read_symbols,
solib_add, info_sharedlibrary_command, solib_address,
solib_create_inferior_hook, in_solib_dynsym_resolve_code,
solib_global_lookup): Likewise.
* solib-frv.c (enable_break2, frv_relocate_main_executable): Likewise.
* solib-irix.c (irix_current_sos, irix_open_symbol_file_object):
Likewise.
* solib-sunos.c (sunos_solib_create_inferior_hook): Likewise.
* solib-svr4.c (exec_entry_point, enable_break, svr4_free_so,
set_solib_svr4_fetch_link_map_offsets, svr4_fetch_link_map_offsets):
Likewise.
* nto-tdep.c (nto_find_and_open_solib, nto_init_solib_absolute_prefix,
nto_truncate_ptr): Likewise.
* mips-linux-tdep.c (mips_linux_in_dynsym_stub): Likewise.
+2008-08-26 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbarch.sh (target_gdbarch): New global variable.
+ (deprecated_current_gdbarch_select_hack): Set it.
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+ * arch-utils.c (gdbarch_update_p): Use target_gdbarch instead
+ of current_gdbarch.
+ * target-descriptions.c (target_find_description): Likewise.
+ * arm-tdep.c (arm_update_current_architecture): Likewise.
+ (show_fp_model, arm_show_abi, arm_show_fallback_mode,
+ arm_show_force_mode): Likewise.
+ * mips-tdep.c (show_mask_address, show_mipsfpu_command,
+ show_mips_abi): Likewise.
+ * mep-tdep.c (me_module_register_set, current_me_module): Likewise.
+
+ * target.c (target_translate_tls_address): Use target_gdbarch
+ instead of current_gdbarch.
+ * remote.c (struct packet_reg): Likewise.
+ (get_remote_arch_state, packet_reg_from_regnum,
+ packet_reg_from_pnum, remote_check_symbols, remote_wait,
+ remote_address_masked, remote_insert_breakpoint,
+ remote_insert_hw_breakpoint, remote_read_description): Likewise.
+ * remote-m32r-sdi.c (m32r_resume, m32r_wait): Likewise.
+ * remote-mips.c (mips_open, mips_common_breakpoint): Likewise.
+ * cris-tdep.c (cris_can_use_hardware_watchpoint): Likewise.
+
+ * solib.c (solib_open, solib_map_sections, solib_read_symbols,
+ solib_add, info_sharedlibrary_command, solib_address,
+ solib_create_inferior_hook, in_solib_dynsym_resolve_code,
+ solib_global_lookup): Likewise.
+ * solib-frv.c (enable_break2, frv_relocate_main_executable): Likewise.
+ * solib-irix.c (irix_current_sos, irix_open_symbol_file_object):
+ Likewise.
+ * solib-sunos.c (sunos_solib_create_inferior_hook): Likewise.
+ * solib-svr4.c (exec_entry_point, enable_break, svr4_free_so,
+ set_solib_svr4_fetch_link_map_offsets, svr4_fetch_link_map_offsets):
+ Likewise.
+ * nto-tdep.c (nto_find_and_open_solib, nto_init_solib_absolute_prefix,
+ nto_truncate_ptr): Likewise.
+ * mips-linux-tdep.c (mips_linux_in_dynsym_stub): Likewise.
+
2008-08-26 Luis Machado <luisgpm@br.ibm.com>
* ppc-linux-tdep.c (ppc_linux_vsx_regset_sections) New structure.
/* If it is the same old architecture, accept the request (but don't
swap anything). */
- if (new_gdbarch == current_gdbarch)
+ if (new_gdbarch == target_gdbarch)
{
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_update_p: "
struct gdbarch_info info;
/* If the current architecture is not ARM, we have nothing to do. */
- if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_arm)
+ if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_arm)
return;
/* Update the architecture. */
show_fp_model (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
if (arm_fp_model == ARM_FLOAT_AUTO
- && gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_arm)
+ && gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_arm)
fprintf_filtered (file, _("\
The current ARM floating point model is \"auto\" (currently \"%s\").\n"),
fp_model_strings[tdep->fp_model]);
arm_show_abi (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
if (arm_abi_global == ARM_ABI_AUTO
- && gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_arm)
+ && gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_arm)
fprintf_filtered (file, _("\
The current ARM ABI is \"auto\" (currently \"%s\").\n"),
arm_abi_strings[tdep->arm_abi]);
arm_show_fallback_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
fprintf_filtered (file, _("\
The current execution mode assumed (when symbols are unavailable) is \"%s\".\n"),
arm_show_force_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
fprintf_filtered (file, _("\
The current execution mode assumed (even when symbols are available) is \"%s\".\n"),
int
cris_can_use_hardware_watchpoint (int type, int count, int other)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
/* No bookkeeping is done here; it is handled by the remote debug agent. */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
+struct gdbarch *target_gdbarch = &startup_gdbarch;
/* Create a new ``struct gdbarch'' based on information provided by
``struct gdbarch_info''. */
gdb_assert (current_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_gdbarch = new_gdbarch;
+ target_gdbarch = new_gdbarch;
observer_notify_architecture_changed (new_gdbarch);
registers_changed ();
}
struct core_regset_section;
extern struct gdbarch *current_gdbarch;
+extern struct gdbarch *target_gdbarch;
/* The following are pre-initialized by GDBARCH. */
struct core_regset_section;
extern struct gdbarch *current_gdbarch;
+extern struct gdbarch *target_gdbarch;
EOF
# function typedef's
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
+struct gdbarch *target_gdbarch = &startup_gdbarch;
EOF
# Create a new gdbarch struct
gdb_assert (current_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_gdbarch = new_gdbarch;
+ target_gdbarch = new_gdbarch;
observer_notify_architecture_changed (new_gdbarch);
registers_changed ();
}
mask contains any of the me_module's coprocessor ISAs,
specifically excluding the generic coprocessor register sets. */
- CGEN_CPU_DESC desc = gdbarch_tdep (current_gdbarch)->cpu_desc;
+ CGEN_CPU_DESC desc = gdbarch_tdep (target_gdbarch)->cpu_desc;
const CGEN_HW_ENTRY *hw;
if (me_module == CONFIG_NONE)
return regval;
}
else
- return gdbarch_tdep (current_gdbarch)->me_module;
+ return gdbarch_tdep (target_gdbarch)->me_module;
}
{
unsigned char buf[28], *p;
ULONGEST insn, insn1;
- int n64 = (mips_abi (current_gdbarch) == MIPS_ABI_N64);
+ int n64 = (mips_abi (target_gdbarch) == MIPS_ABI_N64);
read_memory (pc - 12, buf, 28);
show_mask_address (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
deprecated_show_value_hack (file, from_tty, c, value);
switch (mask_address_var)
{
char *fpu;
- if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
+ if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_mips)
{
printf_unfiltered
("The MIPS floating-point coprocessor is unknown "
return;
}
- switch (MIPS_FPU_TYPE (current_gdbarch))
+ switch (MIPS_FPU_TYPE (target_gdbarch))
{
case MIPS_FPU_SINGLE:
fpu = "single-precision";
struct cmd_list_element *ignored_cmd,
const char *ignored_value)
{
- if (gdbarch_bfd_arch_info (current_gdbarch)->arch != bfd_arch_mips)
+ if (gdbarch_bfd_arch_info (target_gdbarch)->arch != bfd_arch_mips)
fprintf_filtered
(file,
"The MIPS ABI is unknown because the current architecture "
else
{
enum mips_abi global_abi = global_mips_abi ();
- enum mips_abi actual_abi = mips_abi (current_gdbarch);
+ enum mips_abi actual_abi = mips_abi (target_gdbarch);
const char *actual_abi_str = mips_abi_strings[actual_abi];
if (global_abi == MIPS_ABI_UNKNOWN)
#define PATH_FMT "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
nto_root = nto_target ();
- if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
"rs6000") == 0
- || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ || strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
"powerpc") == 0)
{
arch = "ppc";
}
else
{
- arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
- endian = gdbarch_byte_order (current_gdbarch)
+ arch = gdbarch_bfd_arch_info (target_gdbarch)->arch_name;
+ endian = gdbarch_byte_order (target_gdbarch)
== BFD_ENDIAN_BIG ? "be" : "le";
}
const char *arch;
nto_root = nto_target ();
- if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name, "i386") == 0)
+ if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0)
{
arch = "x86";
endian = "";
}
- else if (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ else if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
"rs6000") == 0
- || strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ || strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
"powerpc") == 0)
{
arch = "ppc";
}
else
{
- arch = gdbarch_bfd_arch_info (current_gdbarch)->arch_name;
- endian = gdbarch_byte_order (current_gdbarch)
+ arch = gdbarch_bfd_arch_info (target_gdbarch)->arch_name;
+ endian = gdbarch_byte_order (target_gdbarch)
== BFD_ENDIAN_BIG ? "be" : "le";
}
static CORE_ADDR
nto_truncate_ptr (CORE_ADDR addr)
{
- if (gdbarch_ptr_bit (current_gdbarch) == sizeof (CORE_ADDR) * 8)
+ if (gdbarch_ptr_bit (target_gdbarch) == sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */
return addr;
else
- return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (current_gdbarch)) - 1);
+ return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch)) - 1);
}
Elf_Internal_Phdr *
else
{
buf[0] = SDI_WRITE_MEMORY;
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
store_long_parameter (buf + 1, pc_addr);
else
store_long_parameter (buf + 1, pc_addr - 1);
continue;
/* Set PBP. */
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8000 + 4 * i, 4,
0x00000006);
else
store_long_parameter (buf + 5, 4);
if ((bp_addr & 2) == 0 && bp_addr != (pc_addr & 0xfffffffc))
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
buf[9] = dbt_bp_entry[0];
buf[10] = dbt_bp_entry[1];
}
else
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
if ((bp_addr & 2) == 0)
{
continue;
/* DBC register */
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
switch (ab_type[i])
{
if (last_pc_addr != 0xffffffff)
{
buf[0] = SDI_WRITE_MEMORY;
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
store_long_parameter (buf + 1, last_pc_addr);
else
store_long_parameter (buf + 1, last_pc_addr - 1);
address, we have to take care of it later. */
if ((pc_addr & 0x2) != 0)
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
if ((bp_data[i][2] & 0x80) != 0)
{
c = serial_readchar (sdi_desc, SDI_TIMEOUT);
if (c != '-' && recv_data (buf, 4) != -1)
{
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
if ((buf[3] & 0x1) == 0x1)
hit_watchpoint_addr = ab_address[i];
mips_open (char *name, int from_tty)
{
const char *monitor_prompt = NULL;
- if (gdbarch_bfd_arch_info (current_gdbarch) != NULL
- && gdbarch_bfd_arch_info (current_gdbarch)->arch == bfd_arch_mips)
+ if (gdbarch_bfd_arch_info (target_gdbarch) != NULL
+ && gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_mips)
{
- switch (gdbarch_bfd_arch_info (current_gdbarch)->mach)
+ switch (gdbarch_bfd_arch_info (target_gdbarch)->mach)
{
case bfd_mach_mips4100:
case bfd_mach_mips4300:
int rpid, rerrflg, rresponse, rlen;
int nfields;
- addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
+ addr = gdbarch_addr_bits_remove (target_gdbarch, addr);
if (mips_monitor == MON_LSI)
{
long regnum; /* GDB's internal register number. */
LONGEST pnum; /* Remote protocol register number. */
int in_g_packet; /* Always part of G packet. */
- /* long size in bytes; == register_size (current_gdbarch, regnum);
+ /* long size in bytes; == register_size (target_gdbarch, regnum);
at present. */
- /* char *name; == gdbarch_register_name (current_gdbarch, regnum);
+ /* char *name; == gdbarch_register_name (target_gdbarch, regnum);
at present. */
};
static struct remote_arch_state *
get_remote_arch_state (void)
{
- return gdbarch_data (current_gdbarch, remote_gdbarch_data_handle);
+ return gdbarch_data (target_gdbarch, remote_gdbarch_data_handle);
}
/* Fetch the global remote target state. */
static struct packet_reg *
packet_reg_from_regnum (struct remote_arch_state *rsa, long regnum)
{
- if (regnum < 0 && regnum >= gdbarch_num_regs (current_gdbarch))
+ if (regnum < 0 && regnum >= gdbarch_num_regs (target_gdbarch))
return NULL;
else
{
packet_reg_from_pnum (struct remote_arch_state *rsa, LONGEST pnum)
{
int i;
- for (i = 0; i < gdbarch_num_regs (current_gdbarch); i++)
+ for (i = 0; i < gdbarch_num_regs (target_gdbarch); i++)
{
struct packet_reg *r = &rsa->regs[i];
if (r->pnum == pnum)
/* If this is a function address, return the start of code
instead of any data function descriptor. */
- sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+ sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
¤t_target);
phex_nz (pnum, 0), p, buf);
fieldsize = hex2bin (p, regs,
- register_size (current_gdbarch,
+ register_size (target_gdbarch,
reg->regnum));
p += 2 * fieldsize;
- if (fieldsize < register_size (current_gdbarch,
+ if (fieldsize < register_size (target_gdbarch,
reg->regnum))
warning (_("Remote reply is too short: %s"), buf);
regcache_raw_supply (get_current_regcache (),
int address_size = remote_address_size;
/* If "remoteaddresssize" was not set, default to target address size. */
if (!address_size)
- address_size = gdbarch_addr_bit (current_gdbarch);
+ address_size = gdbarch_addr_bit (target_gdbarch);
if (address_size > 0
&& address_size < (sizeof (ULONGEST) * 8))
char *p;
int bpsize;
- gdbarch_breakpoint_from_pc
- (current_gdbarch, &addr, &bpsize);
+ gdbarch_breakpoint_from_pc (target_gdbarch, &addr, &bpsize);
rs = get_remote_state ();
p = rs->buf;
instruction, even though we aren't inserting one ourselves. */
gdbarch_breakpoint_from_pc
- (current_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
+ (target_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size);
if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
return -1;
remote_read_description (struct target_ops *target)
{
struct remote_g_packet_data *data
- = gdbarch_data (current_gdbarch, remote_g_packet_data_handle);
+ = gdbarch_data (target_gdbarch, remote_g_packet_data_handle);
if (!VEC_empty (remote_g_packet_guess_s, data->guesses))
{
return 0;
}
- status = frv_fdpic_loadmap_addresses (current_gdbarch,
+ status = frv_fdpic_loadmap_addresses (target_gdbarch,
&interp_loadmap_addr, 0);
if (status < 0)
{
int changed;
struct obj_section *osect;
- status = frv_fdpic_loadmap_addresses (current_gdbarch, 0, &exec_addr);
+ status = frv_fdpic_loadmap_addresses (target_gdbarch, 0, &exec_addr);
if (status < 0)
{
read_memory (debug_base,
addr_buf,
- gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+ gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT);
lma = extract_mips_address (addr_buf,
- gdbarch_addr_bit (current_gdbarch)
+ gdbarch_addr_bit (target_gdbarch)
/ TARGET_CHAR_BIT);
while (lma)
/* First link map member should be the executable. */
read_memory (debug_base,
addr_buf,
- gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT);
+ gdbarch_addr_bit (target_gdbarch) / TARGET_CHAR_BIT);
lma = extract_mips_address (addr_buf,
- gdbarch_addr_bit (current_gdbarch)
+ gdbarch_addr_bit (target_gdbarch)
/ TARGET_CHAR_BIT);
if (lma == 0)
return 0; /* failed somehow... */
the GDB software break point list. Thus we have to adjust the
PC here. */
- if (gdbarch_decr_pc_after_break (current_gdbarch))
+ if (gdbarch_decr_pc_after_break (target_gdbarch))
{
- stop_pc -= gdbarch_decr_pc_after_break (current_gdbarch);
+ stop_pc -= gdbarch_decr_pc_after_break (target_gdbarch);
write_pc (stop_pc);
}
gdbarch_convert_from_func_ptr_addr(). The method
gdbarch_convert_from_func_ptr_addr() is the merely the identify
function for targets which don't use function descriptors. */
- return gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+ return gdbarch_convert_from_func_ptr_addr (target_gdbarch,
bfd_get_start_address (abfd),
targ);
}
struct obj_section *os;
sym_addr = gdbarch_addr_bits_remove
- (current_gdbarch, gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+ (target_gdbarch, gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
¤t_target));
/* Convert 'sym_addr' from a function pointer to an address.
Because we pass tmp_bfd_target instead of the current
target, this will always produce an unrelocated value. */
- sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+ sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
tmp_bfd_target);
static CORE_ADDR
svr4_truncate_ptr (CORE_ADDR addr)
{
- if (gdbarch_ptr_bit (current_gdbarch) == sizeof (CORE_ADDR) * 8)
+ if (gdbarch_ptr_bit (target_gdbarch) == sizeof (CORE_ADDR) * 8)
/* We don't need to truncate anything, and the bit twiddling below
will fail due to overflow problems. */
return addr;
else
- return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (current_gdbarch)) - 1);
+ return addr & (((CORE_ADDR) 1 << gdbarch_ptr_bit (target_gdbarch)) - 1);
}
static struct link_map_offsets *
svr4_fetch_link_map_offsets (void)
{
- struct solib_svr4_ops *ops = gdbarch_data (current_gdbarch, solib_svr4_data);
+ struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data);
gdb_assert (ops->fetch_link_map_offsets);
return ops->fetch_link_map_offsets ();
static int
svr4_have_link_map_offsets (void)
{
- struct solib_svr4_ops *ops = gdbarch_data (current_gdbarch, solib_svr4_data);
+ struct solib_svr4_ops *ops = gdbarch_data (target_gdbarch, solib_svr4_data);
return (ops->fetch_link_map_offsets != NULL);
}
\f
int
solib_open (char *in_pathname, char **found_pathname)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
int found_file = -1;
char *temp_pathname = NULL;
char *p = in_pathname;
for (p = so->sections; p < so->sections_end; p++)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
/* Relocate the section binding addresses as recorded in the shared
object's file by the base address to which the object was actually
void
free_so (struct so_list *so)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
char *bfd_filename = 0;
if (so->sections)
static void
update_solib_list (int from_tty, struct target_ops *target)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
struct so_list *inferior = ops->current_sos();
struct so_list *gdb, **gdb_link;
if (loaded_any_symbols)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
/* Getting new symbols may change our opinion about what is
frameless. */
int addr_width;
/* "0x", a little whitespace, and two hex digits per byte of pointers. */
- addr_width = 4 + (gdbarch_ptr_bit (current_gdbarch) / 4);
+ addr_width = 4 + (gdbarch_ptr_bit (target_gdbarch) / 4);
update_solib_list (from_tty, 0);
void
clear_solib (void)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
/* This function is expected to handle ELF shared libraries. It is
also used on Solaris, which can run either ELF or a.out binaries
void
solib_create_inferior_hook (void)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
ops->solib_create_inferior_hook();
}
int
in_solib_dynsym_resolve_code (CORE_ADDR pc)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
return ops->in_dynsym_resolve_code (pc);
}
const char *linkage_name,
const domain_enum domain)
{
- struct target_so_ops *ops = solib_ops (current_gdbarch);
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
if (ops->lookup_lib_global_symbol != NULL)
return ops->lookup_lib_global_symbol (objfile, name, linkage_name, domain);
/* The current architecture should not have any target description
specified. It should have been cleared, e.g. when we
disconnected from the previous target. */
- gdb_assert (gdbarch_target_desc (current_gdbarch) == NULL);
+ gdb_assert (gdbarch_target_desc (target_gdbarch) == NULL);
/* First try to fetch an XML description from the user-specified
file. */
{
struct tdesc_arch_data *data;
- data = gdbarch_data (current_gdbarch, tdesc_data);
+ data = gdbarch_data (target_gdbarch, tdesc_data);
if (tdesc_has_registers (current_target_desc)
&& data->registers == NULL)
warning (_("Target-supplied registers are not supported "
volatile CORE_ADDR addr = 0;
if (target_get_thread_local_address_p ()
- && gdbarch_fetch_tls_load_module_address_p (current_gdbarch))
+ && gdbarch_fetch_tls_load_module_address_p (target_gdbarch))
{
ptid_t ptid = inferior_ptid;
volatile struct gdb_exception ex;
CORE_ADDR lm_addr;
/* Fetch the load module address for this objfile. */
- lm_addr = gdbarch_fetch_tls_load_module_address (current_gdbarch,
+ lm_addr = gdbarch_fetch_tls_load_module_address (target_gdbarch,
objfile);
/* If it's 0, throw the appropriate exception. */
if (lm_addr == 0)