diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-12-07 15:02:12 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2007-12-07 15:02:12 +0000 |
commit | 49d03eab05e8f80cffaf764d4d26932bf00519d6 (patch) | |
tree | c36ea6df2ae30a7f9d86841f65f4a91483077523 | |
parent | 27524b67e16c96d7f8a266e99979ceb6ae953bc9 (diff) | |
download | gdb-49d03eab05e8f80cffaf764d4d26932bf00519d6.zip gdb-49d03eab05e8f80cffaf764d4d26932bf00519d6.tar.gz gdb-49d03eab05e8f80cffaf764d4d26932bf00519d6.tar.bz2 |
* target.c (update_current_target): Inherit to_log_command.
* target.h (struct target_ops). Add to_log_command.
(target_log_command): New macro.
* top.c (execute_command): Call target_log_command() rather than
serial_log_command().
* monitor.c (init_base_monitor_ops): Initialize to_log_command.
* remote-m32r-sdi.c (init_m32r_ops): Likewise.
* remote-mips.c (_initialize_remote_mips): Likewise.
* remote.c (init_remote_ops): Likewise.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/monitor.c | 1 | ||||
-rw-r--r-- | gdb/remote-m32r-sdi.c | 1 | ||||
-rw-r--r-- | gdb/remote-mips.c | 1 | ||||
-rw-r--r-- | gdb/remote.c | 1 | ||||
-rw-r--r-- | gdb/target.c | 1 | ||||
-rw-r--r-- | gdb/target.h | 9 | ||||
-rw-r--r-- | gdb/top.c | 2 |
8 files changed, 27 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 583e090..3fa5d5b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2007-12-07 Maciej W. Rozycki <macro@mips.com> + + * target.c (update_current_target): Inherit to_log_command. + * target.h (struct target_ops). Add to_log_command. + (target_log_command): New macro. + * top.c (execute_command): Call target_log_command() rather than + serial_log_command(). + * monitor.c (init_base_monitor_ops): Initialize to_log_command. + * remote-m32r-sdi.c (init_m32r_ops): Likewise. + * remote-mips.c (_initialize_remote_mips): Likewise. + * remote.c (init_remote_ops): Likewise. + 2007-12-06 Daniel Jacobowitz <dan@codesourcery.com> * infrun.c (init_wait_for_inferior): Reset target_last_wait_ptid. diff --git a/gdb/monitor.c b/gdb/monitor.c index 410ce62..2ea0085 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -2233,6 +2233,7 @@ init_base_monitor_ops (void) monitor_ops.to_mourn_inferior = monitor_mourn_inferior; monitor_ops.to_stop = monitor_stop; monitor_ops.to_rcmd = monitor_rcmd; + monitor_ops.to_log_command = serial_log_command; monitor_ops.to_stratum = process_stratum; monitor_ops.to_has_all_memory = 1; monitor_ops.to_has_memory = 1; diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index ed8feb7..a55bb31 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1599,6 +1599,7 @@ init_m32r_ops (void) m32r_ops.to_create_inferior = m32r_create_inferior; m32r_ops.to_mourn_inferior = m32r_mourn_inferior; m32r_ops.to_stop = m32r_stop; + m32r_ops.to_log_command = serial_log_command; m32r_ops.to_stratum = process_stratum; m32r_ops.to_has_all_memory = 1; m32r_ops.to_has_memory = 1; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index f153fb4..ade658d 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -3333,6 +3333,7 @@ _initialize_remote_mips (void) mips_ops.to_load = mips_load; mips_ops.to_create_inferior = mips_create_inferior; mips_ops.to_mourn_inferior = mips_mourn_inferior; + mips_ops.to_log_command = serial_log_command; mips_ops.to_stratum = process_stratum; mips_ops.to_has_all_memory = 1; mips_ops.to_has_memory = 1; diff --git a/gdb/remote.c b/gdb/remote.c index ec7044e..452af07 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6950,6 +6950,7 @@ Specify the serial device it is connected to\n\ remote_ops.to_stop = remote_stop; remote_ops.to_xfer_partial = remote_xfer_partial; remote_ops.to_rcmd = remote_rcmd; + remote_ops.to_log_command = serial_log_command; remote_ops.to_get_thread_local_address = remote_get_thread_local_address; remote_ops.to_stratum = process_stratum; remote_ops.to_has_all_memory = 1; diff --git a/gdb/target.c b/gdb/target.c index d89a7fb..c7461e2 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -448,6 +448,7 @@ update_current_target (void) INHERIT (to_enable_exception_callback, t); INHERIT (to_get_current_exception_event, t); INHERIT (to_pid_to_exec_file, t); + INHERIT (to_log_command, t); INHERIT (to_stratum, t); INHERIT (to_has_all_memory, t); INHERIT (to_has_memory, t); diff --git a/gdb/target.h b/gdb/target.h index 6dc3685..cb8db9b 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -404,6 +404,7 @@ struct target_ops int); struct exception_event_record *(*to_get_current_exception_event) (void); char *(*to_pid_to_exec_file) (int pid); + void (*to_log_command) (const char *); enum strata to_stratum; int to_has_all_memory; int to_has_memory; @@ -1130,6 +1131,14 @@ extern int target_stopped_data_address_p (struct target_ops *); extern const struct target_desc *target_read_description (struct target_ops *); +/* Command logging facility. */ + +#define target_log_command(p) \ + do \ + if (current_target.to_log_command) \ + (*current_target.to_log_command) (p); \ + while (0) + /* Routines for maintenance of the target structures... add_target: Add a target to the list of all possible targets. @@ -385,7 +385,7 @@ execute_command (char *p, int from_tty) if (p == NULL) return; - serial_log_command (p); + target_log_command (p); while (*p == ' ' || *p == '\t') p++; |