INHERIT (to_shortname, t);
INHERIT (to_longname, t);
INHERIT (to_doc, t);
- INHERIT (to_open, t);
- INHERIT (to_close, t);
+ /* Do not inherit to_open. */
+ /* Do not inherit to_close. */
INHERIT (to_attach, t);
INHERIT (to_post_attach, t);
INHERIT (to_attach_no_wait, t);
void
pop_target (void)
{
- target_close (¤t_target, 0); /* Let it clean up */
+ target_close (target_stack, 0); /* Let it clean up */
if (unpush_target (target_stack) == 1)
return;
{
while ((int) (current_target.to_stratum) > (int) above_stratum)
{
- target_close (¤t_target, quitting);
+ target_close (target_stack, quitting);
if (!unpush_target (target_stack))
{
fprintf_unfiltered (gdb_stderr,
"pop_all_targets couldn't find target %s\n",
- current_target.to_shortname);
+ target_stack->to_shortname);
internal_error (__FILE__, __LINE__,
_("failed internal consistency check"));
break;
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)
/* Likewise for accesses to unmapped overlay sections. */
if (readbuf != NULL && overlay_debugging)
{
- asection *section = find_pc_overlay (memaddr);
+ struct obj_section *section = find_pc_overlay (memaddr);
if (pc_in_unmapped_range (memaddr, section))
return xfer_memory (memaddr, readbuf, len, 0, NULL, ops);
}
const unsigned char *myaddr = NULL;
fprintf_unfiltered (gdb_stdlog,
- "%s:target_xfer_partial (%d, %s, 0x%lx, 0x%lx, 0x%s, %s) = %s",
+ "%s:target_xfer_partial (%d, %s, 0x%lx, 0x%lx, %s, %s) = %s",
ops->to_shortname,
(int) object,
(annex ? annex : "(null)"),
(long) readbuf, (long) writebuf,
- paddr_nz (offset), paddr_d (len), paddr_d (retval));
+ core_addr_to_string_nz (offset),
+ plongest (len), plongest (retval));
if (readbuf)
myaddr = readbuf;
static int
default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
{
- return (len <= TYPE_LENGTH (builtin_type_void_data_ptr));
+ return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT);
}
static int
struct gdbarch *gdbarch = get_regcache_arch (regcache);
fprintf_unfiltered (gdb_stdlog, "%s ", func);
if (regno >= 0 && regno < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch)
&& gdbarch_register_name (gdbarch, regno) != NULL
&& gdbarch_register_name (gdbarch, regno)[0] != '\0')
fprintf_unfiltered (gdb_stdlog, "(%s)",
gdbarch_register_name (gdbarch, regno));
else
fprintf_unfiltered (gdb_stdlog, "(%d)", regno);
- if (regno >= 0)
+ if (regno >= 0 && regno < gdbarch_num_regs (gdbarch))
{
int i, size = register_size (gdbarch, regno);
unsigned char buf[MAX_REGISTER_SIZE];
- regcache_cooked_read (regcache, regno, buf);
+ regcache_raw_collect (regcache, regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
for (i = 0; i < size; i++)
{
if (size <= sizeof (LONGEST))
{
ULONGEST val = extract_unsigned_integer (buf, size);
- fprintf_unfiltered (gdb_stdlog, " 0x%s %s",
- paddr_nz (val), paddr_d (val));
+ fprintf_unfiltered (gdb_stdlog, " %s %s",
+ core_addr_to_string_nz (val), plongest (val));
}
}
fprintf_unfiltered (gdb_stdlog, "\n");