/* 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
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
value;
};
+/* Return a pretty printed form of target_waitstatus.
+ Space for the result is malloc'd, caller must free. */
+extern char *target_waitstatus_to_string (const struct target_waitstatus *);
+
/* Possible types of events that the inferior handler will have to
deal with. */
enum inferior_event_type
};
/* Return the string for a signal. */
-extern char *target_signal_to_string (enum target_signal);
+extern const char *target_signal_to_string (enum target_signal);
/* Return the name (SIGHUP, etc.) for a signal. */
-extern char *target_signal_to_name (enum target_signal);
+extern const char *target_signal_to_name (enum target_signal);
/* Given a name (SIGHUP, etc.), return its signal. */
-enum target_signal target_signal_from_name (char *);
+enum target_signal target_signal_from_name (const char *);
\f
/* Target objects which can be transfered using target_read,
target_write, et cetera. */
TARGET_OBJECT_LIBRARIES,
/* Get OS specific data. The ANNEX specifies the type (running
processes, etc.). */
- TARGET_OBJECT_OSDATA
+ TARGET_OBJECT_OSDATA,
+ /* Extra signal info. Usually the contents of `siginfo_t' on unix
+ platforms. */
+ TARGET_OBJECT_SIGNAL_INFO,
/* Possible future objects: TARGET_OBJECT_FILE, ... */
};
extern ULONGEST get_target_memory_unsigned (struct target_ops *ops,
CORE_ADDR addr, int len);
\f
-
-/* If certain kinds of activity happen, target_wait should perform
- callbacks. */
-/* Right now we just call (*TARGET_ACTIVITY_FUNCTION) if I/O is possible
- on TARGET_ACTIVITY_FD. */
-extern int target_activity_fd;
-/* Returns zero to leave the inferior alone, one to interrupt it. */
-extern int (*target_activity_function) (void);
-\f
struct thread_info; /* fwd decl for parameter list below: */
struct target_ops
void (*to_detach) (struct target_ops *ops, char *, int);
void (*to_disconnect) (struct target_ops *, char *, int);
void (*to_resume) (ptid_t, int, enum target_signal);
- ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
+ ptid_t (*to_wait) (struct target_ops *,
+ ptid_t, struct target_waitstatus *);
void (*to_fetch_registers) (struct regcache *, int);
void (*to_store_registers) (struct regcache *, int);
void (*to_prepare_to_store) (struct regcache *);
void (*to_notice_signals) (ptid_t ptid);
int (*to_thread_alive) (ptid_t ptid);
void (*to_find_new_threads) (void);
- char *(*to_pid_to_str) (ptid_t);
+ char *(*to_pid_to_str) (struct target_ops *, ptid_t);
char *(*to_extra_thread_info) (struct thread_info *);
void (*to_stop) (ptid_t);
void (*to_rcmd) (char *command, struct ui_file *output);
or executable file given by OBJFILE. If that block of
thread-local storage hasn't been allocated yet, this function
may return an error. */
- CORE_ADDR (*to_get_thread_local_address) (ptid_t ptid,
+ CORE_ADDR (*to_get_thread_local_address) (struct target_ops *ops,
+ ptid_t ptid,
CORE_ADDR load_module_addr,
CORE_ADDR offset);
to the prompt with a debugging target but without the frame cache,
stop_pc, etc., set up. */
-#define target_wait(ptid, status) \
- (*current_target.to_wait) (ptid, status)
+extern ptid_t target_wait (ptid_t ptid, struct target_waitstatus *status);
/* Fetch at least register REGNO, or all regs if regno == -1. No result. */
`process xyz', but on some systems it may contain
`process xyz thread abc'. */
-#undef target_pid_to_str
-#define target_pid_to_str(PID) current_target.to_pid_to_str (PID)
+extern char *target_pid_to_str (ptid_t ptid);
-#ifndef target_tid_to_str
-#define target_tid_to_str(PID) \
- target_pid_to_str (PID)
extern char *normal_pid_to_str (ptid_t ptid);
-#endif
/* Return a short string describing extra information about PID,
e.g. "sleeping", "runnable", "running on LWP 3". Null return value
#define target_make_corefile_notes(BFD, SIZE_P) \
(current_target.to_make_corefile_notes) (BFD, SIZE_P)
-/* Thread-local values. */
-#define target_get_thread_local_address \
- (current_target.to_get_thread_local_address)
-#define target_get_thread_local_address_p() \
- (target_get_thread_local_address != NULL)
-
-
/* Hardware watchpoint interfaces. */
/* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
(*current_target.to_remove_hw_breakpoint) (bp_tgt)
#endif
-extern int target_stopped_data_address_p (struct target_ops *);
-
#ifndef target_stopped_data_address
#define target_stopped_data_address(target, x) \
(*target.to_stopped_data_address) (target, x)
-#else
-/* Horrible hack to get around existing macros :-(. */
-#define target_stopped_data_address_p(CURRENT_TARGET) (1)
#endif
#define target_watchpoint_addr_within_range(target, addr, start, length) \
extern void initialize_targets (void);
-extern void noprocess (void);
+extern NORETURN void noprocess (void) ATTR_NORETURN;
extern void target_require_runnable (void);
extern void remove_target_sections (bfd *abfd);
+/* Read OS data object of type TYPE from the target, and return it in
+ XML format. 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. */
+
extern char *target_get_osdata (const char *type);
\f