+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (update_current_target): Don't inherit or default
+ to_rcmd.
+ (default_rcmd): New function.
+ (do_monitor_command): Unconditionally delegate.
+ * target.h (struct target_ops) <to_rmcd>: Use
+ TARGET_DEFAULT_FUNC.
+
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
return 0;
}
+static void
+delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2)
+{
+ self = self->beneath;
+ self->to_rcmd (self, arg1, arg2);
+}
+
static int
delegate_can_async_p (struct target_ops *self)
{
ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
if (ops->to_stopped_data_address == NULL)
ops->to_stopped_data_address = delegate_stopped_data_address;
+ if (ops->to_rcmd == NULL)
+ ops->to_rcmd = delegate_rcmd;
if (ops->to_can_async_p == NULL)
ops->to_can_async_p = delegate_can_async_p;
if (ops->to_is_async_p == NULL)
ops->to_remove_breakpoint = memory_remove_breakpoint;
ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
ops->to_stopped_data_address = tdefault_stopped_data_address;
+ ops->to_rcmd = default_rcmd;
ops->to_can_async_p = find_default_can_async_p;
ops->to_is_async_p = find_default_is_async_p;
ops->to_async = tdefault_async;
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
CORE_ADDR, int);
+static void default_rcmd (struct target_ops *, char *, struct ui_file *);
+
static void tcomplain (void) ATTRIBUTE_NORETURN;
static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
INHERIT (to_thread_name, t);
INHERIT (to_stop, t);
/* Do not inherit to_xfer_partial. */
- INHERIT (to_rcmd, t);
+ /* Do not inherit to_rcmd. */
INHERIT (to_pid_to_exec_file, t);
INHERIT (to_log_command, t);
INHERIT (to_stratum, t);
de_fault (to_stop,
(void (*) (struct target_ops *, ptid_t))
target_ignore);
- de_fault (to_rcmd,
- (void (*) (struct target_ops *, char *, struct ui_file *))
- tcomplain);
de_fault (to_pid_to_exec_file,
(char *(*) (struct target_ops *, int))
return_null);
stack of targets currently in use (including the exec-file,\n\
core-file, and process, if any), as well as the symbol file name.";
+static void
+default_rcmd (struct target_ops *self, char *command, struct ui_file *output)
+{
+ error (_("\"monitor\" command not supported by this target."));
+}
+
static void
do_monitor_command (char *cmd,
int from_tty)
{
- if ((current_target.to_rcmd
- == (void (*) (struct target_ops *, char *, struct ui_file *)) tcomplain)
- || (current_target.to_rcmd == debug_to_rcmd
- && (debug_target.to_rcmd
- == (void (*) (struct target_ops *,
- char *, struct ui_file *)) tcomplain)))
- error (_("\"monitor\" command not supported by this target."));
target_rcmd (cmd, gdb_stdtarg);
}
char *(*to_thread_name) (struct target_ops *, struct thread_info *);
void (*to_stop) (struct target_ops *, ptid_t);
void (*to_rcmd) (struct target_ops *,
- char *command, struct ui_file *output);
+ char *command, struct ui_file *output)
+ TARGET_DEFAULT_FUNC (default_rcmd);
char *(*to_pid_to_exec_file) (struct target_ops *, int pid);
void (*to_log_command) (struct target_ops *, const char *);
struct target_section_table *(*to_get_section_table) (struct target_ops *);