summaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2007-12-07 15:02:12 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2007-12-07 15:02:12 +0000
commit4a3784e2aa1f788bb66ce556879b02d2984a3a58 (patch)
tree57b05a6e29cc63f1edd5afbfcffe593436c77328 /gdb/target.h
parentdd95f7bf45c5996b34589dfcc71de8538d7ef494 (diff)
downloadgdb-4a3784e2aa1f788bb66ce556879b02d2984a3a58.tar.gz
* 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.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index 6dc36851f9d..cb8db9bb035 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.