mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
convert to_rcmd
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.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
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>
|
2014-02-19 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* target-delegates.c: Rebuild.
|
* target-delegates.c: Rebuild.
|
||||||
|
@ -101,6 +101,13 @@ tdefault_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
|
|||||||
return 0;
|
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
|
static int
|
||||||
delegate_can_async_p (struct target_ops *self)
|
delegate_can_async_p (struct target_ops *self)
|
||||||
{
|
{
|
||||||
@ -175,6 +182,8 @@ install_delegators (struct target_ops *ops)
|
|||||||
ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
|
ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
|
||||||
if (ops->to_stopped_data_address == NULL)
|
if (ops->to_stopped_data_address == NULL)
|
||||||
ops->to_stopped_data_address = delegate_stopped_data_address;
|
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)
|
if (ops->to_can_async_p == NULL)
|
||||||
ops->to_can_async_p = delegate_can_async_p;
|
ops->to_can_async_p = delegate_can_async_p;
|
||||||
if (ops->to_is_async_p == NULL)
|
if (ops->to_is_async_p == NULL)
|
||||||
@ -199,6 +208,7 @@ install_dummy_methods (struct target_ops *ops)
|
|||||||
ops->to_remove_breakpoint = memory_remove_breakpoint;
|
ops->to_remove_breakpoint = memory_remove_breakpoint;
|
||||||
ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
|
ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
|
||||||
ops->to_stopped_data_address = tdefault_stopped_data_address;
|
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_can_async_p = find_default_can_async_p;
|
||||||
ops->to_is_async_p = find_default_is_async_p;
|
ops->to_is_async_p = find_default_is_async_p;
|
||||||
ops->to_async = tdefault_async;
|
ops->to_async = tdefault_async;
|
||||||
|
20
gdb/target.c
20
gdb/target.c
@ -55,6 +55,8 @@ static int default_watchpoint_addr_within_range (struct target_ops *,
|
|||||||
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
|
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
|
||||||
CORE_ADDR, int);
|
CORE_ADDR, int);
|
||||||
|
|
||||||
|
static void default_rcmd (struct target_ops *, char *, struct ui_file *);
|
||||||
|
|
||||||
static void tcomplain (void) ATTRIBUTE_NORETURN;
|
static void tcomplain (void) ATTRIBUTE_NORETURN;
|
||||||
|
|
||||||
static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
|
static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
|
||||||
@ -648,7 +650,7 @@ update_current_target (void)
|
|||||||
INHERIT (to_thread_name, t);
|
INHERIT (to_thread_name, t);
|
||||||
INHERIT (to_stop, t);
|
INHERIT (to_stop, t);
|
||||||
/* Do not inherit to_xfer_partial. */
|
/* Do not inherit to_xfer_partial. */
|
||||||
INHERIT (to_rcmd, t);
|
/* Do not inherit to_rcmd. */
|
||||||
INHERIT (to_pid_to_exec_file, t);
|
INHERIT (to_pid_to_exec_file, t);
|
||||||
INHERIT (to_log_command, t);
|
INHERIT (to_log_command, t);
|
||||||
INHERIT (to_stratum, t);
|
INHERIT (to_stratum, t);
|
||||||
@ -827,9 +829,6 @@ update_current_target (void)
|
|||||||
de_fault (to_stop,
|
de_fault (to_stop,
|
||||||
(void (*) (struct target_ops *, ptid_t))
|
(void (*) (struct target_ops *, ptid_t))
|
||||||
target_ignore);
|
target_ignore);
|
||||||
de_fault (to_rcmd,
|
|
||||||
(void (*) (struct target_ops *, char *, struct ui_file *))
|
|
||||||
tcomplain);
|
|
||||||
de_fault (to_pid_to_exec_file,
|
de_fault (to_pid_to_exec_file,
|
||||||
(char *(*) (struct target_ops *, int))
|
(char *(*) (struct target_ops *, int))
|
||||||
return_null);
|
return_null);
|
||||||
@ -5053,17 +5052,16 @@ static char targ_desc[] =
|
|||||||
stack of targets currently in use (including the exec-file,\n\
|
stack of targets currently in use (including the exec-file,\n\
|
||||||
core-file, and process, if any), as well as the symbol file name.";
|
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
|
static void
|
||||||
do_monitor_command (char *cmd,
|
do_monitor_command (char *cmd,
|
||||||
int from_tty)
|
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);
|
target_rcmd (cmd, gdb_stdtarg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +528,8 @@ struct target_ops
|
|||||||
char *(*to_thread_name) (struct target_ops *, struct thread_info *);
|
char *(*to_thread_name) (struct target_ops *, struct thread_info *);
|
||||||
void (*to_stop) (struct target_ops *, ptid_t);
|
void (*to_stop) (struct target_ops *, ptid_t);
|
||||||
void (*to_rcmd) (struct target_ops *,
|
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);
|
char *(*to_pid_to_exec_file) (struct target_ops *, int pid);
|
||||||
void (*to_log_command) (struct target_ops *, const char *);
|
void (*to_log_command) (struct target_ops *, const char *);
|
||||||
struct target_section_table *(*to_get_section_table) (struct target_ops *);
|
struct target_section_table *(*to_get_section_table) (struct target_ops *);
|
||||||
|
Reference in New Issue
Block a user