* 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-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.
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;
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;
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;
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;
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);
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;
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.
if (p == NULL)
return;
- serial_log_command (p);
+ target_log_command (p);
while (*p == ' ' || *p == '\t')
p++;