From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 1920C3855001 for ; Mon, 7 Jun 2021 05:34:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1920C3855001 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E7DA6340C30 for ; Mon, 7 Jun 2021 05:33:59 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 4/7] sim: split debug/stdio/trace/profile options into dedicated m4 files Date: Mon, 7 Jun 2021 01:33:52 -0400 Message-Id: <20210607053355.9965-4-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210607053355.9965-1-vapier@gentoo.org> References: <20210607053355.9965-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 05:34:03 -0000 This follows existing organizational structure with one configure option per m4 file, and will make it easier to move to the common configure dir. --- sim/bfin/aclocal.m4 | 4 ++ sim/m4/sim_ac_common.m4 | 101 ++------------------------------ sim/m4/sim_ac_option_debug.m4 | 35 +++++++++++ sim/m4/sim_ac_option_profile.m4 | 48 +++++++++++++++ sim/m4/sim_ac_option_stdio.m4 | 32 ++++++++++ sim/m4/sim_ac_option_trace.m4 | 46 +++++++++++++++ 6 files changed, 171 insertions(+), 95 deletions(-) create mode 100644 sim/m4/sim_ac_option_debug.m4 create mode 100644 sim/m4/sim_ac_option_profile.m4 create mode 100644 sim/m4/sim_ac_option_stdio.m4 create mode 100644 sim/m4/sim_ac_option_trace.m4 diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4 index 7bad1486c5cc..353855707ad7 100644 --- a/sim/m4/sim_ac_common.m4 +++ b/sim/m4/sim_ac_common.m4 @@ -66,102 +66,13 @@ dnl --enable-maintainer-mode. AM_MAINTAINER_MODE -dnl --enable-sim-debug is for developers of the simulator -dnl the allowable values are work-in-progress -AC_MSG_CHECKING([for sim debug setting]) -sim_debug="0" -AC_ARG_ENABLE(sim-debug, -[AS_HELP_STRING([--enable-sim-debug=opts], - [Enable debugging flags (for developers of the sim itself)])], -[case "${enableval}" in - yes) sim_debug="7";; - no) sim_debug="0";; - *) sim_debug="($enableval)";; -esac])dnl -if test "$sim_debug" != "0"; then - AC_DEFINE_UNQUOTED([DEBUG], [$sim_debug], [Sim debug setting]) -fi -AC_DEFINE_UNQUOTED([WITH_DEBUG], [$sim_debug], [Sim debug setting]) -AC_MSG_RESULT($sim_debug) - - -dnl --enable-sim-stdio is for users of the simulator -dnl It determines if IO from the program is routed through STDIO (buffered) -AC_MSG_CHECKING([for sim stdio debug behavior]) -sim_stdio="0" -AC_ARG_ENABLE(sim-stdio, -[AS_HELP_STRING([--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) - - -dnl --enable-sim-trace is for users of the simulator -dnl The argument is either a bitmask of things to enable [exactly what is -dnl up to the simulator], or is a comma separated list of names of tracing -dnl elements to enable. The latter is only supported on simulators that -dnl use WITH_TRACE. Default to all tracing but internal debug. -AC_MSG_CHECKING([for sim trace settings]) -sim_trace="~TRACE_debug" -AC_ARG_ENABLE(sim-trace, -[AS_HELP_STRING([--enable-sim-trace=opts], - [Enable tracing of simulated programs])], -[case "${enableval}" in - yes) sim_trace="-1";; - no) sim_trace="0";; - [[-0-9]]*) - sim_trace="'(${enableval})'";; - [[[:lower:]]]*) - sim_trace="" - for x in `echo "$enableval" | sed -e "s/,/ /g"`; do - if test x"$sim_trace" = x; then - sim_trace="(TRACE_$x" - else - sim_trace="${sim_trace}|TRACE_$x" - fi - done - sim_trace="$sim_trace)" ;; -esac])dnl -AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings]) -AC_MSG_RESULT($sim_trace) - - -dnl --enable-sim-profile -dnl The argument is either a bitmask of things to enable [exactly what is -dnl up to the simulator], or is a comma separated list of names of profiling -dnl elements to enable. The latter is only supported on simulators that -dnl use WITH_PROFILE. -AC_MSG_CHECKING([for sim profile settings]) -profile="1" -sim_profile="-1" -AC_ARG_ENABLE(sim-profile, -[AS_HELP_STRING([--enable-sim-profile=opts], [Enable profiling flags])], -[case "${enableval}" in - yes) profile="1" sim_profile="-1";; - no) profile="0" sim_profile="0";; - [[-0-9]]*) - profile="(${enableval})" sim_profile="(${enableval})";; - [[a-z]]*) - profile="1" - sim_profile="" - for x in `echo "$enableval" | sed -e "s/,/ /g"`; do - if test x"$sim_profile" = x; then - sim_profile="(PROFILE_$x" - else - sim_profile="${sim_profile}|PROFILE_$x" - fi - done - sim_profile="$sim_profile)" ;; -esac])dnl -AC_DEFINE_UNQUOTED([PROFILE], [$profile], [Sim profile settings]) -AC_DEFINE_UNQUOTED([WITH_PROFILE], [$sim_profile], [Sim profile settings]) -AC_MSG_RESULT($sim_profile) +SIM_AC_OPTION_DEBUG +SIM_AC_OPTION_STDIO + +SIM_AC_OPTION_TRACE + +SIM_AC_OPTION_PROFILE SIM_AC_OPTION_INLINE diff --git a/sim/m4/sim_ac_option_debug.m4 b/sim/m4/sim_ac_option_debug.m4 new file mode 100644 index 000000000000..41faef927fce --- /dev/null +++ b/sim/m4/sim_ac_option_debug.m4 @@ -0,0 +1,35 @@ +dnl Copyright (C) 1997-2021 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl +dnl --enable-sim-debug is for developers of the simulator +dnl the allowable values are work-in-progress +AC_DEFUN([SIM_AC_OPTION_DEBUG], +[dnl +AC_MSG_CHECKING([for sim debug setting]) +sim_debug="0" +AC_ARG_ENABLE(sim-debug, +[AS_HELP_STRING([--enable-sim-debug=opts], + [Enable debugging flags (for developers of the sim itself)])], +[case "${enableval}" in + yes) sim_debug="7";; + no) sim_debug="0";; + *) sim_debug="($enableval)";; +esac])dnl +if test "$sim_debug" != "0"; then + AC_DEFINE_UNQUOTED([DEBUG], [$sim_debug], [Sim debug setting]) +fi +AC_DEFINE_UNQUOTED([WITH_DEBUG], [$sim_debug], [Sim debug setting]) +AC_MSG_RESULT($sim_debug) +]) diff --git a/sim/m4/sim_ac_option_profile.m4 b/sim/m4/sim_ac_option_profile.m4 new file mode 100644 index 000000000000..07f8d958eefc --- /dev/null +++ b/sim/m4/sim_ac_option_profile.m4 @@ -0,0 +1,48 @@ +dnl Copyright (C) 1997-2021 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl +dnl --enable-sim-profile +dnl The argument is either a bitmask of things to enable [exactly what is +dnl up to the simulator], or is a comma separated list of names of profiling +dnl elements to enable. The latter is only supported on simulators that +dnl use WITH_PROFILE. +AC_DEFUN([SIM_AC_OPTION_PROFILE], +[dnl +AC_MSG_CHECKING([for sim profile settings]) +profile="1" +sim_profile="-1" +AC_ARG_ENABLE(sim-profile, +[AS_HELP_STRING([--enable-sim-profile=opts], [Enable profiling flags])], +[case "${enableval}" in + yes) profile="1" sim_profile="-1";; + no) profile="0" sim_profile="0";; + [[-0-9]]*) + profile="(${enableval})" sim_profile="(${enableval})";; + [[a-z]]*) + profile="1" + sim_profile="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_profile" = x; then + sim_profile="(PROFILE_$x" + else + sim_profile="${sim_profile}|PROFILE_$x" + fi + done + sim_profile="$sim_profile)" ;; +esac])dnl +AC_DEFINE_UNQUOTED([PROFILE], [$profile], [Sim profile settings]) +AC_DEFINE_UNQUOTED([WITH_PROFILE], [$sim_profile], [Sim profile settings]) +AC_MSG_RESULT($sim_profile) +]) diff --git a/sim/m4/sim_ac_option_stdio.m4 b/sim/m4/sim_ac_option_stdio.m4 new file mode 100644 index 000000000000..f4ae3081ee7b --- /dev/null +++ b/sim/m4/sim_ac_option_stdio.m4 @@ -0,0 +1,32 @@ +dnl Copyright (C) 1997-2021 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl +dnl --enable-sim-stdio is for users of the simulator +dnl It determines if IO from the program is routed through STDIO (buffered) +AC_DEFUN([SIM_AC_OPTION_STDIO], +[dnl +AC_MSG_CHECKING([for sim stdio debug behavior]) +sim_stdio="0" +AC_ARG_ENABLE(sim-stdio, +[AS_HELP_STRING([--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) +]) diff --git a/sim/m4/sim_ac_option_trace.m4 b/sim/m4/sim_ac_option_trace.m4 new file mode 100644 index 000000000000..d7dfead45a81 --- /dev/null +++ b/sim/m4/sim_ac_option_trace.m4 @@ -0,0 +1,46 @@ +dnl Copyright (C) 1997-2021 Free Software Foundation, Inc. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see . +dnl +dnl --enable-sim-trace is for users of the simulator +dnl The argument is either a bitmask of things to enable [exactly what is +dnl up to the simulator], or is a comma separated list of names of tracing +dnl elements to enable. The latter is only supported on simulators that +dnl use WITH_TRACE. Default to all tracing but internal debug. +AC_DEFUN([SIM_AC_OPTION_TRACE], +[dnl +AC_MSG_CHECKING([for sim trace settings]) +sim_trace="~TRACE_debug" +AC_ARG_ENABLE(sim-trace, +[AS_HELP_STRING([--enable-sim-trace=opts], + [Enable tracing of simulated programs])], +[case "${enableval}" in + yes) sim_trace="-1";; + no) sim_trace="0";; + [[-0-9]]*) + sim_trace="'(${enableval})'";; + [[[:lower:]]]*) + sim_trace="" + for x in `echo "$enableval" | sed -e "s/,/ /g"`; do + if test x"$sim_trace" = x; then + sim_trace="(TRACE_$x" + else + sim_trace="${sim_trace}|TRACE_$x" + fi + done + sim_trace="$sim_trace)" ;; +esac])dnl +AC_DEFINE_UNQUOTED([WITH_TRACE], [$sim_trace], [Sim trace settings]) +AC_MSG_RESULT($sim_trace) +]) -- 2.31.1