int (*attach) (unsigned long pid);
- /* Kill inferior PID. Return -1 on failure, and 0 on success. */
+ /* Kill process PROC. Return -1 on failure, and 0 on success. */
- int (*kill) (int pid);
+ int (*kill) (process_info *proc);
- /* Detach from inferior PID. Return -1 on failure, and 0 on
+ /* Detach from process PROC. Return -1 on failure, and 0 on
success. */
- int (*detach) (int pid);
+ int (*detach) (process_info *proc);
/* The inferior process has died. Do what is right. */
void (*mourn) (struct process_info *proc);
- /* Wait for inferior PID to exit. */
- void (*join) (int pid);
+ /* Wait for process PROC to exit. */
+
+ void (*join) (process_info *proc);
/* Return 1 iff the thread with process ID PID is alive. */
/* Return true if target supports debugging agent. */
int (*supports_agent) (void);
- /* Check whether the target supports branch tracing. */
- int (*supports_btrace) (struct target_ops *, enum btrace_format);
-
/* Enable branch tracing for PTID based on CONF and allocate a branch trace
target information struct for reading and for disabling branch trace. */
struct btrace_target_info *(*enable_btrace)
#define myattach(pid) \
(*the_target->attach) (pid)
-int kill_inferior (int);
+int kill_inferior (process_info *proc);
#define target_supports_fork_events() \
(the_target->supports_fork_events ? \
(*the_target->handle_new_gdb_connection) (); \
} while (0)
-#define detach_inferior(pid) \
- (*the_target->detach) (pid)
+#define detach_inferior(proc) \
+ (*the_target->detach) (proc)
#define mythread_alive(pid) \
(*the_target->thread_alive) (pid)
#define store_inferior_registers(regcache, regno) \
(*the_target->store_registers) (regcache, regno)
-#define join_inferior(pid) \
- (*the_target->join) (pid)
+#define join_inferior(proc) \
+ (*the_target->join) (proc)
#define target_supports_non_stop() \
(the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0)
(the_target->supports_agent ? \
(*the_target->supports_agent) () : 0)
-#define target_supports_btrace(format) \
- (the_target->supports_btrace \
- ? (*the_target->supports_btrace) (the_target, format) : 0)
+static inline struct btrace_target_info *
+target_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
+{
+ if (the_target->enable_btrace == nullptr)
+ error (_("Target does not support branch tracing."));
-#define target_enable_btrace(ptid, conf) \
- (*the_target->enable_btrace) (ptid, conf)
+ return (*the_target->enable_btrace) (ptid, conf);
+}
+
+static inline int
+target_disable_btrace (struct btrace_target_info *tinfo)
+{
+ if (the_target->disable_btrace == nullptr)
+ error (_("Target does not support branch tracing."));
-#define target_disable_btrace(tinfo) \
- (*the_target->disable_btrace) (tinfo)
+ return (*the_target->disable_btrace) (tinfo);
+}
-#define target_read_btrace(tinfo, buffer, type) \
- (*the_target->read_btrace) (tinfo, buffer, type)
+static inline int
+target_read_btrace (struct btrace_target_info *tinfo,
+ struct buffer *buffer,
+ enum btrace_read_type type)
+{
+ if (the_target->read_btrace == nullptr)
+ error (_("Target does not support branch tracing."));
+
+ return (*the_target->read_btrace) (tinfo, buffer, type);
+}
+
+static inline int
+target_read_btrace_conf (struct btrace_target_info *tinfo,
+ struct buffer *buffer)
+{
+ if (the_target->read_btrace_conf == nullptr)
+ error (_("Target does not support branch tracing."));
-#define target_read_btrace_conf(tinfo, buffer) \
- (*the_target->read_btrace_conf) (tinfo, buffer)
+ return (*the_target->read_btrace_conf) (tinfo, buffer);
+}
#define target_supports_range_stepping() \
(the_target->supports_range_stepping ? \