From: Tom Tromey Date: Wed, 18 Dec 2013 04:35:13 +0000 (-0700) Subject: Add target_ops argument to to_log_command X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4ab76ea3fb057381852a9d3b7ac9270fec8e7a7c;p=binutils-gdb.git Add target_ops argument to to_log_command 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. (target_log_command): Add argument. * serial.h (serial_log_command): Add 'self' argument. * serial.c (serial_log_command): Add 'self' argument. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f9102b3dfe5..958441fa80d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add argument. + (target_log_command): Add argument. + * serial.h (serial_log_command): Add 'self' argument. + * serial.c (serial_log_command): Add 'self' argument. + 2014-02-19 Tom Tromey * windows-nat.c (windows_pid_to_exec_file): Add 'self' argument. diff --git a/gdb/serial.c b/gdb/serial.c index 2b1ecedae38..7471a6b5ab5 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -130,7 +130,7 @@ serial_logchar (struct ui_file *stream, int ch_type, int ch, int timeout) } void -serial_log_command (const char *cmd) +serial_log_command (struct target_ops *self, const char *cmd) { if (!serial_logfp) return; diff --git a/gdb/serial.h b/gdb/serial.h index 0351f5defc4..f4ab31eb183 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -304,7 +304,7 @@ extern void serial_add_interface (const struct serial_ops * optable); /* File in which to record the remote debugging session. */ -extern void serial_log_command (const char *); +extern void serial_log_command (struct target_ops *self, const char *); #ifdef USE_WIN32API diff --git a/gdb/target.h b/gdb/target.h index d1bb68c896d..ceb2f04ea05 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -528,7 +528,7 @@ struct target_ops void (*to_rcmd) (struct target_ops *, char *command, struct ui_file *output); char *(*to_pid_to_exec_file) (struct target_ops *, int pid); - void (*to_log_command) (const char *); + void (*to_log_command) (struct target_ops *, const char *); struct target_section_table *(*to_get_section_table) (struct target_ops *); enum strata to_stratum; int (*to_has_all_memory) (struct target_ops *); @@ -1868,7 +1868,8 @@ extern char *target_fileio_read_stralloc (const char *filename); #define target_log_command(p) \ do \ if (current_target.to_log_command) \ - (*current_target.to_log_command) (p); \ + (*current_target.to_log_command) (¤t_target, \ + p); \ while (0)