/* 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, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1990-2012 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
TARGET_OBJECT_AVAILABLE_FEATURES,
/* Currently loaded libraries, in XML format. */
TARGET_OBJECT_LIBRARIES,
+ /* Currently loaded libraries specific for SVR4 systems, in XML format. */
+ TARGET_OBJECT_LIBRARIES_SVR4,
/* Get OS specific data. The ANNEX specifies the type (running
processes, etc.). The data being transfered is expected to follow
the DTD specified in features/osdata.dtd. */
/* Load maps for FDPIC systems. */
TARGET_OBJECT_FDPIC,
/* Darwin dynamic linker info data. */
- TARGET_OBJECT_DARWIN_DYLD_INFO
+ TARGET_OBJECT_DARWIN_DYLD_INFO,
+ /* OpenVMS Unwind Information Block. */
+ TARGET_OBJECT_OPENVMS_UIB
/* Possible future objects: TARGET_OBJECT_FILE, ... */
};
/* Does this target support the tracenz bytecode for string collection? */
int (*to_supports_string_tracing) (void);
+ /* Does this target support evaluation of breakpoint conditions on its
+ end? */
+ int (*to_supports_evaluation_of_breakpoint_conditions) (void);
+
/* Determine current architecture of thread PTID.
The target is supposed to determine the architecture of the code where
struct address_space *(*to_thread_address_space) (struct target_ops *,
ptid_t);
+ /* Target file operations. */
+
+ /* Open FILENAME on the target, using FLAGS and MODE. Return a
+ target file descriptor, or -1 if an error occurs (and set
+ *TARGET_ERRNO). */
+ int (*to_fileio_open) (const char *filename, int flags, int mode,
+ int *target_errno);
+
+ /* Write up to LEN bytes from WRITE_BUF to FD on the target.
+ Return the number of bytes written, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+ int (*to_fileio_pwrite) (int fd, const gdb_byte *write_buf, int len,
+ ULONGEST offset, int *target_errno);
+
+ /* Read up to LEN bytes FD on the target into READ_BUF.
+ Return the number of bytes read, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+ int (*to_fileio_pread) (int fd, gdb_byte *read_buf, int len,
+ ULONGEST offset, int *target_errno);
+
+ /* Close FD on the target. Return 0, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+ int (*to_fileio_close) (int fd, int *target_errno);
+
+ /* Unlink FILENAME on the target. Return 0, or -1 if an error
+ occurs (and set *TARGET_ERRNO). */
+ int (*to_fileio_unlink) (const char *filename, int *target_errno);
+
+ /* Read value of symbolic link FILENAME on the target. Return a
+ null-terminated string allocated via xmalloc, or NULL if an error
+ occurs (and set *TARGET_ERRNO). */
+ char *(*to_fileio_readlink) (const char *filename, int *target_errno);
+
+
+ /* Implement the "info proc" command. */
+ void (*to_info_proc) (struct target_ops *, char *, enum info_proc_what);
+
/* Tracepoint-related operations. */
/* Prepare the target for a tracing run. */
/* Send full details of a tracepoint location to the target. */
void (*to_download_tracepoint) (struct bp_location *location);
+ /* Is the target able to download tracepoint locations in current
+ state? */
+ int (*to_can_download_tracepoint) (void);
+
/* Send full details of a trace state variable to the target. */
void (*to_download_trace_state_variable) (struct trace_state_variable *tsv);
/* Get the current status of a tracing run. */
int (*to_get_trace_status) (struct trace_status *ts);
+ void (*to_get_tracepoint_status) (struct breakpoint *tp,
+ struct uploaded_tp *utp);
+
/* Stop a trace run. */
void (*to_trace_stop) (void);
LONGEST (*to_get_raw_trace_data) (gdb_byte *buf,
ULONGEST offset, LONGEST len);
+ /* Get the minimum length of instruction on which a fast tracepoint
+ may be set on the target. If this operation is unsupported,
+ return -1. If for some reason the minimum length cannot be
+ determined, return 0. */
+ int (*to_get_min_fast_tracepoint_insn_len) (void);
+
/* Set the target's tracing behavior in response to unexpected
disconnection - set VAL to 1 to keep tracing, 0 to stop. */
void (*to_set_disconnected_tracing) (int val);
void (*to_set_circular_trace_buffer) (int val);
+ /* Add/change textual notes about the trace run, returning 1 if
+ successful, 0 otherwise. */
+ int (*to_set_trace_notes) (char *user, char *notes, char* stopnotes);
+
/* Return the processor core that thread PTID was last seen on.
This information is updated only when:
- update_thread_list is called
re-fetching when necessary. */
struct traceframe_info *(*to_traceframe_info) (void);
+ /* Ask the target to use or not to use agent according to USE. Return 1
+ successful, 0 otherwise. */
+ int (*to_use_agent) (int use);
+
+ /* Is the target able to use agent in current state? */
+ int (*to_can_use_agent) (void);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
longer going to be calling. QUITTING indicates that GDB is exiting
and should not get hung on an error (otherwise it is important to
perform clean termination, even if it takes a while). This routine
- is automatically always called when popping the target off the
- target stack (to_beneath is undefined). Closing file descriptors
- and freeing all memory allocated memory are typical things it
- should do. */
+ is automatically always called after popping the target off the
+ target stack - the target's own methods are no longer available
+ through the target vector. Closing file descriptors and freeing all
+ memory allocated memory are typical things it should do. */
void target_close (struct target_ops *targ, int quitting);
struct address_space *target_thread_address_space (ptid_t);
+/* Implement the "info proc" command. */
+
+void target_info_proc (char *, enum info_proc_what);
+
/* Returns true if this target can debug multiple processes
simultaneously. */
#define target_supports_string_tracing() \
(*current_target.to_supports_string_tracing) ()
+/* 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) ()
+
/* Invalidate all target dcaches. */
extern void target_dcache_invalidate (void);
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
int len);
+extern int target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
+ int len);
+
/* Fetches the target's memory map. If one is found it is sorted
and returned, after some consistency checking. Otherwise, NULL
is returned. */
#define target_stopped_data_address(target, addr_p) \
(*target.to_stopped_data_address) (target, addr_p)
+/* Return non-zero if ADDR is within the range of a watchpoint spanning
+ LENGTH bytes beginning at START. */
#define target_watchpoint_addr_within_range(target, addr, start, length) \
(*target.to_watchpoint_addr_within_range) (target, addr, start, length)
ULONGEST pattern_len,
CORE_ADDR *found_addrp);
+/* Target file operations. */
+
+/* Open FILENAME on the target, using FLAGS and MODE. Return a
+ target file descriptor, or -1 if an error occurs (and set
+ *TARGET_ERRNO). */
+extern int target_fileio_open (const char *filename, int flags, int mode,
+ int *target_errno);
+
+/* Write up to LEN bytes from WRITE_BUF to FD on the target.
+ Return the number of bytes written, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+extern int target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
+ ULONGEST offset, int *target_errno);
+
+/* Read up to LEN bytes FD on the target into READ_BUF.
+ Return the number of bytes read, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+extern int target_fileio_pread (int fd, gdb_byte *read_buf, int len,
+ ULONGEST offset, int *target_errno);
+
+/* Close FD on the target. Return 0, or -1 if an error occurs
+ (and set *TARGET_ERRNO). */
+extern int target_fileio_close (int fd, int *target_errno);
+
+/* Unlink FILENAME on the target. Return 0, or -1 if an error
+ occurs (and set *TARGET_ERRNO). */
+extern int target_fileio_unlink (const char *filename, int *target_errno);
+
+/* Read value of symbolic link FILENAME on the target. Return a
+ null-terminated string allocated via xmalloc, or NULL if an error
+ occurs (and set *TARGET_ERRNO). */
+extern char *target_fileio_readlink (const char *filename, int *target_errno);
+
+/* Read target file FILENAME. The return value will be -1 if the transfer
+ fails or is not supported; 0 if the object is empty; or the length
+ of the object otherwise. If a positive value is returned, a
+ sufficiently large buffer will be allocated using xmalloc and
+ returned in *BUF_P containing the contents of the object.
+
+ This method should be used for objects sufficiently small to store
+ in a single xmalloc'd buffer, when no fixed bound on the object's
+ size is known in advance. */
+extern LONGEST target_fileio_read_alloc (const char *filename,
+ gdb_byte **buf_p);
+
+/* Read target file FILENAME. The result is NUL-terminated and
+ returned as a string, allocated using xmalloc. If an error occurs
+ or the transfer is unsupported, NULL is returned. Empty objects
+ are returned as allocated but empty strings. A warning is issued
+ if the result contains any embedded NUL bytes. */
+extern char *target_fileio_read_stralloc (const char *filename);
+
+
/* Tracepoint-related operations. */
#define target_trace_init() \
#define target_download_tracepoint(t) \
(*current_target.to_download_tracepoint) (t)
+#define target_can_download_tracepoint() \
+ (*current_target.to_can_download_tracepoint) ()
+
#define target_download_trace_state_variable(tsv) \
(*current_target.to_download_trace_state_variable) (tsv)
#define target_get_trace_status(ts) \
(*current_target.to_get_trace_status) (ts)
+#define target_get_tracepoint_status(tp,utp) \
+ (*current_target.to_get_tracepoint_status) (tp, utp)
+
#define target_trace_stop() \
(*current_target.to_trace_stop) ()
#define target_get_raw_trace_data(buf,offset,len) \
(*current_target.to_get_raw_trace_data) ((buf), (offset), (len))
+#define target_get_min_fast_tracepoint_insn_len() \
+ (*current_target.to_get_min_fast_tracepoint_insn_len) ()
+
#define target_set_disconnected_tracing(val) \
(*current_target.to_set_disconnected_tracing) (val)
#define target_set_circular_trace_buffer(val) \
(*current_target.to_set_circular_trace_buffer) (val)
+#define target_set_trace_notes(user,notes,stopnotes) \
+ (*current_target.to_set_trace_notes) ((user), (notes), (stopnotes))
+
#define target_get_tib_address(ptid, addr) \
(*current_target.to_get_tib_address) ((ptid), (addr))
#define target_traceframe_info() \
(*current_target.to_traceframe_info) ()
+#define target_use_agent(use) \
+ (*current_target.to_use_agent) (use)
+
+#define target_can_use_agent() \
+ (*current_target.to_can_use_agent) ()
+
/* Command logging facility. */
#define target_log_command(p) \
/* This is for native targets which use a unix/POSIX-style waitstatus. */
extern void store_waitstatus (struct target_waitstatus *, int);
-/* These are in common/signals.c, but they're only used by gdb. */
-extern enum target_signal default_target_signal_from_host (struct gdbarch *,
- int);
-extern int default_target_signal_to_host (struct gdbarch *,
- enum target_signal);
-
-/* Convert from a number used in a GDB command to an enum target_signal. */
-extern enum target_signal target_signal_from_command (int);
-/* End of files in common/signals.c. */
-
/* Set the show memory breakpoints mode to show, and installs a cleanup
to restore it back to the current value. */
extern struct cleanup *make_show_memory_breakpoints_cleanup (int show);