* target.c (update_current_target): Inherit to_log_command.
[deliverable/binutils-gdb.git] / gdb / target.h
index 6dc36851f9ddfe2932c79666ad468013e722f5fe..cb8db9bb035c05cd160f78596367a9e2e5be63cf 100644 (file)
@@ -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.
This page took 0.024148 seconds and 4 git commands to generate.