aboutsummaryrefslogtreecommitdiff
path: root/sim/common/hw-device.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-03-22 05:33:41 +0000
committerAndrew Cagney <cagney@redhat.com>1998-03-22 05:33:41 +0000
commit937a4bdc12d90b400da5b5f5e1e3770c6e4b39ea (patch)
treeb7135ca122c197fb366f93c02325e0cd69aa6bda /sim/common/hw-device.c
parente5f0d498af49da4680564df06b9709423523ba6e (diff)
downloadgdb-937a4bdc12d90b400da5b5f5e1e3770c6e4b39ea.zip
gdb-937a4bdc12d90b400da5b5f5e1e3770c6e4b39ea.tar.gz
gdb-937a4bdc12d90b400da5b5f5e1e3770c6e4b39ea.tar.bz2
Add function hw_trace() and macro HW_TRACE - provides trace support
for HW devices.
Diffstat (limited to 'sim/common/hw-device.c')
-rw-r--r--sim/common/hw-device.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sim/common/hw-device.c b/sim/common/hw-device.c
index 3f57190..55968d8 100644
--- a/sim/common/hw-device.c
+++ b/sim/common/hw-device.c
@@ -87,6 +87,22 @@ hw_abort (struct hw *me,
sim_io_error (sd, "%s", "");
}
+void
+hw_trace (struct hw *me,
+ const char *fmt,
+ ...)
+{
+ if (hw_trace_p (me)) /* to be sure, to be sure */
+ {
+ va_list ap;
+ va_start (ap, fmt);
+ sim_io_eprintf (hw_system (me), "%s: ", hw_path (me));
+ sim_io_evprintf (hw_system (me), fmt, ap);
+ sim_io_eprintf (hw_system (me), "\n");
+ va_end (ap);
+ }
+}
+
/* The event queue abstraction (for devices) */