From 1b465b54e1135c13343b13daeb555ba87de6c700 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 5 Sep 1997 07:57:27 +0000 Subject: Add sim_do_commandf - printf version of sim_do_command. --- sim/common/sim-utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sim/common/sim-utils.c') diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 6a7c5ba..c628fd4 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -221,3 +221,20 @@ sim_elapsed_time_since (start) #endif #endif } + + + +/* do_command but with printf style formatting of the arguments */ +void +sim_do_commandf (SIM_DESC sd, + const char *fmt, + ...) +{ + va_list ap; + char *buf; + va_start (ap, fmt); + vasprintf (&buf, fmt, ap); + sim_do_command (sd, buf); + va_end (ap); + free (buf); +} -- cgit v1.1