From 937a4bdc12d90b400da5b5f5e1e3770c6e4b39ea Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 22 Mar 1998 05:33:41 +0000 Subject: Add function hw_trace() and macro HW_TRACE - provides trace support for HW devices. --- sim/common/hw-device.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sim/common/hw-device.c') 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) */ -- cgit v1.1