From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 4C55D3858D20 for ; Thu, 17 Feb 2022 05:40:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C55D3858D20 Received: by smtp.gentoo.org (Postfix, from userid 559) id E3220343136; Thu, 17 Feb 2022 05:40:36 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: hp@axis.com Subject: [PATCH] sim: gdbinit: hoist setup to common code Date: Thu, 17 Feb 2022 00:40:35 -0500 Message-Id: <20220217054035.10127-1-vapier@gentoo.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 17 Feb 2022 05:40:40 -0000 This was left in subdirs because of the dynamic cgen usage. However, we can move this breakpoint call to runtime and let gdb detect whether the symbol exists. --- sim/Makefile.in | 4 +++- sim/bpf/configure | 9 --------- sim/common/Make-common.in | 7 ++----- sim/configure | 3 ++- sim/configure.ac | 2 +- sim/{common => }/gdbinit.in | 4 +++- sim/m4/sim_ac_output.m4 | 7 ------- sim/mips/configure | 9 --------- sim/mn10300/configure | 9 --------- sim/or1k/configure | 9 --------- sim/riscv/configure | 9 --------- sim/v850/configure | 9 --------- 12 files changed, 11 insertions(+), 70 deletions(-) rename sim/{common => }/gdbinit.in (60%) diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 57b45a7b4271..74e5dad30498 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -250,7 +250,7 @@ RUNTESTFLAGS = callback_h = $(srcroot)/include/sim/callback.h remote_sim_h = $(srcroot)/include/sim/sim.h -all: libsim.a run$(EXEEXT) .gdbinit +all: libsim.a run$(EXEEXT) libsim.a: $(LIB_OBJS) $(SILENCE) rm -f libsim.a @@ -504,7 +504,7 @@ mostlyclean clean: $(SIM_EXTRA_CLEAN) distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN) rm -f TAGS - rm -f Makefile config.cache config.log config.status .gdbinit + rm -f Makefile config.cache config.log config.status .c.o: $(COMPILE) $< @@ -521,9 +521,6 @@ Makefile: Makefile.in $(srccom)/Make-common.in $(config.status) @SIM_COMMON_BUILD_FALSE@config.status: configure @SIM_COMMON_BUILD_FALSE@ $(ECHO_GEN) $(SHELL) ./config.status --recheck -.gdbinit: # config.status $(srccom)/gdbinit.in -@SIM_COMMON_BUILD_FALSE@ $(ECHO_GEN) CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status - # CGEN support diff --git a/sim/configure.ac b/sim/configure.ac index 0c14b1da79e2..40a1efb96d33 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -187,5 +187,5 @@ dnl Some arches have unique configure flags. m4_include([frv/acinclude.m4]) m4_include([rx/acinclude.m4]) -AC_CONFIG_FILES([arch-subdir.mk Makefile]) +AC_CONFIG_FILES([arch-subdir.mk Makefile .gdbinit:gdbinit.in]) AC_OUTPUT diff --git a/sim/common/gdbinit.in b/sim/gdbinit.in similarity index 60% rename from sim/common/gdbinit.in rename to sim/gdbinit.in index ab9d7b3d5481..f9cd5f32d2f4 100644 --- a/sim/common/gdbinit.in +++ b/sim/gdbinit.in @@ -1,6 +1,8 @@ break sim_io_error break sim_core_signal -@cgen_breaks@ +# This symbol won't exist for non-cgen ports, but shouldn't be a big deal +# (other than gdb showing a warning on startup). +break cgen_rtx_error define dump set sim_debug_dump () diff --git a/sim/m4/sim_ac_output.m4 b/sim/m4/sim_ac_output.m4 index 22888bf214cf..9eaeeff99f28 100644 --- a/sim/m4/sim_ac_output.m4 +++ b/sim/m4/sim_ac_output.m4 @@ -21,15 +21,8 @@ dnl one afterwards. The two pieces of the common fragment are inserted into dnl the target's fragment at the appropriate points. AC_DEFUN([SIM_AC_OUTPUT], [dnl -dnl Make @cgen_breaks@ non-null only if the sim uses CGEN. -cgen_breaks="" -if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then -cgen_breaks="break cgen_rtx_error"; -fi -AC_SUBST(cgen_breaks) AC_CONFIG_FILES(Makefile.sim:Makefile.in) AC_CONFIG_FILES(Make-common.sim:../common/Make-common.in) -AC_CONFIG_FILES(.gdbinit:../common/gdbinit.in) AC_CONFIG_COMMANDS([Makefile], [echo "Merging Makefile.sim+Make-common.sim into Makefile ..." rm -f Makesim1.tmp Makesim2.tmp Makefile -- 2.34.1