/* Interface between GDB and target environments, including files and processes
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. Written by John Gilmore.
struct uploaded_tsv;
struct uploaded_tp;
struct static_tracepoint_marker;
-
+struct traceframe_info;
struct expression;
/* This include file defines the interface between the main part
{
dummy_stratum, /* The lowest of the low */
file_stratum, /* Executable files, etc */
- core_stratum, /* Core dump files */
- process_stratum, /* Executing processes */
+ process_stratum, /* Executing processes or core dump files */
thread_stratum, /* Executing threads */
record_stratum, /* Support record debugging */
arch_stratum /* Architecture overrides */
/* The program has entered or returned from a system call. On
HP-UX, this is used in the hardware watchpoint implementation.
- The syscall's unique integer ID number is in value.syscall_id */
+ The syscall's unique integer ID number is in value.syscall_id. */
TARGET_WAITKIND_SYSCALL_ENTRY,
TARGET_WAITKIND_SYSCALL_RETURN,
/* An event has occured, but we should wait again.
Remote_async_wait() returns this when there is an event
on the inferior, but the rest of the world is not interested in
- it. The inferior has not stopped, but has just sent some output
- to the console, for instance. In this case, we want to go back
+ it. The inferior has not stopped, but has just sent some output
+ to the console, for instance. In this case, we want to go back
to the event loop and wait there for another event from the
inferior, rather than being stuck in the remote_async_wait()
- function. This way the event loop is responsive to other events,
+ function. sThis way the event loop is responsive to other events,
like for instance the user typing. */
TARGET_WAITKIND_IGNORE,
INF_EXEC_COMPLETE,
/* We are called to do some stuff after the inferior stops, but we
are expected to reenter the proceed() and
- handle_inferior_event() functions. This is used only in case of
+ handle_inferior_event() functions. This is used only in case of
'step n' like commands. */
INF_EXEC_CONTINUE
};
/* Currently loaded libraries, in XML format. */
TARGET_OBJECT_LIBRARIES,
/* Get OS specific data. The ANNEX specifies the type (running
- processes, etc.). */
+ processes, etc.). The data being transfered is expected to follow
+ the DTD specified in features/osdata.dtd. */
TARGET_OBJECT_OSDATA,
/* Extra signal info. Usually the contents of `siginfo_t' on unix
platforms. */
TARGET_OBJECT_THREADS,
/* Collected static trace data. */
TARGET_OBJECT_STATIC_TRACE_DATA,
- /* Possible future objects: TARGET_OBJECT_FILE, ... */
+ /* The HP-UX registers (those that can be obtained or modified by using
+ the TT_LWP_RUREGS/TT_LWP_WUREGS ttrace requests). */
+ TARGET_OBJECT_HPUX_UREGS,
+ /* The HP-UX shared library linkage pointer. ANNEX should be a string
+ image of the code address whose linkage pointer we are looking for.
+
+ The size of the data transfered is always 8 bytes (the size of an
+ address on ia64). */
+ TARGET_OBJECT_HPUX_SOLIB_GOT,
+ /* Traceframe info, in XML format. */
+ TARGET_OBJECT_TRACEFRAME_INFO,
+ /* Possible future objects: TARGET_OBJECT_FILE, ... */
};
/* Enumeration of the kinds of traceframe searches that a target may
const char *annex, gdb_byte *buf,
ULONGEST offset, LONGEST len);
-extern LONGEST target_read_until_error (struct target_ops *ops,
- enum target_object object,
- const char *annex, gdb_byte *buf,
- ULONGEST offset, LONGEST len);
+struct memory_read_result
+ {
+ /* First address that was read. */
+ ULONGEST begin;
+ /* Past-the-end address. */
+ ULONGEST end;
+ /* The data. */
+ gdb_byte *data;
+};
+typedef struct memory_read_result memory_read_result_s;
+DEF_VEC_O(memory_read_result_s);
+
+extern void free_memory_read_result_vector (void *);
+
+extern VEC(memory_read_result_s)* read_memory_robust (struct target_ops *ops,
+ ULONGEST offset,
+ LONGEST len);
extern LONGEST target_write (struct target_ops *ops,
enum target_object object,
int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *);
int (*to_watchpoint_addr_within_range) (struct target_ops *,
CORE_ADDR, CORE_ADDR, int);
+
+ /* Documentation of this routine is provided with the corresponding
+ target_* macro. */
int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int);
+
int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int,
struct expression *);
void (*to_terminal_init) (void);
void (*to_create_inferior) (struct target_ops *,
char *, char *, char **, int);
void (*to_post_startup_inferior) (ptid_t);
- void (*to_acknowledge_created_inferior) (int);
- void (*to_insert_fork_catchpoint) (int);
+ int (*to_insert_fork_catchpoint) (int);
int (*to_remove_fork_catchpoint) (int);
- void (*to_insert_vfork_catchpoint) (int);
+ int (*to_insert_vfork_catchpoint) (int);
int (*to_remove_vfork_catchpoint) (int);
int (*to_follow_fork) (struct target_ops *, int);
- void (*to_insert_exec_catchpoint) (int);
+ int (*to_insert_exec_catchpoint) (int);
int (*to_remove_exec_catchpoint) (int);
int (*to_set_syscall_catchpoint) (int, int, int, int, int *);
int (*to_has_exited) (int, int, int *);
void (*to_find_new_threads) (struct target_ops *);
char *(*to_pid_to_str) (struct target_ops *, ptid_t);
char *(*to_extra_thread_info) (struct thread_info *);
+ char *(*to_thread_name) (struct thread_info *);
void (*to_stop) (ptid_t);
void (*to_rcmd) (char *command, struct ui_file *output);
char *(*to_pid_to_exec_file) (int pid);
int (*to_has_memory) (struct target_ops *);
int (*to_has_stack) (struct target_ops *);
int (*to_has_registers) (struct target_ops *);
- int (*to_has_execution) (struct target_ops *);
+ int (*to_has_execution) (struct target_ops *, ptid_t);
int to_has_thread_control; /* control thread execution */
int to_attach_no_wait;
/* ASYNC target controls */
int (*to_async_mask) (int);
int (*to_supports_non_stop) (void);
/* find_memory_regions support method for gcore */
- int (*to_find_memory_regions) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *);
+ int (*to_find_memory_regions) (find_memory_region_ftype func, void *data);
/* make_corefile_notes support method for gcore */
char * (*to_make_corefile_notes) (bfd *, int *);
/* get_bookmark support method for bookmarks */
RAM. The returned memory regions should not overlap.
The order of regions does not matter; target_memory_map will
- sort regions by starting address. For that reason, this
+ sort regions by starting address. For that reason, this
function should not be called directly except via
target_memory_map.
/* Ask the target to find a trace frame of the given type TYPE,
using NUM, ADDR1, and ADDR2 as search parameters. Returns the
number of the trace frame, and also the tracepoint number at
- TPP. If no trace frame matches, return -1. May throw if the
+ TPP. If no trace frame matches, return -1. May throw if the
operation fails. */
int (*to_trace_find) (enum trace_find_type type, int num,
ULONGEST addr1, ULONGEST addr2, int *tpp);
This information is updated only when:
- update_thread_list is called
- thread stops
- If the core cannot be determined -- either for the specified thread, or
- right now, or in this debug session, or for this target -- return -1. */
+ If the core cannot be determined -- either for the specified
+ thread, or right now, or in this debug session, or for this
+ target -- return -1. */
int (*to_core_of_thread) (struct target_ops *, ptid_t ptid);
/* Verify that the memory in the [MEMADDR, MEMADDR+SIZE) range
VEC(static_tracepoint_marker_p) *(*to_static_tracepoint_markers_by_strid)
(const char *id);
+ /* Return a traceframe info object describing the current
+ traceframe's contents. This method should not cache data;
+ higher layers take care of caching, invalidating, and
+ re-fetching when necessary. */
+ struct traceframe_info *(*to_traceframe_info) (void);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
/* Describes a request for a memory write operation. */
struct memory_write_request
{
- /* Begining address that must be written. */
+ /* Begining address that must be written. */
ULONGEST begin;
- /* Past-the-end address. */
+ /* Past-the-end address. */
ULONGEST end;
- /* The data to write. */
+ /* The data to write. */
gdb_byte *data;
/* A callback baton for progress reporting for this request. */
void *baton;
#define target_post_startup_inferior(ptid) \
(*current_target.to_post_startup_inferior) (ptid)
-/* On some targets, the sequence of starting up an inferior requires
- some synchronization between gdb and the new inferior process, PID. */
-
-#define target_acknowledge_created_inferior(pid) \
- (*current_target.to_acknowledge_created_inferior) (pid)
-
/* On some targets, we can catch an inferior fork or vfork event when
it occurs. These functions insert/remove an already-created
- catchpoint for such events. */
+ catchpoint for such events. They return 0 for success, 1 if the
+ catchpoint type is not supported and -1 for failure. */
#define target_insert_fork_catchpoint(pid) \
(*current_target.to_insert_fork_catchpoint) (pid)
/* On some targets, we can catch an inferior exec event when it
occurs. These functions insert/remove an already-created
- catchpoint for such events. */
+ catchpoint for such events. They return 0 for success, 1 if the
+ catchpoint type is not supported and -1 for failure. */
#define target_insert_exec_catchpoint(pid) \
(*current_target.to_insert_exec_catchpoint) (pid)
TABLE is an array of ints, indexed by syscall number. An element in
this array is nonzero if that syscall should be caught. This argument
- only matters if ANY_COUNT is zero. */
+ only matters if ANY_COUNT is zero.
+
+ Return 0 for success, 1 if syscall catchpoints are not supported or -1
+ for failure. */
#define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table) \
(*current_target.to_set_syscall_catchpoint) (pid, needed, any_count, \
case this will become true after target_create_inferior or
target_attach. */
-extern int target_has_execution_1 (void);
-#define target_has_execution target_has_execution_1 ()
+extern int target_has_execution_1 (ptid_t);
+
+/* Like target_has_execution_1, but always passes inferior_ptid. */
+
+extern int target_has_execution_current (void);
+
+#define target_has_execution target_has_execution_current ()
/* Default implementations for process_stratum targets. Return true
if there's a selected inferior, false otherwise. */
extern int default_child_has_memory (struct target_ops *ops);
extern int default_child_has_stack (struct target_ops *ops);
extern int default_child_has_registers (struct target_ops *ops);
-extern int default_child_has_execution (struct target_ops *ops);
+extern int default_child_has_execution (struct target_ops *ops,
+ ptid_t the_ptid);
/* Can the target support the debugger control of thread execution?
Can it lock the thread scheduler? */
cludge until async mode is a strict superset of sync mode. */
extern int target_async_permitted;
-/* Can the target support asynchronous execution? */
+/* Can the target support asynchronous execution? */
#define target_can_async_p() (current_target.to_can_async_p ())
-/* Is the target in asynchronous execution mode? */
+/* Is the target in asynchronous execution mode? */
#define target_is_async_p() (current_target.to_is_async_p ())
int target_supports_non_stop (void);
-/* Put the target in async mode with the specified callback function. */
+/* Put the target in async mode with the specified callback function. */
#define target_async(CALLBACK,CONTEXT) \
(current_target.to_async ((CALLBACK), (CONTEXT)))
-/* This is to be used ONLY within call_function_by_hand(). It provides
+/* This is to be used ONLY within call_function_by_hand(). It provides
a workaround, to have inferior function calls done in sychronous
- mode, even though the target is asynchronous. After
+ mode, even though the target is asynchronous. After
target_async_mask(0) is called, calls to target_can_async_p() will
return FALSE , so that target_resume() will not try to start the
- target asynchronously. After the inferior stops, we IMMEDIATELY
+ target asynchronously. After the inferior stops, we IMMEDIATELY
restore the previous nature of the target, by calling
- target_async_mask(1). After that, target_can_async_p() will return
- TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
+ target_async_mask(1). After that, target_can_async_p() will return
+ TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
FIXME ezannoni 1999-12-13: we won't need this once we move
the turning async on and off to the single execution commands,
#define target_extra_thread_info(TP) \
(current_target.to_extra_thread_info (TP))
+/* Return the thread's name. A NULL result means that the target
+ could not determine this thread's name. */
+
+extern char *target_thread_name (struct thread_info *);
+
/* Attempts to find the pathname of the executable file
that was run to create a specified process.
#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
(*current_target.to_can_use_hw_breakpoint) (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) (addr, len)
#define target_static_tracepoint_markers_by_strid(marker_id) \
(*current_target.to_static_tracepoint_markers_by_strid) (marker_id)
+#define target_traceframe_info() \
+ (*current_target.to_traceframe_info) ()
+
/* Command logging facility. */
#define target_log_command(p) \
strictly above ABOVE_STRATUM. */
extern void pop_all_targets_above (enum strata above_stratum, int quitting);
+extern int target_is_pushed (struct target_ops *t);
+
extern CORE_ADDR target_translate_tls_address (struct objfile *objfile,
CORE_ADDR offset);
/* From mem-break.c */
-extern int memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int memory_remove_breakpoint (struct gdbarch *,
+ struct bp_target_info *);
-extern int memory_insert_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int memory_insert_breakpoint (struct gdbarch *,
+ struct bp_target_info *);
-extern int default_memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int default_memory_remove_breakpoint (struct gdbarch *,
+ struct bp_target_info *);
-extern int default_memory_insert_breakpoint (struct gdbarch *, struct bp_target_info *);
+extern int default_memory_insert_breakpoint (struct gdbarch *,
+ struct bp_target_info *);
/* From target.c */
extern struct target_ops *find_run_target (void);
-extern struct target_ops *find_core_target (void);
-
extern struct target_ops *find_target_beneath (struct target_ops *);
/* Read OS data object of type TYPE from the target, and return it in
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
-/* Timeout limit for response from target. */
+/* Timeout limit for response from target. */
extern int remote_timeout;
\f
extern void update_target_permissions (void);
\f
-/* Imported from machine dependent code */
+/* Imported from machine dependent code. */
-/* Blank target vector entries are initialized to target_ignore. */
+/* Blank target vector entries are initialized to target_ignore. */
void target_ignore (void);
-extern struct target_ops deprecated_child_ops;
-
#endif /* !defined (TARGET_H) */