/* Select target systems and architectures at runtime for GDB.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Cygnus Support.
static void debug_to_stop (ptid_t);
-/* NOTE: cagney/2004-09-29: Many targets reference this variable in
- wierd and mysterious ways. Putting the variable here lets those
- wierd and mysterious ways keep building while they are being
- converted to the inferior inheritance structure. */
-struct target_ops deprecated_child_ops;
-
/* Pointer to array of target architecture structures; the size of the
array; the current index into the array; the allocated size of the
array. */
}
int
-default_child_has_execution (struct target_ops *ops)
+default_child_has_execution (struct target_ops *ops, ptid_t the_ptid)
{
/* If there's no thread selected, then we can't make it run through
hoops. */
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (ptid_equal (the_ptid, null_ptid))
return 0;
return 1;
}
int
-target_has_execution_1 (void)
+target_has_execution_1 (ptid_t the_ptid)
{
struct target_ops *t;
for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_has_execution (t))
+ if (t->to_has_execution (t, the_ptid))
return 1;
return 0;
}
+int
+target_has_execution_current (void)
+{
+ return target_has_execution_1 (inferior_ptid);
+}
+
/* Add a possible target architecture to the list. */
void
t->to_has_registers = (int (*) (struct target_ops *)) return_zero;
if (t->to_has_execution == NULL)
- t->to_has_execution = (int (*) (struct target_ops *)) return_zero;
+ t->to_has_execution = (int (*) (struct target_ops *, ptid_t)) return_zero;
if (!target_structs)
{
}
internal_error (__FILE__, __LINE__,
- "could not find a target to create inferior");
+ _("could not find a target to create inferior"));
}
void
target_terminal_inferior (void)
{
/* A background resume (``run&'') should leave GDB in control of the
- terminal. Use target_can_async_p, not target_is_async_p, since at
+ terminal. Use target_can_async_p, not target_is_async_p, since at
this point the target is not async yet. However, if sync_execution
is not set, we know it will become async prior to resume. */
if (target_can_async_p () && !sync_execution)
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
{
- errno = EIO; /* Can't read/write this location */
- return 0; /* No bytes handled */
+ errno = EIO; /* Can't read/write this location. */
+ return 0; /* No bytes handled. */
}
static void
static int
nosymbol (char *name, CORE_ADDR *addrp)
{
- return 1; /* Symbol does not exist in target env */
+ return 1; /* Symbol does not exist in target env. */
}
static void
/* Do not inherit to_find_new_threads. */
/* Do not inherit to_pid_to_str. */
INHERIT (to_extra_thread_info, t);
+ INHERIT (to_thread_name, t);
INHERIT (to_stop, t);
/* Do not inherit to_xfer_partial. */
INHERIT (to_rcmd, t);
INHERIT (to_pid_to_exec_file, t);
INHERIT (to_log_command, t);
INHERIT (to_stratum, t);
- /* Do not inherit to_has_all_memory */
- /* Do not inherit to_has_memory */
- /* Do not inherit to_has_stack */
- /* Do not inherit to_has_registers */
- /* Do not inherit to_has_execution */
+ /* Do not inherit to_has_all_memory. */
+ /* Do not inherit to_has_memory. */
+ /* Do not inherit to_has_stack. */
+ /* Do not inherit to_has_registers. */
+ /* Do not inherit to_has_execution. */
INHERIT (to_has_thread_control, t);
INHERIT (to_can_async_p, t);
INHERIT (to_is_async_p, t);
INHERIT (to_set_permissions, t);
INHERIT (to_static_tracepoint_marker_at, t);
INHERIT (to_static_tracepoint_markers_by_strid, t);
+ INHERIT (to_traceframe_info, t);
INHERIT (to_magic, t);
/* Do not inherit to_memory_map. */
/* Do not inherit to_flash_erase. */
(void (*) (struct regcache *))
noprocess);
de_fault (deprecated_xfer_memory,
- (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *))
+ (int (*) (CORE_ADDR, gdb_byte *, int, int,
+ struct mem_attrib *, struct target_ops *))
nomemory);
de_fault (to_files_info,
(void (*) (struct target_ops *))
(void (*) (ptid_t))
target_ignore);
de_fault (to_insert_fork_catchpoint,
- (void (*) (int))
- tcomplain);
+ (int (*) (int))
+ return_one);
de_fault (to_remove_fork_catchpoint,
(int (*) (int))
- tcomplain);
+ return_one);
de_fault (to_insert_vfork_catchpoint,
- (void (*) (int))
- tcomplain);
+ (int (*) (int))
+ return_one);
de_fault (to_remove_vfork_catchpoint,
(int (*) (int))
- tcomplain);
+ return_one);
de_fault (to_insert_exec_catchpoint,
- (void (*) (int))
- tcomplain);
+ (int (*) (int))
+ return_one);
de_fault (to_remove_exec_catchpoint,
(int (*) (int))
- tcomplain);
+ return_one);
de_fault (to_set_syscall_catchpoint,
(int (*) (int, int, int, int, int *))
- tcomplain);
+ return_one);
de_fault (to_has_exited,
(int (*) (int, int, int *))
return_zero);
de_fault (to_extra_thread_info,
(char *(*) (struct thread_info *))
return_zero);
+ de_fault (to_thread_name,
+ (char *(*) (struct thread_info *))
+ return_zero);
de_fault (to_stop,
(void (*) (ptid_t))
target_ignore);
de_fault (to_static_tracepoint_markers_by_strid,
(VEC(static_tracepoint_marker_p) * (*) (const char *))
tcomplain);
+ de_fault (to_traceframe_info,
+ (struct traceframe_info * (*) (void))
+ tcomplain);
#undef de_fault
/* Finally, position the target-stack beneath the squashed
fprintf_unfiltered (gdb_stderr,
"Magic number of %s target struct wrong\n",
t->to_shortname);
- internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
+ internal_error (__FILE__, __LINE__,
+ _("failed internal consistency check"));
}
/* Find the proper stratum to install this target in. */
if (t->to_stratum == dummy_stratum)
internal_error (__FILE__, __LINE__,
- "Attempt to unpush the dummy target");
+ _("Attempt to unpush the dummy target"));
/* Look for the specified target. Note that we assume that a target
- can only occur once in the target stack. */
+ can only occur once in the target stack. */
for (cur = &target_stack; (*cur) != NULL; cur = &(*cur)->beneath)
{
}
if ((*cur) == NULL)
- return 0; /* Didn't find target_ops, quit now */
+ return 0; /* Didn't find target_ops, quit now. */
/* NOTE: cagney/2003-12-06: In '94 the close call was made
unconditional by moving it to before the above check that the
targets should be closed. */
target_close (t, 0);
- /* Unchain the target */
+ /* Unchain the target. */
tmp = (*cur);
(*cur) = (*cur)->beneath;
tmp->beneath = NULL;
void
pop_target (void)
{
- target_close (target_stack, 0); /* Let it clean up */
+ target_close (target_stack, 0); /* Let it clean up. */
if (unpush_target (target_stack) == 1)
return;
fprintf_unfiltered (gdb_stderr,
"Magic number of %s target struct wrong\n",
t->to_shortname);
- internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
+ internal_error (__FILE__, __LINE__,
+ _("failed internal consistency check"));
}
for (cur = &target_stack; (*cur) != NULL; cur = &(*cur)->beneath)
throw_error (TLS_LOAD_MODULE_NOT_FOUND_ERROR,
_("TLS load module not found"));
- addr = target->to_get_thread_local_address (target, ptid, lm_addr, offset);
+ addr = target->to_get_thread_local_address (target, ptid,
+ lm_addr, offset);
}
/* If an error occurred, print TLS related messages here. Otherwise,
throw the error to some higher catcher. */
switch (ex.error)
{
case TLS_NO_LIBRARY_SUPPORT_ERROR:
- error (_("Cannot find thread-local variables in this thread library."));
+ error (_("Cannot find thread-local variables "
+ "in this thread library."));
break;
case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
if (objfile_is_library)
if (errcode != 0)
{
/* The transfer request might have crossed the boundary to an
- unallocated region of memory. Retry the transfer, requesting
+ unallocated region of memory. Retry the transfer, requesting
a single byte. */
tlen = 1;
offset = 0;
return NULL;
}
+/* Read memory from the live target, even if currently inspecting a
+ traceframe. The return is the same as that of target_read. */
+
+static LONGEST
+target_read_live_memory (enum target_object object,
+ ULONGEST memaddr, gdb_byte *myaddr, LONGEST len)
+{
+ int ret;
+ struct cleanup *cleanup;
+
+ /* Switch momentarily out of tfind mode so to access live memory.
+ Note that this must not clear global state, such as the frame
+ cache, which must still remain valid for the previous traceframe.
+ We may be _building_ the frame cache at this point. */
+ cleanup = make_cleanup_restore_traceframe_number ();
+ set_traceframe_number (-1);
+
+ ret = target_read (current_target.beneath, object, NULL,
+ myaddr, memaddr, len);
+
+ do_cleanups (cleanup);
+ return ret;
+}
+
+/* Using the set of read-only target sections of OPS, read live
+ read-only memory. Note that the actual reads start from the
+ top-most target again.
+
+ For interface/parameters/return description see target.h,
+ to_xfer_partial. */
+
+static LONGEST
+memory_xfer_live_readonly_partial (struct target_ops *ops,
+ enum target_object object,
+ gdb_byte *readbuf, ULONGEST memaddr,
+ LONGEST len)
+{
+ struct target_section *secp;
+ struct target_section_table *table;
+
+ secp = target_section_by_addr (ops, memaddr);
+ if (secp != NULL
+ && (bfd_get_section_flags (secp->bfd, secp->the_bfd_section)
+ & SEC_READONLY))
+ {
+ struct target_section *p;
+ ULONGEST memend = memaddr + len;
+
+ table = target_get_section_table (ops);
+
+ for (p = table->sections; p < table->sections_end; p++)
+ {
+ if (memaddr >= p->addr)
+ {
+ if (memend <= p->endaddr)
+ {
+ /* Entire transfer is within this section. */
+ return target_read_live_memory (object, memaddr,
+ readbuf, len);
+ }
+ else if (memaddr >= p->endaddr)
+ {
+ /* This section ends before the transfer starts. */
+ continue;
+ }
+ else
+ {
+ /* This section overlaps the transfer. Just do half. */
+ len = p->endaddr - memaddr;
+ return target_read_live_memory (object, memaddr,
+ readbuf, len);
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
/* Perform a partial memory transfer.
For docs see target.h, to_xfer_partial. */
}
}
+ /* If reading unavailable memory in the context of traceframes, and
+ this address falls within a read-only section, fallback to
+ reading from live memory. */
+ if (readbuf != NULL && get_traceframe_number () != -1)
+ {
+ VEC(mem_range_s) *available;
+
+ /* If we fail to get the set of available memory, then the
+ target does not support querying traceframe info, and so we
+ attempt reading from the traceframe anyway (assuming the
+ target implements the old QTro packet then). */
+ if (traceframe_available_memory (&available, memaddr, len))
+ {
+ struct cleanup *old_chain;
+
+ old_chain = make_cleanup (VEC_cleanup(mem_range_s), &available);
+
+ if (VEC_empty (mem_range_s, available)
+ || VEC_index (mem_range_s, available, 0)->start != memaddr)
+ {
+ /* Don't read into the traceframe's available
+ memory. */
+ if (!VEC_empty (mem_range_s, available))
+ {
+ LONGEST oldlen = len;
+
+ len = VEC_index (mem_range_s, available, 0)->start - memaddr;
+ gdb_assert (len <= oldlen);
+ }
+
+ do_cleanups (old_chain);
+
+ /* This goes through the topmost target again. */
+ res = memory_xfer_live_readonly_partial (ops, object,
+ readbuf, memaddr, len);
+ if (res > 0)
+ return res;
+
+ /* No use trying further, we know some memory starting
+ at MEMADDR isn't available. */
+ return -1;
+ }
+
+ /* Don't try to read more than how much is available, in
+ case the target implements the deprecated QTro packet to
+ cater for older GDBs (the target's knowledge of read-only
+ sections may be outdated by now). */
+ len = VEC_index (mem_range_s, available, 0)->length;
+
+ do_cleanups (old_chain);
+ }
+ }
+
/* Try GDB's internal data cache. */
region = lookup_mem_region (memaddr);
/* region->hi == 0 means there's no upper bound. */
}
while (ops != NULL);
- if (readbuf && !show_memory_breakpoints)
+ if (res > 0 && readbuf != NULL && !show_memory_breakpoints)
breakpoint_restore_shadows (readbuf, memaddr, reg_len);
/* Make sure the cache gets updated no matter what - if we are writing
const unsigned char *myaddr = NULL;
fprintf_unfiltered (gdb_stdlog,
- "%s:target_xfer_partial (%d, %s, %s, %s, %s, %s) = %s",
+ "%s:target_xfer_partial "
+ "(%d, %s, %s, %s, %s, %s) = %s",
ops->to_shortname,
(int) object,
(annex ? annex : "(null)"),
filling the buffer with good data. There is no way for the caller to know
how much good data might have been transfered anyway. Callers that can
deal with partial reads should call target_read (which will retry until
- it makes no progress, and then return how much was transferred). */
+ it makes no progress, and then return how much was transferred). */
int
target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
show_trust_readonly (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- fprintf_filtered (file, _("\
-Mode for reading from readonly sections is %s.\n"),
+ fprintf_filtered (file,
+ _("Mode for reading from readonly sections is %s.\n"),
value);
}
return len;
}
-/** Assuming that the entire [begin, end) range of memory cannot be read,
- try to read whatever subrange is possible to read.
+/* Assuming that the entire [begin, end) range of memory cannot be
+ read, try to read whatever subrange is possible to read.
- The function results, in RESULT, either zero or one memory block.
- If there's a readable subrange at the beginning, it is completely
- read and returned. Any further readable subrange will not be read.
- Otherwise, if there's a readable subrange at the end, it will be
- completely read and returned. Any readable subranges before it (obviously,
- not starting at the beginning), will be ignored. In other cases --
- either no readable subrange, or readable subrange (s) that is neither
- at the beginning, or end, nothing is returned.
+ The function returns, in RESULT, either zero or one memory block.
+ If there's a readable subrange at the beginning, it is completely
+ read and returned. Any further readable subrange will not be read.
+ Otherwise, if there's a readable subrange at the end, it will be
+ completely read and returned. Any readable subranges before it
+ (obviously, not starting at the beginning), will be ignored. In
+ other cases -- either no readable subrange, or readable subrange(s)
+ that is neither at the beginning, or end, nothing is returned.
- The purpose of this function is to handle a read across a boundary of
- accessible memory in a case when memory map is not available. The above
- restrictions are fine for this case, but will give incorrect results if
- the memory is 'patchy'. However, supporting 'patchy' memory would require
- trying to read every single byte, and it seems unacceptable solution.
- Explicit memory map is recommended for this case -- and
- target_read_memory_robust will take care of reading multiple ranges then. */
+ The purpose of this function is to handle a read across a boundary
+ of accessible memory in a case when memory map is not available.
+ The above restrictions are fine for this case, but will give
+ incorrect results if the memory is 'patchy'. However, supporting
+ 'patchy' memory would require trying to read every single byte,
+ and it seems unacceptable solution. Explicit memory map is
+ recommended for this case -- and target_read_memory_robust will
+ take care of reading multiple ranges then. */
static void
-read_whatever_is_readable (struct target_ops *ops, ULONGEST begin, ULONGEST end,
+read_whatever_is_readable (struct target_ops *ops,
+ ULONGEST begin, ULONGEST end,
VEC(memory_read_result_s) **result)
{
- gdb_byte *buf = xmalloc (end-begin);
+ gdb_byte *buf = xmalloc (end - begin);
ULONGEST current_begin = begin;
ULONGEST current_end = end;
int forward;
/* If we previously failed to read 1 byte, nothing can be done here. */
if (end - begin <= 1)
- return;
+ {
+ xfree (buf);
+ return;
+ }
/* Check that either first or the last byte is readable, and give up
- if not. This heuristic is meant to permit reading accessible memory
+ if not. This heuristic is meant to permit reading accessible memory
at the boundary of accessible region. */
if (target_read_partial (ops, TARGET_OBJECT_MEMORY, NULL,
buf, begin, 1) == 1)
}
else
{
+ xfree (buf);
return;
}
ULONGEST first_half_begin, first_half_end;
ULONGEST second_half_begin, second_half_end;
LONGEST xfer;
-
ULONGEST middle = current_begin + (current_end - current_begin)/2;
+
if (forward)
{
first_half_begin = current_begin;
if (xfer == first_half_end - first_half_begin)
{
- /* This half reads up fine. So, the error must be in the other half. */
+ /* This half reads up fine. So, the error must be in the
+ other half. */
current_begin = second_half_begin;
current_end = second_half_end;
}
else
{
- /* This half is not readable. Because we've tried one byte, we
- know some part of this half if actually redable. Go to the next
+ /* This half is not readable. Because we've tried one byte, we
+ know some part of this half if actually redable. Go to the next
iteration to divide again and try to read.
We don't handle the other half, because this function only tries
{
/* The [current_end, end) range has been read. */
LONGEST rlen = end - current_end;
+
r.data = xmalloc (rlen);
memcpy (r.data, buf + current_end - begin, rlen);
r.begin = current_end;
if (region->attrib.mode == MEM_NONE || region->attrib.mode == MEM_WO)
{
- /* Cannot read this region. Note that we can end up here only
+ /* Cannot read this region. Note that we can end up here only
if the region is explicitly marked inaccessible, or
'inaccessible-by-default' is in effect. */
xfered += rlen;
/* Call an observer, notifying them of the xfer progress? */
if (xfer <= 0)
{
- /* Got an error reading full chunk. See if maybe we can read
+ /* Got an error reading full chunk. See if maybe we can read
some subrange. */
xfree (buffer);
- read_whatever_is_readable (ops, offset + xfered, offset + xfered + to_read, &result);
+ read_whatever_is_readable (ops, offset + xfered,
+ offset + xfered + to_read, &result);
xfered += to_read;
}
else
if ((int) (t->to_stratum) <= (int) dummy_stratum)
continue;
if (has_all_mem)
- printf_unfiltered (_("\tWhile running this, GDB does not access memory from...\n"));
+ printf_unfiltered (_("\tWhile running this, "
+ "GDB does not access memory from...\n"));
printf_unfiltered ("%s:\n", t->to_longname);
(t->to_files_info) (t);
has_all_mem = (*t->to_has_all_memory) (t);
void
target_pre_inferior (int from_tty)
{
- /* Clear out solib state. Otherwise the solib state of the previous
+ /* Clear out solib state. Otherwise the solib state of the previous
inferior might have survived and is entirely wrong for the new
- target. This has been observed on GNU/Linux using glibc 2.3. How
+ target. This has been observed on GNU/Linux using glibc 2.3. How
to reproduce:
bash$ ./foo&
}
}
- internal_error (__FILE__, __LINE__, "could not find a target to detach");
+ internal_error (__FILE__, __LINE__, _("could not find a target to detach"));
}
void
return normal_pid_to_str (ptid);
}
+char *
+target_thread_name (struct thread_info *info)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_thread_name != NULL)
+ return (*t->to_thread_name) (info);
+ }
+
+ return NULL;
+}
+
void
target_resume (ptid_t ptid, int step, enum target_signal signal)
{
/* Some target returned a fork event, but did not know how to follow it. */
internal_error (__FILE__, __LINE__,
- "could not find a target to follow fork");
+ _("could not find a target to follow fork"));
}
void
}
internal_error (__FILE__, __LINE__,
- "could not find a target to follow mourn inferior");
+ _("could not find a target to follow mourn inferior"));
}
/* Look for a target which can describe architectural features, starting
search_buf + keep_len, read_addr,
nr_to_read) != nr_to_read)
{
- warning (_("Unable to access target memory at %s, halting search."),
+ warning (_("Unable to access target "
+ "memory at %s, halting search."),
hex_string (read_addr));
do_cleanups (old_cleanups);
return -1;
|| t->to_stratum == arch_stratum)
continue;
- error (_("\
-The \"%s\" target does not support \"run\". Try \"help target\" or \"continue\"."),
+ error (_("The \"%s\" target does not support \"run\". "
+ "Try \"help target\" or \"continue\"."),
t->to_shortname);
}
/* This function is only called if the target is running. In that
case there should have been a process_stratum target and it
- should either know how to create inferiors, or not... */
- internal_error (__FILE__, __LINE__, "No targets found");
+ should either know how to create inferiors, or not... */
+ internal_error (__FILE__, __LINE__, _("No targets found"));
}
/* Look through the list of possible targets for a target that can
inf = find_inferior_pid (ptid_get_pid (ptid));
if (inf == NULL || inf->aspace == NULL)
- internal_error (__FILE__, __LINE__, "\
-Can't determine the current address space of thread %s\n",
+ internal_error (__FILE__, __LINE__,
+ _("Can't determine the current "
+ "address space of thread %s\n"),
target_pid_to_str (ptid));
return inf->aspace;
dummy_target.to_has_memory = (int (*) (struct target_ops *)) return_zero;
dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero;
dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero;
- dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero;
+ dummy_target.to_has_execution
+ = (int (*) (struct target_ops *, ptid_t)) return_zero;
dummy_target.to_stopped_by_watchpoint = return_zero;
dummy_target.to_stopped_data_address =
(int (*) (struct target_ops *, CORE_ADDR *)) return_zero;
}
internal_error (__FILE__, __LINE__,
- "could not find a target to attach");
+ _("could not find a target to attach"));
}
int
int retval = t->to_core_of_thread (t, ptid);
if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_core_of_thread (%d) = %d\n",
+ fprintf_unfiltered (gdb_stdlog,
+ "target_core_of_thread (%d) = %d\n",
PIDGET (ptid), retval);
return retval;
}
int retval = t->to_verify_memory (t, data, memaddr, size);
if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_verify_memory (%s, %s) = %d\n",
+ fprintf_unfiltered (gdb_stdlog,
+ "target_verify_memory (%s, %s) = %d\n",
paddress (target_gdbarch, memaddr),
pulongest (size),
retval);
{
int retval;
- retval = debug_target.to_can_accel_watchpoint_condition (addr, len, rw, cond);
+ retval = debug_target.to_can_accel_watchpoint_condition (addr, len,
+ rw, cond);
fprintf_unfiltered (gdb_stdlog,
- "target_can_accel_watchpoint_condition (%s, %d, %d, %s) = %ld\n",
+ "target_can_accel_watchpoint_condition "
+ "(%s, %d, %d, %s) = %ld\n",
core_addr_to_string (addr), len, rw,
host_address_to_string (cond), (unsigned long) retval);
return retval;
PIDGET (ptid));
}
-static void
+static int
debug_to_insert_fork_catchpoint (int pid)
{
- debug_target.to_insert_fork_catchpoint (pid);
+ int retval;
+
+ retval = debug_target.to_insert_fork_catchpoint (pid);
+
+ fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d) = %d\n",
+ pid, retval);
- fprintf_unfiltered (gdb_stdlog, "target_insert_fork_catchpoint (%d)\n",
- pid);
+ return retval;
}
static int
return retval;
}
-static void
+static int
debug_to_insert_vfork_catchpoint (int pid)
{
- debug_target.to_insert_vfork_catchpoint (pid);
+ int retval;
- fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d)\n",
- pid);
+ retval = debug_target.to_insert_vfork_catchpoint (pid);
+
+ fprintf_unfiltered (gdb_stdlog, "target_insert_vfork_catchpoint (%d) = %d\n",
+ pid, retval);
+
+ return retval;
}
static int
return retval;
}
-static void
+static int
debug_to_insert_exec_catchpoint (int pid)
{
- debug_target.to_insert_exec_catchpoint (pid);
+ int retval;
+
+ retval = debug_target.to_insert_exec_catchpoint (pid);
- fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d)\n",
- pid);
+ fprintf_unfiltered (gdb_stdlog, "target_insert_exec_catchpoint (%d) = %d\n",
+ pid, retval);
+
+ return retval;
}
static int
retval = debug_target.to_thread_architecture (ops, ptid);
- fprintf_unfiltered (gdb_stdlog, "target_thread_architecture (%s) = %s [%s]\n",
- target_pid_to_str (ptid), host_address_to_string (retval),
+ fprintf_unfiltered (gdb_stdlog,
+ "target_thread_architecture (%s) = %s [%s]\n",
+ target_pid_to_str (ptid),
+ host_address_to_string (retval),
gdbarch_bfd_arch_info (retval)->printable_name);
return retval;
}
current_target.to_remove_watchpoint = debug_to_remove_watchpoint;
current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint;
current_target.to_stopped_data_address = debug_to_stopped_data_address;
- current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range;
- current_target.to_region_ok_for_hw_watchpoint = debug_to_region_ok_for_hw_watchpoint;
- current_target.to_can_accel_watchpoint_condition = debug_to_can_accel_watchpoint_condition;
+ current_target.to_watchpoint_addr_within_range
+ = debug_to_watchpoint_addr_within_range;
+ current_target.to_region_ok_for_hw_watchpoint
+ = debug_to_region_ok_for_hw_watchpoint;
+ current_target.to_can_accel_watchpoint_condition
+ = debug_to_can_accel_watchpoint_condition;
current_target.to_terminal_init = debug_to_terminal_init;
current_target.to_terminal_inferior = debug_to_terminal_inferior;
- current_target.to_terminal_ours_for_output = debug_to_terminal_ours_for_output;
+ current_target.to_terminal_ours_for_output
+ = debug_to_terminal_ours_for_output;
current_target.to_terminal_ours = debug_to_terminal_ours;
current_target.to_terminal_save_ours = debug_to_terminal_save_ours;
current_target.to_terminal_info = debug_to_terminal_info;
\f
static char targ_desc[] =
-"Names of targets and files being debugged.\n\
-Shows the entire stack of targets currently in use (including the exec-file,\n\
+"Names of targets and files being debugged.\nShows the entire \
+stack of targets currently in use (including the exec-file,\n\
core-file, and process, if any), as well as the symbol file name.";
static void
struct cmd_list_element *c,
const char *value)
{
- fprintf_filtered (file, _("\
-Controlling the inferior in asynchronous mode is %s.\n"), value);
+ fprintf_filtered (file,
+ _("Controlling the inferior in "
+ "asynchronous mode is %s.\n"), value);
}
/* Temporary copies of permission settings. */