#include "solib.h"
#include "exec.h"
#include "inline-frame.h"
+#include "tracepoint.h"
static void target_info (char *, int);
-static void kill_or_be_killed (int);
-
static void default_terminal_info (char *, int);
static int default_watchpoint_addr_within_range (struct target_ops *,
static int nosymbol (char *, CORE_ADDR *);
-static void tcomplain (void) ATTR_NORETURN;
+static void tcomplain (void) ATTRIBUTE_NORETURN;
static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
static struct target_ops *find_default_run_target (char *);
-static void nosupport_runtime (void);
-
static LONGEST default_xfer_partial (struct target_ops *ops,
enum target_object object,
const char *annex, gdb_byte *readbuf,
return 1; /* Symbol does not exist in target env */
}
-static void
-nosupport_runtime (void)
-{
- if (ptid_equal (inferior_ptid, null_ptid))
- noprocess ();
- else
- error (_("No run-time support for this"));
-}
-
-
static void
default_terminal_info (char *args, int from_tty)
{
printf_unfiltered (_("No saved terminal information.\n"));
}
-/* This is the default target_create_inferior and target_attach function.
- If the current target is executing, it asks whether to kill it off.
- If this function returns without calling error(), it has killed off
- the target, and the operation should be attempted. */
-
-static void
-kill_or_be_killed (int from_tty)
-{
- if (target_has_execution)
- {
- printf_unfiltered (_("You are already running a program:\n"));
- target_files_info ();
- if (query (_("Kill it? ")))
- {
- target_kill ();
- if (target_has_execution)
- error (_("Killing the program did not help."));
- return;
- }
- else
- {
- error (_("Program not killed."));
- }
- }
- tcomplain ();
-}
-
/* A default implementation for the to_get_ada_task_ptid target method.
This function builds the PTID by using both LWP and TID as part of
INHERIT (to_trace_stop, t);
INHERIT (to_trace_find, t);
INHERIT (to_get_trace_state_variable_value, t);
+ INHERIT (to_save_trace_data, t);
+ INHERIT (to_upload_tracepoints, t);
+ INHERIT (to_upload_trace_state_variables, t);
+ INHERIT (to_get_raw_trace_data, t);
INHERIT (to_set_disconnected_tracing, t);
+ INHERIT (to_set_circular_trace_buffer, t);
+ INHERIT (to_get_tib_address, t);
INHERIT (to_magic, t);
/* Do not inherit to_memory_map. */
/* Do not inherit to_flash_erase. */
(void (*) (void))
tcomplain);
de_fault (to_get_trace_status,
- (int (*) (int *))
+ (int (*) (struct trace_status *))
return_minus_one);
de_fault (to_trace_stop,
(void (*) (void))
tcomplain);
de_fault (to_trace_find,
(int (*) (enum trace_find_type, int, ULONGEST, ULONGEST, int *))
- return_zero);
+ return_minus_one);
de_fault (to_get_trace_state_variable_value,
(int (*) (int, LONGEST *))
return_zero);
+ de_fault (to_save_trace_data,
+ (int (*) (const char *))
+ tcomplain);
+ de_fault (to_upload_tracepoints,
+ (int (*) (struct uploaded_tp **))
+ return_zero);
+ de_fault (to_upload_trace_state_variables,
+ (int (*) (struct uploaded_tsv **))
+ return_zero);
+ de_fault (to_get_raw_trace_data,
+ (LONGEST (*) (gdb_byte *, ULONGEST, LONGEST))
+ tcomplain);
de_fault (to_set_disconnected_tracing,
(void (*) (int))
+ target_ignore);
+ de_fault (to_set_circular_trace_buffer,
+ (void (*) (int))
+ target_ignore);
+ de_fault (to_get_tib_address,
+ (int (*) (ptid_t, CORE_ADDR *))
tcomplain);
#undef de_fault
inf = NULL;
if (inf != NULL
+ /* The dcache reads whole cache lines; that doesn't play well
+ with reading from a trace buffer, because reading outside of
+ the collected memory range fails. */
+ && get_traceframe_number () == -1
&& (region->attrib.cache
|| (stack_cache_enabled_p && object == TARGET_OBJECT_STACK_MEMORY)))
{
them before detaching. */
remove_breakpoints_pid (PIDGET (inferior_ptid));
+ prepare_for_detach ();
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
{
if (t->to_detach != NULL)
step ? "step" : "continue",
target_signal_to_name (signal));
+ registers_changed_ptid (ptid);
set_executing (ptid, 1);
set_running (ptid, 1);
clear_inline_frame_state (ptid);
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_stopped_by_watchpoint = return_zero;
+ dummy_target.to_stopped_data_address =
+ (int (*) (struct target_ops *, CORE_ADDR *)) return_zero;
dummy_target.to_magic = OPS_MAGIC;
}
\f
return -1;
}
+int
+target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_verify_memory != NULL)
+ {
+ int retval = t->to_verify_memory (t, data, memaddr, size);
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_verify_memory (%s, %s) = %d\n",
+ paddress (target_gdbarch, memaddr),
+ pulongest (size),
+ retval);
+ return retval;
+ }
+ }
+
+ tcomplain ();
+}
+
static void
debug_to_prepare_to_store (struct regcache *regcache)
{