This converts current_target to be a pointer rather than a struct.
This is more efficient when we move to multi-target, because then we
can switch targets by simply changing the pointer.
I made this patch by running this:
perl -pi -e 's/¤t_target/current_target/g; s/current_target\./current_target->/g;' *.[chyl] */*.[chyl]
... and then fixing up the result minorly:
* Updating the definition and declaration of current_target
* Fixing a "sizeof"
* Initializing current_target
Built and regtested on x86-64 Fedora 20.
2014-07-29 Tom Tromey <tromey@redhat.com>
* target.c (current_target): Now a pointer.
(update_current_target): Use size of target_ops, not
current_target.
(initialize_targets): Initialize current_target.
* target.h (current_target): Now a pointer.
* auxv.c: Update.
* avr-tdep.c: Update.
* breakpoint.c: Update.
* corefile.c: Update.
* elfread.c: Update.
* eval.c: Update.
* frame.c: Update.
* gnu-v3-abi.c: Update.
* ia64-hpux-tdep.c: Update.
* ia64-tdep.c: Update.
* ia64-vms-tdep.c: Update.
* infcall.c: Update.
* infcmd.c: Update.
* infrun.c: Update.
* linespec.c: Update.
* linux-nat.c: Update.
* linux-tdep.c: Update.
* linux-thread-db.c: Update.
* mi/mi-main.c: Update.
* minsyms.c: Update.
* parse.c: Update.
* ppc-linux-nat.c: Update.
* ppc-linux-tdep.c: Update.
* procfs.c: Update.
* remote-m32r-sdi.c: Update.
* remote.c: Update.
* s390-linux-nat.c: Update.
* s390-linux-tdep.c: Update.
* sol-thread.c: Update.
* solib-aix.c: Update.
* solib-darwin.c: Update.
* solib-dsbt.c: Update.
* solib-ia64-hpux.c: Update.
* solib-irix.c: Update.
* solib-osf.c: Update.
* solib-spu.c: Update.
* solib-svr4.c: Update.
* solib-target.c: Update.
* solib.c: Update.
* sparc-tdep.c: Update.
* spu-tdep.c: Update.
* symfile.c: Update.
* target-descriptions.c: Update.
* target-memory.c: Update.
* target.c: Update.
* target.h: Update.
* tracepoint.c: Update.
* valops.c: Update.
* valprint.c: Update.
* value.c: Update.
* windows-tdep.c: Update.
if (gdbarch_auxv_parse_p (gdbarch))
return gdbarch_auxv_parse (gdbarch, readptr, endptr, typep, valp);
- return current_target.to_auxv_parse (¤t_target, readptr, endptr,
+ return current_target->to_auxv_parse (current_target, readptr, endptr,
typep, valp);
}
error (_("The program has no auxiliary information now."));
else
{
- int ents = fprint_target_auxv (gdb_stdout, ¤t_target);
+ int ents = fprint_target_auxv (gdb_stdout, current_target);
if (ents < 0)
error (_("No auxiliary vector found, or failed reading it."));
int i, j, k, step;
/* Find out how many io registers the target has. */
- bufsiz = target_read_alloc (¤t_target, TARGET_OBJECT_AVR,
+ bufsiz = target_read_alloc (current_target, TARGET_OBJECT_AVR,
"avr.io_reg", &buf);
bufstr = (const char *) buf;
j = nreg - i; /* last block is less than 8 registers */
snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
- bufsiz = target_read_alloc (¤t_target, TARGET_OBJECT_AVR,
+ bufsiz = target_read_alloc (current_target, TARGET_OBJECT_AVR,
query, &buf);
p = (const char *) buf;
addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym);
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
- ¤t_target);
+ current_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
&internal_breakpoint_ops);
initialize_explicit_location (&explicit_loc);
return 0;
}
- if (!target_stopped_data_address (¤t_target, &addr))
+ if (!target_stopped_data_address (current_target, &addr))
{
/* We were stopped by a watchpoint, but we don't know where.
Mark all watchpoints as unknown. */
}
}
/* Exact match not required. Within range is sufficient. */
- else if (target_watchpoint_addr_within_range (¤t_target,
+ else if (target_watchpoint_addr_within_range (current_target,
addr, loc->address,
loc->length))
{
enum target_xfer_status status;
ULONGEST xfered_len;
- status = target_xfer_partial (current_target.beneath,
+ status = target_xfer_partial (current_target->beneath,
TARGET_OBJECT_MEMORY, NULL,
myaddr + xfered, NULL,
memaddr + xfered, len - xfered,
continue;
addr = extract_typed_address (buf, ptr_type);
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
- ¤t_target);
+ current_target);
addr = gdbarch_addr_bits_remove (gdbarch, addr);
if (addr_p)
address_val = call_function_by_hand (function, 0, NULL);
address = value_as_address (address_val);
address = gdbarch_convert_from_func_ptr_addr (gdbarch, address,
- ¤t_target);
+ current_target);
address = gdbarch_addr_bits_remove (gdbarch, address);
if (name_at_pc)
resolved_address = value_as_address (value);
resolved_pc = gdbarch_convert_from_func_ptr_addr (gdbarch,
resolved_address,
- ¤t_target);
+ current_target);
resolved_pc = gdbarch_addr_bits_remove (gdbarch, resolved_pc);
gdb_assert (current_program_space == b->pspace || b->pspace == NULL);
/* The address might point to a function descriptor;
resolve it to the actual code address instead. */
addr = gdbarch_convert_from_func_ptr_addr (exp->gdbarch, addr,
- ¤t_target);
+ current_target);
/* Is it a high_level symbol? */
sym = find_pc_function (addr);
returned. */
maddr = gdbarch_convert_from_func_ptr_addr (get_frame_arch (this_frame),
BMSYMBOL_VALUE_ADDRESS (msymbol),
- ¤t_target);
+ current_target);
return maddr == get_frame_func (this_frame);
}
of the real function from the function descriptor before passing on
the address to other layers of GDB. */
func_addr = gdbarch_convert_from_func_ptr_addr (gdbarch, method_stop_pc,
- ¤t_target);
+ current_target);
if (func_addr != 0)
method_stop_pc = func_addr;
we should find a way to override the corefile layer's
xfer_partial method. */
- x = target_read_alloc (¤t_target, TARGET_OBJECT_UNWIND_TABLE,
+ x = target_read_alloc (current_target, TARGET_OBJECT_UNWIND_TABLE,
NULL, buf_p);
return x;
CORE_ADDR table_addr;
unsigned int info_len;
- res = target_read (¤t_target, TARGET_OBJECT_OPENVMS_UIB,
+ res = target_read (current_target, TARGET_OBJECT_OPENVMS_UIB,
annex + 2, buf, 0, sizeof (buf));
if (res != sizeof (buf))
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
- ¤t_target);
+ current_target);
}
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
funaddr = value_as_address (value_addr (function));
nfunaddr = funaddr;
funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
- ¤t_target);
+ current_target);
if (funaddr != nfunaddr)
found_descriptor = 1;
}
/* Pass zero for FROM_TTY, because at this point the "run" command
has done its thing; now we are setting up the running program. */
- post_create_inferior (¤t_target, 0);
+ post_create_inferior (current_target, 0);
/* Start the target running. Do not use -1 continuation as it would skip
breakpoint right at the entry point. */
args = strip_bg_char (args, &async_exec);
args_chain = make_cleanup (xfree, args);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
if (args != NULL)
{
count_string = strip_bg_char (count_string, &async_exec);
args_chain = make_cleanup (xfree, count_string);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
count = count_string ? parse_and_eval_long (count_string) : 1;
arg = strip_bg_char (arg, &async_exec);
args_chain = make_cleanup (xfree, arg);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
if (!arg)
error_no_arg (_("starting address"));
signum_exp = strip_bg_char (signum_exp, &async_exec);
args_chain = make_cleanup (xfree, signum_exp);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
if (!signum_exp)
error_no_arg (_("signal number"));
arg = strip_bg_char (arg, &async_exec);
args_chain = make_cleanup (xfree, arg);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
if (arg)
until_break_command (arg, from_tty, 0);
arg = strip_bg_char (arg, &async_exec);
args_chain = make_cleanup (xfree, arg);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
until_break_command (arg, from_tty, 1);
arg = strip_bg_char (arg, &async_exec);
args_chain = make_cleanup (xfree, arg);
- prepare_execution_command (¤t_target, async_exec);
+ prepare_execution_command (current_target, async_exec);
if (arg)
error (_("The \"finish\" command does not take any arguments."));
/* Take any necessary post-attaching actions for this platform. */
target_post_attach (ptid_get_pid (inferior_ptid));
- post_create_inferior (¤t_target, from_tty);
+ post_create_inferior (current_target, from_tty);
if (async_exec)
{
/* Now that the inferior has stopped, do any bookkeeping like
loading shared libraries. We want to do this before normal_stop,
so that the displayed frame is up to date. */
- post_create_inferior (¤t_target, from_tty);
+ post_create_inferior (current_target, from_tty);
normal_stop ();
}
fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n");
- if (target_stopped_data_address (¤t_target, &addr))
+ if (target_stopped_data_address (current_target, &addr))
fprintf_unfiltered (gdb_stdlog,
"infrun: stopped data address = %s\n",
paddress (gdbarch, addr));
validate_siginfo_access ();
transferred =
- target_read (¤t_target, TARGET_OBJECT_SIGNAL_INFO,
+ target_read (current_target, TARGET_OBJECT_SIGNAL_INFO,
NULL,
value_contents_all_raw (v),
value_offset (v),
validate_siginfo_access ();
- transferred = target_write (¤t_target,
+ transferred = target_write (current_target,
TARGET_OBJECT_SIGNAL_INFO,
NULL,
value_contents_all_raw (fromval),
siginfo_data = (gdb_byte *) xmalloc (len);
back_to = make_cleanup (xfree, siginfo_data);
- if (target_read (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
+ if (target_read (current_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
siginfo_data, 0, len) == len)
discard_cleanups (back_to);
else
struct type *type = gdbarch_get_siginfo_type (gdbarch);
/* Errors ignored. */
- target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
+ target_write (current_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
inf_state->siginfo_data, 0, TYPE_LENGTH (type));
}
/* The minimal symbol might point to a function descriptor;
resolve it to the actual code address instead. */
- pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, ¤t_target);
+ pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, current_target);
if (pc != sal.pc)
sal = find_pc_sect_line (pc, NULL, 0);
stay correct from the last find_pc_sect_line above. */
sal.pc = MSYMBOL_VALUE_ADDRESS (objfile, msymbol);
sal.pc = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc,
- ¤t_target);
+ current_target);
if (gdbarch_skip_entrypoint_p (gdbarch))
sal.pc = gdbarch_skip_entrypoint (gdbarch, sal.pc);
}
NULL, 0);
sal.section = MSYMBOL_OBJ_SECTION (info->objfile, minsym);
pc
- = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, ¤t_target);
+ = gdbarch_convert_from_func_ptr_addr (gdbarch, sal.pc, current_target);
if (pc != sal.pc)
sal = find_pc_sect_line (pc, NULL, 0);
struct gdbarch *gdbarch = get_objfile_arch (info->objfile);
CORE_ADDR addr = gdbarch_convert_from_func_ptr_addr
(gdbarch, BMSYMBOL_VALUE_ADDRESS (mo),
- ¤t_target);
+ current_target);
if (addr == BMSYMBOL_VALUE_ADDRESS (mo))
return;
if (linux_ops->to_stopped_data_address != NULL)
lp->stopped_data_address_p =
- linux_ops->to_stopped_data_address (¤t_target,
+ linux_ops->to_stopped_data_address (current_target,
&lp->stopped_data_address);
else
lp->stopped_data_address_p = 0;
{
CORE_ADDR dummy;
- return (target_auxv_search (¤t_target, AT_NULL, &dummy) > 0
- && target_auxv_search (¤t_target, AT_PAGESZ, &dummy) == 0);
+ return (target_auxv_search (current_target, AT_NULL, &dummy) > 0
+ && target_auxv_search (current_target, AT_PAGESZ, &dummy) == 0);
}
static int
LONGEST i, j, size;
/* Determine list of SPU ids. */
- size = target_read_alloc (¤t_target, TARGET_OBJECT_SPU,
+ size = target_read_alloc (current_target, TARGET_OBJECT_SPU,
NULL, &spu_ids);
/* Generate corefile notes for each SPU file. */
LONGEST spu_len;
xsnprintf (annex, sizeof annex, "%d/%s", fd, spu_files[j]);
- spu_len = target_read_alloc (¤t_target, TARGET_OBJECT_SPU,
+ spu_len = target_read_alloc (current_target, TARGET_OBJECT_SPU,
annex, &spu_data);
if (spu_len > 0)
{
buf = (gdb_byte *) xmalloc (TYPE_LENGTH (siginfo_type));
cleanups = make_cleanup (xfree, buf);
- bytes_read = target_read (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
+ bytes_read = target_read (current_target, TARGET_OBJECT_SIGNAL_INFO, NULL,
buf, 0, TYPE_LENGTH (siginfo_type));
if (bytes_read == TYPE_LENGTH (siginfo_type))
{
return NULL;
/* Auxillary vector. */
- auxv_len = target_read_alloc (¤t_target, TARGET_OBJECT_AUXV,
+ auxv_len = target_read_alloc (current_target, TARGET_OBJECT_AUXV,
NULL, &auxv);
if (auxv_len > 0)
{
static int
linux_vsyscall_range_raw (struct gdbarch *gdbarch, struct mem_range *range)
{
- if (target_auxv_search (¤t_target, AT_SYSINFO_EHDR, &range->start) <= 0)
+ if (target_auxv_search (current_target, AT_SYSINFO_EHDR, &range->start) <= 0)
return 0;
/* This is installed by linux_init_abi below, so should always be
local-store address and is thus not usable as displaced stepping
location. The auxiliary vector gets us the PowerPC-side entry
point address instead. */
- if (target_auxv_search (¤t_target, AT_ENTRY, &addr) <= 0)
+ if (target_auxv_search (current_target, AT_ENTRY, &addr) <= 0)
error (_("Cannot find AT_ENTRY auxiliary vector entry."));
/* Make certain that the address points at real code, and not a
function descriptor. */
addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr,
- ¤t_target);
+ current_target);
/* Inferior calls also use the entry point as a breakpoint location.
We don't want displaced stepping to interfere with those
(bfd_get_sign_extend_vma (exec_bfd) > 0
? (CORE_ADDR) (intptr_t) notify.u.bptaddr
: (CORE_ADDR) (uintptr_t) notify.u.bptaddr),
- ¤t_target));
+ current_target));
create_thread_event_breakpoint (target_gdbarch (), *bp);
return TD_OK;
return 0;
/* Don't attempt to use thread_db for remote targets. */
- if (!(target_can_run (¤t_target) || core_bfd))
+ if (!(target_can_run (current_target) || core_bfd))
return 0;
if (thread_db_load_search ())
check_pid_namespace_match (void)
{
/* Check is only relevant for local targets targets. */
- if (target_can_run (¤t_target))
+ if (target_can_run (current_target))
{
/* If the child is in a different PID namespace, its idea of its
PID will differ from our idea of its PID. When we scan the
static void
exec_continue (char **argv, int argc)
{
- prepare_execution_command (¤t_target, mi_async_p ());
+ prepare_execution_command (current_target, mi_async_p ());
if (non_stop)
{
make_cleanup (xfree, mbuf);
/* Dispatch memory reads to the topmost target, not the flattened
- current_target. */
- nr_bytes = target_read (current_target.beneath,
+ current_target-> */
+ nr_bytes = target_read (current_target->beneath,
TARGET_OBJECT_MEMORY, NULL, mbuf,
addr, total_bytes);
if (nr_bytes <= 0)
addr = parse_and_eval_address (argv[0]) + offset;
length = atol (argv[1]);
- result = read_memory_robust (current_target.beneath, addr, length);
+ result = read_memory_robust (current_target->beneath, addr, length);
cleanups = make_cleanup (free_memory_read_result_vector, result);
func = gdbarch_convert_from_func_ptr_addr
(get_objfile_arch (objfile),
MSYMBOL_VALUE_ADDRESS (objfile, msymbol),
- ¤t_target);
+ current_target);
/* Ignore data symbols that are not function descriptors. */
if (func != MSYMBOL_VALUE_ADDRESS (objfile, msymbol))
/* The minimal symbol might point to a function descriptor;
resolve it to the actual code address instead. */
- pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target);
+ pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, current_target);
if (pc != addr)
{
struct bound_minimal_symbol ifunc_msym = lookup_minimal_symbol_by_pc (pc);
{
CORE_ADDR field;
- if (target_auxv_search (¤t_target, AT_HWCAP, &field))
+ if (target_auxv_search (current_target, AT_HWCAP, &field))
return (unsigned long) field;
return 0;
/* Look up cached address of thread-local variable. */
if (!ptid_equal (spe_context_cache_ptid, inferior_ptid))
{
- struct target_ops *target = ¤t_target;
+ struct target_ops *target = current_target;
TRY
{
return 0;
xsnprintf (annex, sizeof annex, "%d/regs", data.id);
- if (target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ if (target_read (current_target, TARGET_OBJECT_SPU, annex,
data.gprs, 0, sizeof data.gprs)
== sizeof data.gprs)
{
the inferior ourselves, there is nothing to do when the inferior
was created by attaching to an already running process, or when
debugging a core file. */
- if (current_inferior ()->attach_flag || !target_can_run (¤t_target))
+ if (current_inferior ()->attach_flag || !target_can_run (current_target))
return;
proc_trace_syscalls_1 (find_procinfo_or_die (ptid_get_pid (inferior_ptid),
&thread_args);
note_data = thread_args.note_data;
- auxv_len = target_read_alloc (¤t_target, TARGET_OBJECT_AUXV,
+ auxv_len = target_read_alloc (current_target, TARGET_OBJECT_AUXV,
NULL, &auxv);
if (auxv_len > 0)
{
{
CORE_ADDR addr;
- return m32r_stopped_data_address (¤t_target, &addr);
+ return m32r_stopped_data_address (current_target, &addr);
}
/* Check to see if a thread is still alive. */
instead of any data function descriptor. */
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- ¤t_target);
+ current_target);
xsnprintf (msg, get_remote_packet_size (), "qSymbol:%s:%s",
phex_nz (sym_addr, addr_size), &reply[8]);
remote_memory_map (struct target_ops *ops)
{
VEC(mem_region_s) *result = NULL;
- char *text = target_read_stralloc (¤t_target,
+ char *text = target_read_stralloc (current_target,
TARGET_OBJECT_MEMORY_MAP, NULL);
if (text)
{
char *text;
- text = target_read_stralloc (¤t_target,
+ text = target_read_stralloc (current_target,
TARGET_OBJECT_TRACEFRAME_INFO, NULL);
if (text != NULL)
{
{
char *xml;
- xml = target_read_stralloc (¤t_target,
+ xml = target_read_stralloc (current_target,
TARGET_OBJECT_BTRACE_CONF, "");
if (xml != NULL)
{
(unsigned int) type);
}
- xml = target_read_stralloc (¤t_target,
- TARGET_OBJECT_BTRACE, annex);
+ xml = target_read_stralloc (current_target,
+ TARGET_OBJECT_BTRACE, annex);
if (xml == NULL)
return BTRACE_ERR_UNKNOWN;
xsnprintf (annex, annex_size, "%x", pid);
}
- filename = target_read_stralloc (¤t_target,
+ filename = target_read_stralloc (current_target,
TARGET_OBJECT_EXEC_FILE, annex);
return filename;
return -1;
case 1014: /* Data Cache Block set to Zero */
- if (target_auxv_search (¤t_target, AT_DCACHEBSIZE, &at_dcsz) <= 0
+ if (target_auxv_search (current_target, AT_DCACHEBSIZE, &at_dcsz) <= 0
|| at_dcsz == 0)
at_dcsz = 128; /* Assume 128-byte cache line size (POWER8) */
{
CORE_ADDR hwcap = 0;
- target_auxv_search (¤t_target, AT_HWCAP, &hwcap);
+ target_auxv_search (current_target, AT_HWCAP, &hwcap);
have_regset_tdb = (hwcap & HWCAP_S390_TE)
&& check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset);
if (pv_is_constant (addr))
{
struct target_section *secp;
- secp = target_section_by_addr (¤t_target, addr.k);
+ secp = target_section_by_addr (current_target, addr.k);
if (secp != NULL
&& (bfd_get_section_flags (secp->the_bfd_section->owner,
secp->the_bfd_section)
ptid_t ptid;
/* Don't attempt to use thread_db for remote targets. */
- if (!(target_can_run (¤t_target) || core_bfd))
+ if (!(target_can_run (current_target) || core_bfd))
return;
/* Do nothing if we couldn't load libthread_db.so.1. */
{
/* The list of threads is probably not up to date. Find any
thread that is missing from the list, and try again. */
- sol_update_thread_list (¤t_target);
+ sol_update_thread_list (current_target);
thread_info = iterate_over_threads (thread_db_find_thread_from_tid,
&thread);
}
if (data->library_list != NULL)
return data->library_list;
- library_document = target_read_stralloc (¤t_target,
+ library_document = target_read_stralloc (current_target,
TARGET_OBJECT_LIBRARIES_AIX,
NULL);
if (library_document == NULL && warning_msg != NULL)
LONGEST len;
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- len = target_read (¤t_target, TARGET_OBJECT_DARWIN_DYLD_INFO, NULL,
+ len = target_read (current_target, TARGET_OBJECT_DARWIN_DYLD_INFO, NULL,
buf, 0, sizeof (buf));
if (len != sizeof (buf))
return;
gdb_byte *buf;
struct dsbt_info *info = get_dsbt_info ();
- if (0 >= target_read_alloc (¤t_target, TARGET_OBJECT_FDPIC,
+ if (0 >= target_read_alloc (current_target, TARGET_OBJECT_FDPIC,
"exec", &buf))
{
info->exec_loadmap = NULL;
if (solib_dsbt_debug)
dsbt_print_loadmap (info->exec_loadmap);
- if (0 >= target_read_alloc (¤t_target, TARGET_OBJECT_FDPIC,
+ if (0 >= target_read_alloc (current_target, TARGET_OBJECT_FDPIC,
"interp", &buf))
{
info->interp_loadmap = NULL;
;
/* Determine list of SPU ids. */
- size = target_read (¤t_target, TARGET_OBJECT_SPU, NULL,
+ size = target_read (current_target, TARGET_OBJECT_SPU, NULL,
buf, 0, sizeof buf);
/* Do not add stand-alone SPE executable context as shared library,
already created the SPE context, but not installed the object-id
yet. Skip such entries; we'll be back for them later. */
xsnprintf (annex, sizeof annex, "%d/object-id", fd);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
(gdb_byte *) id, 0, sizeof id);
if (len <= 0 || len >= sizeof id)
continue;
CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (spe_event_sym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
- ¤t_target);
+ current_target);
create_solib_event_breakpoint (target_gdbarch (), addr);
return 1;
}
int pt_phdr_p = 0;
/* Get required auxv elements from target. */
- if (target_auxv_search (¤t_target, AT_PHDR, &at_phdr) <= 0)
+ if (target_auxv_search (current_target, AT_PHDR, &at_phdr) <= 0)
return 0;
- if (target_auxv_search (¤t_target, AT_PHENT, &at_phent) <= 0)
+ if (target_auxv_search (current_target, AT_PHENT, &at_phent) <= 0)
return 0;
- if (target_auxv_search (¤t_target, AT_PHNUM, &at_phnum) <= 0)
+ if (target_auxv_search (current_target, AT_PHNUM, &at_phnum) <= 0)
return 0;
if (!at_phdr || !at_phnum)
return 0;
gdb_assert (annex == NULL || target_augmented_libraries_svr4_read ());
/* Fetch the list of shared libraries. */
- svr4_library_document = target_read_stralloc (¤t_target,
+ svr4_library_document = target_read_stralloc (current_target,
TARGET_OBJECT_LIBRARIES_SVR4,
annex);
if (svr4_library_document == NULL)
/* Cause svr4_current_sos() to be run if it hasn't been already. */
if (info->main_lm_addr == 0)
- solib_add (NULL, 0, ¤t_target, auto_solib_add);
+ solib_add (NULL, 0, current_target, auto_solib_add);
/* svr4_current_sos() will set main_lm_addr for the main executable. */
if (objfile == symfile_objfile)
mean r_brk has already been relocated. Assume the dynamic linker
is the object containing r_brk. */
- solib_add (NULL, from_tty, ¤t_target, auto_solib_add);
+ solib_add (NULL, from_tty, current_target, auto_solib_add);
sym_addr = 0;
if (info->debug_base && solib_svr4_r_map (info) != 0)
sym_addr = solib_svr4_r_brk (info);
sym_addr = gdbarch_addr_bits_remove
(target_gdbarch (), gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- ¤t_target));
+ current_target));
/* On at least some versions of Solaris there's a dynamic relocation
on _r_debug.r_brk and SYM_ADDR may not be relocated yet, e.g., if
/* If we were not able to find the base address of the loader
from our so_list, then try using the AT_BASE auxilliary entry. */
if (!load_addr_found)
- if (target_auxv_search (¤t_target, AT_BASE, &load_addr) > 0)
+ if (target_auxv_search (current_target, AT_BASE, &load_addr) > 0)
{
int addr_bit = gdbarch_addr_bit (target_gdbarch ());
info->debug_loader_name = xstrdup (interp_name);
info->debug_loader_offset_p = 1;
info->debug_loader_offset = load_addr;
- solib_add (NULL, from_tty, ¤t_target, auto_solib_add);
+ solib_add (NULL, from_tty, current_target, auto_solib_add);
}
/* Record the relocated start and end address of the dynamic linker
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- ¤t_target);
+ current_target);
svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr);
return 1;
}
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- ¤t_target);
+ current_target);
svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr);
return 1;
}
if ((bfd_get_file_flags (exec_bfd) & DYNAMIC) == 0)
return 0;
- if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) <= 0)
+ if (target_auxv_search (current_target, AT_ENTRY, &entry_point) <= 0)
return 0;
exec_displacement = entry_point - bfd_get_start_address (exec_bfd);
int ix;
/* Fetch the list of shared libraries. */
- library_document = target_read_stralloc (¤t_target,
+ library_document = target_read_stralloc (current_target,
TARGET_OBJECT_LIBRARIES,
NULL);
if (library_document == NULL)
be adding them automatically. Switch terminal for any messages
produced by breakpoint_re_set. */
target_terminal_ours_for_output ();
- solib_add (NULL, 0, ¤t_target, auto_solib_add);
+ solib_add (NULL, 0, current_target, auto_solib_add);
target_terminal_inferior ();
}
sparc_fetch_wcookie (struct gdbarch *gdbarch)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- struct target_ops *ops = ¤t_target;
+ struct target_ops *ops = current_target;
gdb_byte buf[8];
int len;
return status;
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
memset (reg, 0, sizeof reg);
- target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ target_read (current_target, TARGET_OBJECT_SPU, annex,
reg, 0, sizeof reg);
ul = strtoulst ((char *) reg, NULL, 16);
if (status != REG_VALID)
return status;
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
- target_read (¤t_target, TARGET_OBJECT_SPU, annex, buf, 0, 16);
+ target_read (current_target, TARGET_OBJECT_SPU, annex, buf, 0, 16);
return status;
case SPU_SRR0_REGNUM:
xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
xsnprintf (reg, sizeof reg, "0x%s",
phex_nz (extract_unsigned_integer (buf, 4, byte_order), 4));
- target_write (¤t_target, TARGET_OBJECT_SPU, annex,
+ target_write (current_target, TARGET_OBJECT_SPU, annex,
(gdb_byte *) reg, 0, strlen (reg));
}
case SPU_FPSCR_REGNUM:
regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
xsnprintf (annex, sizeof annex, "%d/fpcr", (int) id);
- target_write (¤t_target, TARGET_OBJECT_SPU, annex, buf, 0, 16);
+ target_write (current_target, TARGET_OBJECT_SPU, annex, buf, 0, 16);
break;
case SPU_SRR0_REGNUM:
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/event_status", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_status."));
event_status = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/event_mask", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read event_mask."));
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/signal1", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex, buf, 0, 4);
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex, buf, 0, 4);
if (len < 0)
error (_("Could not read signal1."));
else if (len == 4)
}
xsnprintf (annex, sizeof annex, "%d/signal1_type", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal1_type."));
signal1_type = strtoulst ((char *) buf, NULL, 16);
xsnprintf (annex, sizeof annex, "%d/signal2", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex, buf, 0, 4);
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex, buf, 0, 4);
if (len < 0)
error (_("Could not read signal2."));
else if (len == 4)
}
xsnprintf (annex, sizeof annex, "%d/signal2_type", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, (sizeof (buf) - 1));
if (len <= 0)
error (_("Could not read signal2_type."));
chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoMailbox");
xsnprintf (annex, sizeof annex, "%d/mbox_info", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, sizeof buf);
if (len < 0)
error (_("Could not read mbox_info."));
"mbox", "SPU Outbound Mailbox");
xsnprintf (annex, sizeof annex, "%d/ibox_info", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, sizeof buf);
if (len < 0)
error (_("Could not read ibox_info."));
"ibox", "SPU Outbound Interrupt Mailbox");
xsnprintf (annex, sizeof annex, "%d/wbox_info", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, sizeof buf);
if (len < 0)
error (_("Could not read wbox_info."));
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/dma_info", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, 40 + 16 * 32);
if (len <= 0)
error (_("Could not read dma_info."));
id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
xsnprintf (annex, sizeof annex, "%d/proxydma_info", id);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_target, TARGET_OBJECT_SPU, annex,
buf, 0, 24 + 8 * 32);
if (len <= 0)
error (_("Could not read proxydma_info."));
entry_point
= gdbarch_convert_from_func_ptr_addr (get_objfile_arch (objfile),
entry_point,
- ¤t_target);
+ current_target);
/* Remove any ISA markers, so that this matches entries in the
symbol table. */
/* Next try to read the description from the current target using
target objects. */
if (current_target_desc == NULL)
- current_target_desc = target_read_description_xml (¤t_target);
+ current_target_desc = target_read_description_xml (current_target);
/* If that failed try a target-specific hook. */
if (current_target_desc == NULL)
- current_target_desc = target_read_description (¤t_target);
+ current_target_desc = target_read_description (current_target);
/* If a non-NULL description was returned, then update the current
architecture. */
{
LONGEST len;
- len = target_write_with_progress (current_target.beneath,
+ len = target_write_with_progress (current_target->beneath,
TARGET_OBJECT_MEMORY, NULL,
r->data, r->begin, r->end - r->begin,
progress_cb, r->baton);
{
LONGEST len;
- len = target_write_with_progress (¤t_target,
+ len = target_write_with_progress (current_target,
TARGET_OBJECT_FLASH, NULL,
r->data, r->begin,
r->end - r->begin,
/* The target structure we are currently using to talk to a process
or file or whatever "inferior" we have. */
-struct target_ops current_target;
+struct target_ops *current_target;
/* Command list for target. */
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_has_all_memory (t))
return 1;
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_has_memory (t))
return 1;
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_has_stack (t))
return 1;
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_has_registers (t))
return 1;
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_has_execution (t, the_ptid))
return 1;
void
target_kill (void)
{
- current_target.to_kill (¤t_target);
+ current_target->to_kill (current_target);
}
void
target_load (const char *arg, int from_tty)
{
target_dcache_invalidate ();
- (*current_target.to_load) (¤t_target, arg, from_tty);
+ (*current_target->to_load) (current_target, arg, from_tty);
}
/* Possible terminal states. */
void
target_terminal_init (void)
{
- (*current_target.to_terminal_init) (¤t_target);
+ (*current_target->to_terminal_init) (current_target);
terminal_state = terminal_is_ours;
}
/* If GDB is resuming the inferior in the foreground, install
inferior's terminal modes. */
- (*current_target.to_terminal_inferior) (¤t_target);
+ (*current_target->to_terminal_inferior) (current_target);
terminal_state = terminal_is_inferior;
}
if (terminal_state == terminal_is_ours)
return;
- (*current_target.to_terminal_ours) (¤t_target);
+ (*current_target->to_terminal_ours) (current_target);
terminal_state = terminal_is_ours;
}
{
if (terminal_state != terminal_is_inferior)
return;
- (*current_target.to_terminal_ours_for_output) (¤t_target);
+ (*current_target->to_terminal_ours_for_output) (current_target);
terminal_state = terminal_is_ours_for_output;
}
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
{
if (t->to_terminal_ours != delegate_terminal_ours
&& t->to_terminal_ours != tdefault_terminal_ours)
tcomplain (void)
{
error (_("You can't do that when your target is `%s'"),
- current_target.to_shortname);
+ current_target->to_shortname);
}
void
struct target_ops *t;
/* First, reset current's contents. */
- memset (¤t_target, 0, sizeof (current_target));
+ memset (current_target, 0, sizeof (struct target_ops));
/* Install the delegators. */
- install_delegators (¤t_target);
+ install_delegators (current_target);
- current_target.to_stratum = target_stack->to_stratum;
+ current_target->to_stratum = target_stack->to_stratum;
#define INHERIT(FIELD, TARGET) \
- if (!current_target.FIELD) \
- current_target.FIELD = (TARGET)->FIELD
+ if (!current_target->FIELD) \
+ current_target->FIELD = (TARGET)->FIELD
/* Do not add any new INHERITs here. Instead, use the delegation
mechanism provided by make-target-delegates. */
/* Finally, position the target-stack beneath the squashed
"current_target". That way code looking for a non-inherited
target method can quickly and simply find it. */
- current_target.beneath = target_stack;
+ current_target->beneath = target_stack;
if (targetdebug)
setup_target_debug ();
void
pop_all_targets_above (enum strata above_stratum)
{
- while ((int) (current_target.to_stratum) > (int) above_stratum)
+ while ((int) (current_target->to_stratum) > (int) above_stratum)
{
if (!unpush_target (target_stack))
{
target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
{
volatile CORE_ADDR addr = 0;
- struct target_ops *target = ¤t_target;
+ struct target_ops *target = current_target;
if (gdbarch_fetch_tls_load_module_address_p (target_gdbarch ()))
{
int
target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
- /* Dispatch to the topmost target, not the flattened current_target.
+ /* Dispatch to the topmost target, not the flattened current_target->
Memory accesses check target->to_has_(all_)memory, and the
flattened target doesn't inherit those. */
- if (target_read (current_target.beneath, TARGET_OBJECT_MEMORY, NULL,
+ if (target_read (current_target->beneath, TARGET_OBJECT_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
target_read_raw_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
/* See comment in target_read_memory about why the request starts at
- current_target.beneath. */
- if (target_read (current_target.beneath, TARGET_OBJECT_RAW_MEMORY, NULL,
+ current_target->beneath. */
+ if (target_read (current_target->beneath, TARGET_OBJECT_RAW_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
/* See comment in target_read_memory about why the request starts at
- current_target.beneath. */
- if (target_read (current_target.beneath, TARGET_OBJECT_STACK_MEMORY, NULL,
+ current_target->beneath. */
+ if (target_read (current_target->beneath, TARGET_OBJECT_STACK_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
target_read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
{
/* See comment in target_read_memory about why the request starts at
- current_target.beneath. */
- if (target_read (current_target.beneath, TARGET_OBJECT_CODE_MEMORY, NULL,
+ current_target->beneath. */
+ if (target_read (current_target->beneath, TARGET_OBJECT_CODE_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
{
/* See comment in target_read_memory about why the request starts at
- current_target.beneath. */
- if (target_write (current_target.beneath, TARGET_OBJECT_MEMORY, NULL,
+ current_target->beneath. */
+ if (target_write (current_target->beneath, TARGET_OBJECT_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
{
/* See comment in target_read_memory about why the request starts at
- current_target.beneath. */
- if (target_write (current_target.beneath, TARGET_OBJECT_RAW_MEMORY, NULL,
+ current_target->beneath. */
+ if (target_write (current_target->beneath, TARGET_OBJECT_RAW_MEMORY, NULL,
myaddr, memaddr, len) == len)
return 0;
else
int ix;
struct target_ops *t;
- result = current_target.to_memory_map (¤t_target);
+ result = current_target->to_memory_map (current_target);
if (result == NULL)
return NULL;
void
target_flash_erase (ULONGEST address, LONGEST length)
{
- current_target.to_flash_erase (¤t_target, address, length);
+ current_target->to_flash_erase (current_target, address, length);
}
void
target_flash_done (void)
{
- current_target.to_flash_done (¤t_target);
+ current_target->to_flash_done (current_target);
}
static void
return 1;
}
- return current_target.to_insert_breakpoint (¤t_target,
+ return current_target->to_insert_breakpoint (current_target,
gdbarch, bp_tgt);
}
return 1;
}
- return current_target.to_remove_breakpoint (¤t_target,
+ return current_target->to_remove_breakpoint (current_target,
gdbarch, bp_tgt);
}
prepare_for_detach ();
- current_target.to_detach (¤t_target, args, from_tty);
+ current_target->to_detach (current_target, args, from_tty);
}
void
disconnecting. */
remove_breakpoints ();
- current_target.to_disconnect (¤t_target, args, from_tty);
+ current_target->to_disconnect (current_target, args, from_tty);
}
ptid_t
target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
{
- return (current_target.to_wait) (¤t_target, ptid, status, options);
+ return (current_target->to_wait) (current_target, ptid, status, options);
}
/* See target.h. */
char *
target_pid_to_str (ptid_t ptid)
{
- return (*current_target.to_pid_to_str) (¤t_target, ptid);
+ return (*current_target->to_pid_to_str) (current_target, ptid);
}
char *
target_thread_name (struct thread_info *info)
{
- return current_target.to_thread_name (¤t_target, info);
+ return current_target->to_thread_name (current_target, info);
}
void
target_dcache_invalidate ();
- current_target.to_resume (¤t_target, ptid, step, signal);
+ current_target->to_resume (current_target, ptid, step, signal);
registers_changed_ptid (ptid);
/* We only set the internal executing state here. The user/frontend
void
target_pass_signals (int numsigs, unsigned char *pass_signals)
{
- (*current_target.to_pass_signals) (¤t_target, numsigs, pass_signals);
+ (*current_target->to_pass_signals) (current_target, numsigs, pass_signals);
}
void
target_program_signals (int numsigs, unsigned char *program_signals)
{
- (*current_target.to_program_signals) (¤t_target,
+ (*current_target->to_program_signals) (current_target,
numsigs, program_signals);
}
int
target_follow_fork (int follow_child, int detach_fork)
{
- return current_target.to_follow_fork (¤t_target,
+ return current_target->to_follow_fork (current_target,
follow_child, detach_fork);
}
void
target_follow_exec (struct inferior *inf, char *execd_pathname)
{
- current_target.to_follow_exec (¤t_target, inf, execd_pathname);
+ current_target->to_follow_exec (current_target, inf, execd_pathname);
}
static void
void
target_mourn_inferior (void)
{
- current_target.to_mourn_inferior (¤t_target);
+ current_target->to_mourn_inferior (current_target);
/* We no longer need to keep handles on any of the object files.
Make sure to release them to avoid unnecessarily locking any
CORE_ADDR *found_addrp)
{
/* Start over from the top of the target stack. */
- return simple_search_memory (current_target.beneath,
+ return simple_search_memory (current_target->beneath,
start_addr, search_space_len,
pattern, pattern_len, found_addrp);
}
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp)
{
- return current_target.to_search_memory (¤t_target, start_addr,
+ return current_target->to_search_memory (current_target, start_addr,
search_space_len,
pattern, pattern_len, found_addrp);
}
struct target_ops *t;
/* If a target on the current stack can attach, use it. */
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
{
if (t->to_attach != NULL)
break;
struct target_ops *t;
/* If a target on the current stack can attach, use it. */
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
{
if (t->to_create_inferior != NULL)
break;
/* If we're already connected to something that can get us OS
related data, use it. Otherwise, try using the native
target. */
- if (current_target.to_stratum >= process_stratum)
- t = current_target.beneath;
+ if (current_target->to_stratum >= process_stratum)
+ t = current_target->beneath;
else
t = find_default_run_target (NULL);
{
struct target_ops *t;
- for (t = ¤t_target; t != NULL; t = t->beneath)
+ for (t = current_target; t != NULL; t = t->beneath)
if (t->to_supports_disable_randomization)
return t->to_supports_disable_randomization (t);
/* If we're already connected to something that can get us OS
related data, use it. Otherwise, try using the native
target. */
- if (current_target.to_stratum >= process_stratum)
- t = current_target.beneath;
+ if (current_target->to_stratum >= process_stratum)
+ t = current_target->beneath;
else
t = find_default_run_target ("get OS data");
{
struct address_space *aspace;
- aspace = current_target.to_thread_address_space (¤t_target, ptid);
+ aspace = current_target->to_thread_address_space (current_target, ptid);
gdb_assert (aspace != NULL);
return aspace;
{
/* If we're already connected to something that can perform
file I/O, use it. Otherwise, try using the native target. */
- if (current_target.to_stratum >= process_stratum)
- return current_target.beneath;
+ if (current_target->to_stratum >= process_stratum)
+ return current_target->beneath;
else
return find_default_run_target ("file I/O");
}
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_stratum == stratum)
return t;
int
target_thread_alive (ptid_t ptid)
{
- return current_target.to_thread_alive (¤t_target, ptid);
+ return current_target->to_thread_alive (current_target, ptid);
}
void
target_update_thread_list (void)
{
- current_target.to_update_thread_list (¤t_target);
+ current_target->to_update_thread_list (current_target);
}
void
return;
}
- (*current_target.to_stop) (¤t_target, ptid);
+ (*current_target->to_stop) (current_target, ptid);
}
void
return;
}
- (*current_target.to_interrupt) (¤t_target, ptid);
+ (*current_target->to_interrupt) (current_target, ptid);
}
/* See target.h. */
void
target_check_pending_interrupt (void)
{
- (*current_target.to_check_pending_interrupt) (¤t_target);
+ (*current_target->to_check_pending_interrupt) (current_target);
}
/* See target/target.h. */
void
target_fetch_registers (struct regcache *regcache, int regno)
{
- current_target.to_fetch_registers (¤t_target, regcache, regno);
+ current_target->to_fetch_registers (current_target, regcache, regno);
if (targetdebug)
debug_print_register ("target_fetch_registers", regcache, regno);
}
if (!may_write_registers)
error (_("Writing to registers is not allowed (regno %d)"), regno);
- current_target.to_store_registers (¤t_target, regcache, regno);
+ current_target->to_store_registers (current_target, regcache, regno);
if (targetdebug)
{
debug_print_register ("target_store_registers", regcache, regno);
int
target_core_of_thread (ptid_t ptid)
{
- return current_target.to_core_of_thread (¤t_target, ptid);
+ return current_target->to_core_of_thread (current_target, ptid);
}
int
const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
{
/* Start over from the top of the target stack. */
- return simple_verify_memory (current_target.beneath,
+ return simple_verify_memory (current_target->beneath,
data, memaddr, size);
}
int
target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
{
- return current_target.to_verify_memory (¤t_target,
+ return current_target->to_verify_memory (current_target,
data, memaddr, size);
}
int
target_insert_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
{
- return current_target.to_insert_mask_watchpoint (¤t_target,
+ return current_target->to_insert_mask_watchpoint (current_target,
addr, mask, rw);
}
int
target_remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask, int rw)
{
- return current_target.to_remove_mask_watchpoint (¤t_target,
+ return current_target->to_remove_mask_watchpoint (current_target,
addr, mask, rw);
}
int
target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask)
{
- return current_target.to_masked_watch_num_registers (¤t_target,
+ return current_target->to_masked_watch_num_registers (current_target,
addr, mask);
}
int
target_ranged_break_num_registers (void)
{
- return current_target.to_ranged_break_num_registers (¤t_target);
+ return current_target->to_ranged_break_num_registers (current_target);
}
/* See target.h. */
int
target_supports_btrace (enum btrace_format format)
{
- return current_target.to_supports_btrace (¤t_target, format);
+ return current_target->to_supports_btrace (current_target, format);
}
/* See target.h. */
struct btrace_target_info *
target_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
{
- return current_target.to_enable_btrace (¤t_target, ptid, conf);
+ return current_target->to_enable_btrace (current_target, ptid, conf);
}
/* See target.h. */
void
target_disable_btrace (struct btrace_target_info *btinfo)
{
- current_target.to_disable_btrace (¤t_target, btinfo);
+ current_target->to_disable_btrace (current_target, btinfo);
}
/* See target.h. */
void
target_teardown_btrace (struct btrace_target_info *btinfo)
{
- current_target.to_teardown_btrace (¤t_target, btinfo);
+ current_target->to_teardown_btrace (current_target, btinfo);
}
/* See target.h. */
struct btrace_target_info *btinfo,
enum btrace_read_type type)
{
- return current_target.to_read_btrace (¤t_target, btrace, btinfo, type);
+ return current_target->to_read_btrace (current_target, btrace, btinfo, type);
}
/* See target.h. */
const struct btrace_config *
target_btrace_conf (const struct btrace_target_info *btinfo)
{
- return current_target.to_btrace_conf (¤t_target, btinfo);
+ return current_target->to_btrace_conf (current_target, btinfo);
}
/* See target.h. */
void
target_stop_recording (void)
{
- current_target.to_stop_recording (¤t_target);
+ current_target->to_stop_recording (current_target);
}
/* See target.h. */
void
target_save_record (const char *filename)
{
- current_target.to_save_record (¤t_target, filename);
+ current_target->to_save_record (current_target, filename);
}
/* See target.h. */
{
struct target_ops *t;
- for (t = current_target.beneath; t != NULL; t = t->beneath)
+ for (t = current_target->beneath; t != NULL; t = t->beneath)
if (t->to_delete_record != delegate_delete_record
&& t->to_delete_record != tdefault_delete_record)
return 1;
void
target_delete_record (void)
{
- current_target.to_delete_record (¤t_target);
+ current_target->to_delete_record (current_target);
}
/* See target.h. */
int
target_record_is_replaying (ptid_t ptid)
{
- return current_target.to_record_is_replaying (¤t_target, ptid);
+ return current_target->to_record_is_replaying (current_target, ptid);
}
/* See target.h. */
int
target_record_will_replay (ptid_t ptid, int dir)
{
- return current_target.to_record_will_replay (¤t_target, ptid, dir);
+ return current_target->to_record_will_replay (current_target, ptid, dir);
}
/* See target.h. */
void
target_record_stop_replaying (void)
{
- current_target.to_record_stop_replaying (¤t_target);
+ current_target->to_record_stop_replaying (current_target);
}
/* See target.h. */
void
target_goto_record_begin (void)
{
- current_target.to_goto_record_begin (¤t_target);
+ current_target->to_goto_record_begin (current_target);
}
/* See target.h. */
void
target_goto_record_end (void)
{
- current_target.to_goto_record_end (¤t_target);
+ current_target->to_goto_record_end (current_target);
}
/* See target.h. */
void
target_goto_record (ULONGEST insn)
{
- current_target.to_goto_record (¤t_target, insn);
+ current_target->to_goto_record (current_target, insn);
}
/* See target.h. */
void
target_insn_history (int size, int flags)
{
- current_target.to_insn_history (¤t_target, size, flags);
+ current_target->to_insn_history (current_target, size, flags);
}
/* See target.h. */
void
target_insn_history_from (ULONGEST from, int size, int flags)
{
- current_target.to_insn_history_from (¤t_target, from, size, flags);
+ current_target->to_insn_history_from (current_target, from, size, flags);
}
/* See target.h. */
void
target_insn_history_range (ULONGEST begin, ULONGEST end, int flags)
{
- current_target.to_insn_history_range (¤t_target, begin, end, flags);
+ current_target->to_insn_history_range (current_target, begin, end, flags);
}
/* See target.h. */
void
target_call_history (int size, int flags)
{
- current_target.to_call_history (¤t_target, size, flags);
+ current_target->to_call_history (current_target, size, flags);
}
/* See target.h. */
void
target_call_history_from (ULONGEST begin, int size, int flags)
{
- current_target.to_call_history_from (¤t_target, begin, size, flags);
+ current_target->to_call_history_from (current_target, begin, size, flags);
}
/* See target.h. */
void
target_call_history_range (ULONGEST begin, ULONGEST end, int flags)
{
- current_target.to_call_history_range (¤t_target, begin, end, flags);
+ current_target->to_call_history_range (current_target, begin, end, flags);
}
/* See target.h. */
const struct frame_unwind *
target_get_unwinder (void)
{
- return current_target.to_get_unwinder (¤t_target);
+ return current_target->to_get_unwinder (current_target);
}
/* See target.h. */
const struct frame_unwind *
target_get_tailcall_unwinder (void)
{
- return current_target.to_get_tailcall_unwinder (¤t_target);
+ return current_target->to_get_tailcall_unwinder (current_target);
}
/* See target.h. */
void
target_prepare_to_generate_core (void)
{
- current_target.to_prepare_to_generate_core (¤t_target);
+ current_target->to_prepare_to_generate_core (current_target);
}
/* See target.h. */
void
target_done_generating_core (void)
{
- current_target.to_done_generating_core (¤t_target);
+ current_target->to_done_generating_core (current_target);
}
static void
setup_target_debug (void)
{
- memcpy (&debug_target, ¤t_target, sizeof debug_target);
+ memcpy (&debug_target, current_target, sizeof debug_target);
- init_debug_target (¤t_target);
+ init_debug_target (current_target);
}
\f
target_async (int enable)
{
infrun_async (enable);
- current_target.to_async (¤t_target, enable);
+ current_target->to_async (current_target, enable);
}
/* Controls if targets can report that they can/are async. This is
static int
target_always_non_stop_p (void)
{
- return current_target.to_always_non_stop_p (¤t_target);
+ return current_target->to_always_non_stop_p (current_target);
}
/* See target.h. */
void
initialize_targets (void)
{
+ current_target = XCNEW (struct target_ops);
+
init_dummy_target ();
push_target (&dummy_target);
/* The ops structure for our "current" target process. This should
never be NULL. If there is no target, it points to the dummy_target. */
-extern struct target_ops current_target;
+extern struct target_ops *current_target;
/* Define easy words for doing these operations on our current target. */
-#define target_shortname (current_target.to_shortname)
-#define target_longname (current_target.to_longname)
+#define target_shortname (current_target->to_shortname)
+#define target_longname (current_target->to_longname)
/* Does whatever cleanup is required for a target that we are no
longer going to be calling. This routine is automatically always
These targets must set to_attach_no_wait. */
#define target_attach_no_wait \
- (current_target.to_attach_no_wait)
+ (current_target->to_attach_no_wait)
/* The target_attach operation places a process under debugger control,
and stops the process.
This operation provides a target-specific hook that allows the
necessary bookkeeping to be performed after an attach completes. */
#define target_post_attach(pid) \
- (*current_target.to_post_attach) (¤t_target, pid)
+ (*current_target->to_post_attach) (current_target, pid)
/* Takes a program previously attached to and detaches it.
The program may resume execution (some targets do, some don't) and will
debugged. */
#define target_prepare_to_store(regcache) \
- (*current_target.to_prepare_to_store) (¤t_target, regcache)
+ (*current_target->to_prepare_to_store) (current_target, regcache)
/* Determine current address space of thread PTID. */
simultaneously. */
#define target_supports_multi_process() \
- (*current_target.to_supports_multi_process) (¤t_target)
+ (*current_target->to_supports_multi_process) (current_target)
/* Returns true if this target can disable address space randomization. */
while a trace experiment is running. */
#define target_supports_enable_disable_tracepoint() \
- (*current_target.to_supports_enable_disable_tracepoint) (¤t_target)
+ (*current_target->to_supports_enable_disable_tracepoint) (current_target)
#define target_supports_string_tracing() \
- (*current_target.to_supports_string_tracing) (¤t_target)
+ (*current_target->to_supports_string_tracing) (current_target)
/* Returns true if this target can handle breakpoint conditions
on its end. */
#define target_supports_evaluation_of_breakpoint_conditions() \
- (*current_target.to_supports_evaluation_of_breakpoint_conditions) (¤t_target)
+ (*current_target->to_supports_evaluation_of_breakpoint_conditions) (current_target)
/* Returns true if this target can handle breakpoint commands
on its end. */
#define target_can_run_breakpoint_commands() \
- (*current_target.to_can_run_breakpoint_commands) (¤t_target)
+ (*current_target->to_can_run_breakpoint_commands) (current_target)
extern int target_read_string (CORE_ADDR, char **, int, int *);
/* Print a line about the current target. */
#define target_files_info() \
- (*current_target.to_files_info) (¤t_target)
+ (*current_target->to_files_info) (current_target)
/* Insert a breakpoint at address BP_TGT->placed_address in
the target machine. Returns 0 for success, and returns non-zero or
exists. */
#define target_terminal_info(arg, from_tty) \
- (*current_target.to_terminal_info) (¤t_target, arg, from_tty)
+ (*current_target->to_terminal_info) (current_target, arg, from_tty)
/* Kill the inferior process. Make it go away. */
Such targets will supply an appropriate definition for this function. */
#define target_post_startup_inferior(ptid) \
- (*current_target.to_post_startup_inferior) (¤t_target, ptid)
+ (*current_target->to_post_startup_inferior) (current_target, ptid)
/* On some targets, we can catch an inferior fork or vfork event when
it occurs. These functions insert/remove an already-created
catchpoint type is not supported and -1 for failure. */
#define target_insert_fork_catchpoint(pid) \
- (*current_target.to_insert_fork_catchpoint) (¤t_target, pid)
+ (*current_target->to_insert_fork_catchpoint) (current_target, pid)
#define target_remove_fork_catchpoint(pid) \
- (*current_target.to_remove_fork_catchpoint) (¤t_target, pid)
+ (*current_target->to_remove_fork_catchpoint) (current_target, pid)
#define target_insert_vfork_catchpoint(pid) \
- (*current_target.to_insert_vfork_catchpoint) (¤t_target, pid)
+ (*current_target->to_insert_vfork_catchpoint) (current_target, pid)
#define target_remove_vfork_catchpoint(pid) \
- (*current_target.to_remove_vfork_catchpoint) (¤t_target, pid)
+ (*current_target->to_remove_vfork_catchpoint) (current_target, pid)
/* If the inferior forks or vforks, this function will be called at
the next resume in order to perform any bookkeeping and fiddling
catchpoint type is not supported and -1 for failure. */
#define target_insert_exec_catchpoint(pid) \
- (*current_target.to_insert_exec_catchpoint) (¤t_target, pid)
+ (*current_target->to_insert_exec_catchpoint) (current_target, pid)
#define target_remove_exec_catchpoint(pid) \
- (*current_target.to_remove_exec_catchpoint) (¤t_target, pid)
+ (*current_target->to_remove_exec_catchpoint) (current_target, pid)
/* Syscall catch.
for failure. */
#define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table) \
- (*current_target.to_set_syscall_catchpoint) (¤t_target, \
+ (*current_target->to_set_syscall_catchpoint) (current_target, \
pid, needed, any_count, \
table_size, table)
exit code of PID, if any. */
#define target_has_exited(pid,wait_status,exit_status) \
- (*current_target.to_has_exited) (¤t_target, \
+ (*current_target->to_has_exited) (current_target, \
pid,wait_status,exit_status)
/* The debugger has completed a blocking wait() call. There is now
placed in OUTBUF. */
#define target_rcmd(command, outbuf) \
- (*current_target.to_rcmd) (¤t_target, command, outbuf)
+ (*current_target->to_rcmd) (current_target, command, outbuf)
/* Does the target include all of memory, or only part of it? This
Can it lock the thread scheduler? */
#define target_can_lock_scheduler \
- (current_target.to_has_thread_control & tc_schedlock)
+ (current_target->to_has_thread_control & tc_schedlock)
/* Controls whether async mode is permitted. */
extern int target_async_permitted;
/* Can the target support asynchronous execution? */
-#define target_can_async_p() (current_target.to_can_async_p (¤t_target))
+#define target_can_async_p() (current_target->to_can_async_p (current_target))
/* Is the target in asynchronous execution mode? */
-#define target_is_async_p() (current_target.to_is_async_p (¤t_target))
+#define target_is_async_p() (current_target->to_is_async_p (current_target))
/* Enables/disabled async target events. */
extern void target_async (int enable);
extern int target_is_non_stop_p (void);
#define target_execution_direction() \
- (current_target.to_execution_direction (¤t_target))
+ (current_target->to_execution_direction (current_target))
/* Converts a process id to a string. Usually, the string just contains
`process xyz', but on some systems it may contain
is okay. */
#define target_extra_thread_info(TP) \
- (current_target.to_extra_thread_info (¤t_target, TP))
+ (current_target->to_extra_thread_info (current_target, TP))
/* Return the thread's name. A NULL result means that the target
could not determine this thread's name. */
it must persist. */
#define target_pid_to_exec_file(pid) \
- (current_target.to_pid_to_exec_file) (¤t_target, pid)
+ (current_target->to_pid_to_exec_file) (current_target, pid)
/* See the to_thread_architecture description in struct target_ops. */
#define target_thread_architecture(ptid) \
- (current_target.to_thread_architecture (¤t_target, ptid))
+ (current_target->to_thread_architecture (current_target, ptid))
/*
* Iterator function for target memory regions.
*/
#define target_find_memory_regions(FUNC, DATA) \
- (current_target.to_find_memory_regions) (¤t_target, FUNC, DATA)
+ (current_target->to_find_memory_regions) (current_target, FUNC, DATA)
/*
* Compose corefile .note section.
*/
#define target_make_corefile_notes(BFD, SIZE_P) \
- (current_target.to_make_corefile_notes) (¤t_target, BFD, SIZE_P)
+ (current_target->to_make_corefile_notes) (current_target, BFD, SIZE_P)
/* Bookmark interfaces. */
#define target_get_bookmark(ARGS, FROM_TTY) \
- (current_target.to_get_bookmark) (¤t_target, ARGS, FROM_TTY)
+ (current_target->to_get_bookmark) (current_target, ARGS, FROM_TTY)
#define target_goto_bookmark(ARG, FROM_TTY) \
- (current_target.to_goto_bookmark) (¤t_target, ARG, FROM_TTY)
+ (current_target->to_goto_bookmark) (current_target, ARG, FROM_TTY)
/* Hardware watchpoint interfaces. */
write). Only the INFERIOR_PTID task is being queried. */
#define target_stopped_by_watchpoint() \
- ((*current_target.to_stopped_by_watchpoint) (¤t_target))
+ ((*current_target->to_stopped_by_watchpoint) (current_target))
/* Returns non-zero if the target stopped because it executed a
software breakpoint instruction. */
#define target_stopped_by_sw_breakpoint() \
- ((*current_target.to_stopped_by_sw_breakpoint) (¤t_target))
+ ((*current_target->to_stopped_by_sw_breakpoint) (current_target))
#define target_supports_stopped_by_sw_breakpoint() \
- ((*current_target.to_supports_stopped_by_sw_breakpoint) (¤t_target))
+ ((*current_target->to_supports_stopped_by_sw_breakpoint) (current_target))
#define target_stopped_by_hw_breakpoint() \
- ((*current_target.to_stopped_by_hw_breakpoint) (¤t_target))
+ ((*current_target->to_stopped_by_hw_breakpoint) (current_target))
#define target_supports_stopped_by_hw_breakpoint() \
- ((*current_target.to_supports_stopped_by_hw_breakpoint) (¤t_target))
+ ((*current_target->to_supports_stopped_by_hw_breakpoint) (current_target))
/* Non-zero if we have steppable watchpoints */
#define target_have_steppable_watchpoint \
- (current_target.to_have_steppable_watchpoint)
+ (current_target->to_have_steppable_watchpoint)
/* Non-zero if we have continuable watchpoints */
#define target_have_continuable_watchpoint \
- (current_target.to_have_continuable_watchpoint)
+ (current_target->to_have_continuable_watchpoint)
/* Provide defaults for hardware watchpoint functions. */
one. OTHERTYPE is who knows what... */
#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
- (*current_target.to_can_use_hw_breakpoint) (¤t_target, \
- TYPE, CNT, OTHERTYPE)
+ (*current_target->to_can_use_hw_breakpoint) (current_target, \
+ TYPE, CNT, OTHERTYPE);
/* Returns the number of debug registers needed to watch the given
memory region, or zero if not supported. */
#define target_region_ok_for_hw_watchpoint(addr, len) \
- (*current_target.to_region_ok_for_hw_watchpoint) (¤t_target, \
+ (*current_target->to_region_ok_for_hw_watchpoint) (current_target, \
addr, len)
#define target_can_do_single_step() \
- (*current_target.to_can_do_single_step) (¤t_target)
+ (*current_target->to_can_do_single_step) (current_target)
/* Set/clear a hardware watchpoint starting at ADDR, for LEN bytes.
TYPE is 0 for write, 1 for read, and 2 for read/write accesses.
-1 for failure. */
#define target_insert_watchpoint(addr, len, type, cond) \
- (*current_target.to_insert_watchpoint) (¤t_target, \
+ (*current_target->to_insert_watchpoint) (current_target, \
addr, len, type, cond)
#define target_remove_watchpoint(addr, len, type, cond) \
- (*current_target.to_remove_watchpoint) (¤t_target, \
+ (*current_target->to_remove_watchpoint) (current_target, \
addr, len, type, cond)
/* Insert a new masked watchpoint at ADDR using the mask MASK.
message) otherwise. */
#define target_insert_hw_breakpoint(gdbarch, bp_tgt) \
- (*current_target.to_insert_hw_breakpoint) (¤t_target, \
+ (*current_target->to_insert_hw_breakpoint) (current_target, \
gdbarch, bp_tgt)
#define target_remove_hw_breakpoint(gdbarch, bp_tgt) \
- (*current_target.to_remove_hw_breakpoint) (¤t_target, \
+ (*current_target->to_remove_hw_breakpoint) (current_target, \
gdbarch, bp_tgt)
/* Return number of debug registers needed for a ranged breakpoint,
For this reason, GDB will still evaluate the condition expression when
the watchpoint triggers. */
#define target_can_accel_watchpoint_condition(addr, len, type, cond) \
- (*current_target.to_can_accel_watchpoint_condition) (¤t_target, \
+ (*current_target->to_can_accel_watchpoint_condition) (current_target, \
addr, len, type, cond)
/* Return number of debug registers needed for a masked watchpoint,
/* Target can execute in reverse? */
#define target_can_execute_reverse \
- current_target.to_can_execute_reverse (¤t_target)
+ current_target->to_can_execute_reverse (current_target)
extern const struct target_desc *target_read_description (struct target_ops *);
#define target_get_ada_task_ptid(lwp, tid) \
- (*current_target.to_get_ada_task_ptid) (¤t_target, lwp,tid)
+ (*current_target->to_get_ada_task_ptid) (current_target, lwp,tid)
/* Utility implementation of searching memory. */
extern int simple_search_memory (struct target_ops* ops,
/* Return nonzero if the filesystem seen by the current inferior
is the local filesystem, zero otherwise. */
#define target_filesystem_is_local() \
- current_target.to_filesystem_is_local (¤t_target)
+ current_target->to_filesystem_is_local (current_target)
/* Open FILENAME on the target, in the filesystem as seen by INF,
using FLAGS and MODE. If INF is NULL, use the filesystem seen
/* Tracepoint-related operations. */
#define target_trace_init() \
- (*current_target.to_trace_init) (¤t_target)
+ (*current_target->to_trace_init) (current_target)
#define target_download_tracepoint(t) \
- (*current_target.to_download_tracepoint) (¤t_target, t)
+ (*current_target->to_download_tracepoint) (current_target, t)
#define target_can_download_tracepoint() \
- (*current_target.to_can_download_tracepoint) (¤t_target)
+ (*current_target->to_can_download_tracepoint) (current_target)
#define target_download_trace_state_variable(tsv) \
- (*current_target.to_download_trace_state_variable) (¤t_target, tsv)
+ (*current_target->to_download_trace_state_variable) (current_target, tsv)
#define target_enable_tracepoint(loc) \
- (*current_target.to_enable_tracepoint) (¤t_target, loc)
+ (*current_target->to_enable_tracepoint) (current_target, loc)
#define target_disable_tracepoint(loc) \
- (*current_target.to_disable_tracepoint) (¤t_target, loc)
+ (*current_target->to_disable_tracepoint) (current_target, loc)
#define target_trace_start() \
- (*current_target.to_trace_start) (¤t_target)
+ (*current_target->to_trace_start) (current_target)
#define target_trace_set_readonly_regions() \
- (*current_target.to_trace_set_readonly_regions) (¤t_target)
+ (*current_target->to_trace_set_readonly_regions) (current_target)
#define target_get_trace_status(ts) \
- (*current_target.to_get_trace_status) (¤t_target, ts)
+ (*current_target->to_get_trace_status) (current_target, ts)
#define target_get_tracepoint_status(tp,utp) \
- (*current_target.to_get_tracepoint_status) (¤t_target, tp, utp)
+ (*current_target->to_get_tracepoint_status) (current_target, tp, utp)
#define target_trace_stop() \
- (*current_target.to_trace_stop) (¤t_target)
+ (*current_target->to_trace_stop) (current_target)
#define target_trace_find(type,num,addr1,addr2,tpp) \
- (*current_target.to_trace_find) (¤t_target, \
+ (*current_target->to_trace_find) (current_target, \
(type), (num), (addr1), (addr2), (tpp))
#define target_get_trace_state_variable_value(tsv,val) \
- (*current_target.to_get_trace_state_variable_value) (¤t_target, \
+ (*current_target->to_get_trace_state_variable_value) (current_target, \
(tsv), (val))
#define target_save_trace_data(filename) \
- (*current_target.to_save_trace_data) (¤t_target, filename)
+ (*current_target->to_save_trace_data) (current_target, filename)
#define target_upload_tracepoints(utpp) \
- (*current_target.to_upload_tracepoints) (¤t_target, utpp)
+ (*current_target->to_upload_tracepoints) (current_target, utpp)
#define target_upload_trace_state_variables(utsvp) \
- (*current_target.to_upload_trace_state_variables) (¤t_target, utsvp)
+ (*current_target->to_upload_trace_state_variables) (current_target, utsvp)
#define target_get_raw_trace_data(buf,offset,len) \
- (*current_target.to_get_raw_trace_data) (¤t_target, \
+ (*current_target->to_get_raw_trace_data) (current_target, \
(buf), (offset), (len))
#define target_get_min_fast_tracepoint_insn_len() \
- (*current_target.to_get_min_fast_tracepoint_insn_len) (¤t_target)
+ (*current_target->to_get_min_fast_tracepoint_insn_len) (current_target)
#define target_set_disconnected_tracing(val) \
- (*current_target.to_set_disconnected_tracing) (¤t_target, val)
+ (*current_target->to_set_disconnected_tracing) (current_target, val)
#define target_set_circular_trace_buffer(val) \
- (*current_target.to_set_circular_trace_buffer) (¤t_target, val)
+ (*current_target->to_set_circular_trace_buffer) (current_target, val)
#define target_set_trace_buffer_size(val) \
- (*current_target.to_set_trace_buffer_size) (¤t_target, val)
+ (*current_target->to_set_trace_buffer_size) (current_target, val)
#define target_set_trace_notes(user,notes,stopnotes) \
- (*current_target.to_set_trace_notes) (¤t_target, \
+ (*current_target->to_set_trace_notes) (current_target, \
(user), (notes), (stopnotes))
#define target_get_tib_address(ptid, addr) \
- (*current_target.to_get_tib_address) (¤t_target, (ptid), (addr))
+ (*current_target->to_get_tib_address) (current_target, (ptid), (addr))
#define target_set_permissions() \
- (*current_target.to_set_permissions) (¤t_target)
+ (*current_target->to_set_permissions) (current_target)
#define target_static_tracepoint_marker_at(addr, marker) \
- (*current_target.to_static_tracepoint_marker_at) (¤t_target, \
+ (*current_target->to_static_tracepoint_marker_at) (current_target, \
addr, marker)
#define target_static_tracepoint_markers_by_strid(marker_id) \
- (*current_target.to_static_tracepoint_markers_by_strid) (¤t_target, \
+ (*current_target->to_static_tracepoint_markers_by_strid) (current_target, \
marker_id)
#define target_traceframe_info() \
- (*current_target.to_traceframe_info) (¤t_target)
+ (*current_target->to_traceframe_info) (current_target)
#define target_use_agent(use) \
- (*current_target.to_use_agent) (¤t_target, use)
+ (*current_target->to_use_agent) (current_target, use)
#define target_can_use_agent() \
- (*current_target.to_can_use_agent) (¤t_target)
+ (*current_target->to_can_use_agent) (current_target)
#define target_augmented_libraries_svr4_read() \
- (*current_target.to_augmented_libraries_svr4_read) (¤t_target)
+ (*current_target->to_augmented_libraries_svr4_read) (current_target)
/* Command logging facility. */
#define target_log_command(p) \
- (*current_target.to_log_command) (¤t_target, p)
+ (*current_target->to_log_command) (current_target, p)
extern int target_core_of_thread (ptid_t ptid);
gdb_byte *buf;
/* We need to read the whole object before we know its size. */
- size = target_read_alloc (¤t_target,
+ size = target_read_alloc (current_target,
TARGET_OBJECT_STATIC_TRACE_DATA,
NULL, &buf);
if (size >= 0)
enum target_xfer_status status;
ULONGEST xfered_partial;
- status = target_xfer_partial (current_target.beneath,
+ status = target_xfer_partial (current_target->beneath,
TARGET_OBJECT_MEMORY, NULL,
buffer + xfered_total * unit_size, NULL,
memaddr + xfered_total,
case lval_register:
case lval_computed:
- observer_notify_target_changed (¤t_target);
+ observer_notify_target_changed (current_target);
/* Having destroyed the frame cache, restore the selected
frame. */
{
CORE_ADDR func_addr
= gdbarch_convert_from_func_ptr_addr (gdbarch, address,
- ¤t_target);
+ current_target);
/* If the function pointer is represented by a description, print
the address of the description. */
set_value_address (v,
gdbarch_convert_from_func_ptr_addr
- (gdbarch, BMSYMBOL_VALUE_ADDRESS (msym), ¤t_target));
+ (gdbarch, BMSYMBOL_VALUE_ADDRESS (msym), current_target));
}
if (arg1p)
return -1;
}
- if (target_read (¤t_target, TARGET_OBJECT_MEMORY,
+ if (target_read (current_target, TARGET_OBJECT_MEMORY,
NULL, tib, thread_local_base, tib_size) != tib_size)
{
printf_filtered (_("Unable to read thread information "