binutils-gdb/sim/arm
Simon Marchi f08708cbf5 sim: add ATTRIBUTE_PRINTF / ATTRIBUTE_NULL_PRINTF where necessary
I finally got the all-targets sim building with Clang, these are all the
instances where an ATTRIBUTE_PRINTF or ATTRIBUTE_NULL_PRINTF attribute
needed to be added to avoid errors like:

    /home/simark/src/binutils-gdb/sim/aarch64/../common/sim-profile.c:464:19: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
        vfprintf (fp, fmt, ap);
                      ^~~
There are more fixes needed to get everything building, but adding these
attributes is trivial enough, so I send them all in a single patch.

Adding the format attributes introduces some format string errors when
building with GCC (because now format strings are checked), so
corresponding changes are needed to avoid breaking the build.  Other
than simple format string specified changes, there is this one:

    /home/simark/src/binutils-gdb/sim/aarch64/../common/hw-events.c: In function 'hw_event_queue_schedule':
    /home/simark/src/binutils-gdb/sim/aarch64/../common/hw-events.c:95:15: error: too many arguments for format [-Werror=format-extra-args]
       95 |         NULL, dummy);
          |               ^~~~~

We can fix it and avoid using a dummy variable by simply calling
hw_event_queue_schedule_tracef instead of
hw_event_queue_schedule_vtracef.

sim/arm/ChangeLog:

	* armdefs.h (ARMul_ConsolePrint): Use format attribute.
	* wrapper.c (op_printf): Likewise.

sim/bfin/ChangeLog:

	* interp.c (sim_open): Adjust format string specifier.

sim/common/ChangeLog:

	* hw-events.h (hw_event_queue_schedule_tracef): Use format attribute.
	(hw_event_queue_schedule_vtracef): Likewise.
	* hw-tree.h (hw_tree_vparse): Likewise.
	* sim-profile.c (profile_vprintf): Likewise.
	* sim-trace.c (dis_printf): Likewise.
	* sim-trace.h (trace_printf): Likewise.
	(trace_vprintf): Likewise.
	* sim-utils.h (sim_do_commandf): Likewise.
	* hw-events.c (hw_event_queue_schedule): Use
	hw_event_queue_schedule_tracef.

sim/rx/ChangeLog:

	* trace.c (op_printf): Likewise.

sim/v850/ChangeLog:

	* interp.c (sim_open): Adjust format string specifier.

Change-Id: I1445115ce57db15bb8e35dca93014555e7555794
2021-05-03 10:55:25 -04:00
..
aclocal.m4 sim: enable hardware support by default 2021-04-26 22:30:55 -04:00
armcopro.c Remove extraneous whitespace from ARM sim sources. 2015-07-14 12:06:33 +01:00
armdefs.h sim: add ATTRIBUTE_PRINTF / ATTRIBUTE_NULL_PRINTF where necessary 2021-05-03 10:55:25 -04:00
armemu32.c sim: arm: move build logic to source files 2021-05-01 12:55:18 -04:00
armemu.c Fix a bug in the ARM emulator which would not allow 4 byte alignment for double word stores. 2021-04-26 17:17:34 +01:00
armemu.h Add support for ARM v6 instructions. 2015-06-28 19:14:36 +01:00
armfpe.h Remove extraneous whitespace from ARM sim sources. 2015-07-14 12:06:33 +01:00
arminit.c [ARM, sim] Fix build error and warnings 2019-12-06 18:16:20 -03:00
armos.c Fix printf formatting errors where "0x" is used as a prefix for a decimal number. 2020-10-22 12:00:10 +01:00
armos.h Remove extraneous whitespace from ARM sim sources. 2015-07-14 12:06:33 +01:00
armsupp.c sim: use ARRAY_SIZE instead of ad-hoc sizeof calculations 2017-02-13 01:26:21 -05:00
armvirt.c sim: arm: delete unused code 2015-12-25 03:09:01 -05:00
ChangeLog sim: add ATTRIBUTE_PRINTF / ATTRIBUTE_NULL_PRINTF where necessary 2021-05-03 10:55:25 -04:00
config.in sim: nrun: add local strsignal prototype 2021-05-01 16:37:39 -04:00
configure sim: nrun: add local strsignal prototype 2021-05-01 16:37:39 -04:00
configure.ac sim: common: split up acinclude.m4 into individual m4 files 2021-02-21 02:20:19 -05:00
COPYING Update sim's COPYING files. 2012-12-19 07:19:14 +00:00
dbg_rdi.h sim: arm: delete unused code 2015-12-25 03:09:01 -05:00
iwmmxt.c sim: stdlib.h for abs() 2021-01-04 20:13:10 -05:00
iwmmxt.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Makefile.in sim: arm: move build logic to source files 2021-05-01 12:55:18 -04:00
maverick.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
maverick.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
README
sim-main.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
thumbemu.c Add support for the SDIV and UDIV instructions to the ARM simulator. 2020-12-15 12:40:35 +00:00
wrapper.c sim: add ATTRIBUTE_PRINTF / ATTRIBUTE_NULL_PRINTF where necessary 2021-05-03 10:55:25 -04:00

This directory contains the standard release of the ARMulator from
Advanced RISC Machines, and was ftp'd from.

ftp.cl.cam.ac.uk:/arm/gnu

It likes to use TCP/IP between the simulator and the host, which is
nice, but is a pain to use under anything non-unix.

I've added created a new Makefile.in (the original in Makefile.orig)
to build a version of the simulator without the TCP/IP stuff, and a
wrapper.c to link directly into gdb and the run command.

It should be possible (barring major changes in the layout of
the armulator) to upgrade the simulator by copying all the files
out of a release into this directory and renaming the Makefile.

(Except that I changed armos.c to work more simply with our
simulator rigs)

Steve

sac@cygnus.com

Mon May 15 12:03:28 PDT 1995