diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-09-05 07:57:27 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-09-05 07:57:27 +0000 |
commit | 1b465b54e1135c13343b13daeb555ba87de6c700 (patch) | |
tree | 2c3d612cdeab37743512ab495d59a4a38302af1f /sim/common/sim-utils.c | |
parent | 6fea47635bc6ab77e190558a7e32a2a0a14b19f0 (diff) | |
download | fsf-binutils-gdb-1b465b54e1135c13343b13daeb555ba87de6c700.zip fsf-binutils-gdb-1b465b54e1135c13343b13daeb555ba87de6c700.tar.gz fsf-binutils-gdb-1b465b54e1135c13343b13daeb555ba87de6c700.tar.bz2 |
Add sim_do_commandf - printf version of sim_do_command.
Diffstat (limited to 'sim/common/sim-utils.c')
-rw-r--r-- | sim/common/sim-utils.c | 17 |
1 files changed, 17 insertions, 0 deletions
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); +} |