[5/7,v2] sim: unify debug/stdio/trace/profile build settings

Message ID 20210613000926.26447-1-vapier@gentoo.org
State New
Headers show
Series
  • Untitled series #38889
Related show

Commit Message

Metzger, Markus T via Gdb-patches June 13, 2021, 12:09 a.m.
Move these options up to the common dir so we only test & export
them once across all ports.

The ppc code needs a little extra care with its trace settings as
it's not exactly the same API as the common code.  The other knobs
are the same though.
---
 sim/ChangeLog                 |   8 ++
 sim/Makefile.in               |   4 +
 sim/aarch64/config.in         |  18 -----
 sim/aarch64/configure         | 134 +---------------------------------
 sim/aclocal.m4                |   4 +
 sim/arm/config.in             |  18 -----
 sim/arm/configure             | 134 +---------------------------------
 sim/avr/config.in             |  18 -----
 sim/avr/configure             | 134 +---------------------------------
 sim/bfin/config.in            |  18 -----
 sim/bfin/configure            | 134 +---------------------------------
 sim/bpf/config.in             |  18 -----
 sim/bpf/configure             | 134 +---------------------------------
 sim/config.h.in               |  18 +++++
 sim/configure                 | 123 +++++++++++++++++++++++++++++++
 sim/configure.ac              |   6 ++
 sim/cr16/config.in            |  18 -----
 sim/cr16/configure            | 134 +---------------------------------
 sim/cris/config.in            |  18 -----
 sim/cris/configure            | 134 +---------------------------------
 sim/d10v/config.in            |  18 -----
 sim/d10v/configure            | 134 +---------------------------------
 sim/erc32/config.in           |  18 -----
 sim/erc32/configure           | 134 +---------------------------------
 sim/example-synacor/config.in |  18 -----
 sim/example-synacor/configure | 134 +---------------------------------
 sim/frv/config.in             |  18 -----
 sim/frv/configure             | 134 +---------------------------------
 sim/ft32/config.in            |  18 -----
 sim/ft32/configure            | 134 +---------------------------------
 sim/h8300/config.in           |  18 -----
 sim/h8300/configure           | 134 +---------------------------------
 sim/iq2000/config.in          |  18 -----
 sim/iq2000/configure          | 134 +---------------------------------
 sim/lm32/config.in            |  18 -----
 sim/lm32/configure            | 134 +---------------------------------
 sim/m32c/config.in            |  18 -----
 sim/m32c/configure            | 134 +---------------------------------
 sim/m32r/config.in            |  18 -----
 sim/m32r/configure            | 134 +---------------------------------
 sim/m4/sim_ac_common.m4       |  16 ----
 sim/m68hc11/config.in         |  18 -----
 sim/m68hc11/configure         | 134 +---------------------------------
 sim/mcore/config.in           |  18 -----
 sim/mcore/configure           | 134 +---------------------------------
 sim/microblaze/config.in      |  18 -----
 sim/microblaze/configure      | 134 +---------------------------------
 sim/mips/config.in            |  18 -----
 sim/mips/configure            | 134 +---------------------------------
 sim/mn10300/config.in         |  18 -----
 sim/mn10300/configure         | 134 +---------------------------------
 sim/moxie/config.in           |  18 -----
 sim/moxie/configure           | 134 +---------------------------------
 sim/msp430/config.in          |  18 -----
 sim/msp430/configure          | 134 +---------------------------------
 sim/or1k/config.in            |  18 -----
 sim/or1k/configure            | 134 +---------------------------------
 sim/ppc/config.in             |   6 --
 sim/ppc/configure             |  44 -----------
 sim/ppc/configure.ac          |  26 -------
 sim/ppc/debug.h               |  19 +++++
 sim/pru/config.in             |  18 -----
 sim/pru/configure             | 134 +---------------------------------
 sim/riscv/config.in           |  18 -----
 sim/riscv/configure           | 134 +---------------------------------
 sim/rl78/config.in            |  18 -----
 sim/rl78/configure            | 134 +---------------------------------
 sim/rx/config.in              |  18 -----
 sim/rx/configure              | 134 +---------------------------------
 sim/sh/config.in              |  18 -----
 sim/sh/configure              | 134 +---------------------------------
 sim/v850/config.in            |  18 -----
 sim/v850/configure            | 134 +---------------------------------
 73 files changed, 244 insertions(+), 4742 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/configure.ac b/sim/configure.ac
index ecf12b57a19b..d8c6f2d4feb4 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -99,8 +99,14 @@  if test "${enable_sim}" != no; then
 fi
 AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
 
+dnl Standard (and optional) simulator options.
+dnl Eventually all simulators will support these.
 SIM_AC_OPTION_ASSERT
+SIM_AC_OPTION_DEBUG
 SIM_AC_OPTION_ENVIRONMENT
+SIM_AC_OPTION_PROFILE
+SIM_AC_OPTION_STDIO
+SIM_AC_OPTION_TRACE
 
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index 353855707ad7..0f687dc7bc58 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -54,26 +54,10 @@  AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
 LT_INIT([dlopen])
 AC_SUBST(lt_cv_dlopen_libs)
 
-dnl Standard (and optional) simulator options.
-dnl Eventually all simulators will support these.
-dnl Do not add any here that cannot be supported by all simulators.
-dnl Do not add similar but different options to a particular simulator,
-dnl all shall eventually behave the same way.
-
-
 dnl We don't use automake, but we still want to support
 dnl --enable-maintainer-mode.
 AM_MAINTAINER_MODE
 
-
-SIM_AC_OPTION_DEBUG
-
-SIM_AC_OPTION_STDIO
-
-SIM_AC_OPTION_TRACE
-
-SIM_AC_OPTION_PROFILE
-
 SIM_AC_OPTION_INLINE
 
 ACX_PKGVERSION([SIM])
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index bf17622434e4..9783dcf40734 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -519,19 +519,6 @@  if test x"$silent" != x"yes"; then
 fi])dnl
 
 
-AC_MSG_CHECKING([for sim stdio debug behavior])
-sim_stdio=0
-AC_ARG_ENABLE(sim-stdio,
-[  --enable-sim-stdio			Specify whether to use stdio for console input/output.],
-[case "${enableval}" in
-  yes)	sim_stdio="DO_USE_STDIO";;
-  no)	sim_stdio="DONT_USE_STDIO";;
-  *)	AC_MSG_ERROR([Unknown value $enableval passed to --enable-sim-stdio]);;
-esac])dnl
-AC_DEFINE_UNQUOTED([WITH_STDIO], [$sim_stdio], [How to route I/O])
-AC_MSG_RESULT($sim_stdio)
-
-
 AC_ARG_ENABLE(sim-switch,
 [  --enable-sim-switch			Use a switch instead of a table for instruction call.],
 [case "${enableval}" in
@@ -559,19 +546,6 @@  if test x"$silent" != x"yes" && test x"$sim_timebase" != x""; then
 fi],[sim_timebase=""])dnl
 
 
-AC_MSG_CHECKING([for sim trace settings])
-sim_trace="1"
-AC_ARG_ENABLE(sim-trace,
-[  --enable-sim-trace			Specify whether tracing is supported.],
-[case "${enableval}" in
-  yes)	sim_trace="1";;
-  no)	sim_trace="0";;
-  *)	AC_MSG_ERROR([--enable-sim-trace does not take a value]);;
-esac])dnl
-AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings])
-AC_MSG_RESULT($sim_trace)
-
-
 AC_ARG_ENABLE(werror,
   AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]),
   [case "${enableval}" in
diff --git a/sim/ppc/debug.h b/sim/ppc/debug.h
index 6f19624179e2..08ea5795fd89 100644
--- a/sim/ppc/debug.h
+++ b/sim/ppc/debug.h
@@ -169,5 +169,24 @@  trace_option(const char *option, int setting);
 extern void trace_usage
 (int verbose);
 
+/* TODO: These values aren't currently used by the ppc port.  They're here to
+   glue the common sim compile-time settings in.  The ppc_trace settings above
+   would need to be overhauled.  */
+#define TRACE_insn     1
+#define TRACE_disasm   1
+#define TRACE_decode   1
+#define TRACE_extract  1
+#define TRACE_linenum  1
+#define TRACE_memory   1
+#define TRACE_model    1
+#define TRACE_alu      1
+#define TRACE_core     1
+#define TRACE_events   1
+#define TRACE_fpu      1
+#define TRACE_vpu      1
+#define TRACE_branch   1
+#define TRACE_syscall  1
+#define TRACE_register 1
+#define TRACE_debug    1
 
 #endif /* _DEBUG_H_ */