sim: gdbinit: hoist setup to common code
authorMike Frysinger <vapier@gentoo.org>
Thu, 17 Feb 2022 05:35:31 +0000 (00:35 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 21 Feb 2022 18:57:33 +0000 (13:57 -0500)
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.

13 files changed:
sim/Makefile.in
sim/bpf/configure
sim/common/Make-common.in
sim/common/gdbinit.in [deleted file]
sim/configure
sim/configure.ac
sim/gdbinit.in [new file with mode: 0644]
sim/m4/sim_ac_output.m4
sim/mips/configure
sim/mn10300/configure
sim/or1k/configure
sim/riscv/configure
sim/v850/configure

index 49a3c0b80dbfca41a349b6030eaf440f8cf63c04..6df800a7b7862f522159d48cfe0243c2565e760e 100644 (file)
@@ -208,7 +208,7 @@ CONFIG_CLEAN_FILES = Make-common.sim aarch64/Makefile.sim \
        microblaze/Makefile.sim moxie/Makefile.sim msp430/Makefile.sim \
        pru/Makefile.sim rl78/Makefile.sim rx/Makefile.sim \
        sh/Makefile.sim erc32/Makefile.sim \
-       example-synacor/Makefile.sim arch-subdir.mk
+       example-synacor/Makefile.sim arch-subdir.mk .gdbinit
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 ARFLAGS = cru
@@ -1278,6 +1278,8 @@ example-synacor/Makefile.sim: $(top_builddir)/config.status $(top_srcdir)/exampl
        cd $(top_builddir) && $(SHELL) ./config.status $@
 arch-subdir.mk: $(top_builddir)/config.status $(srcdir)/arch-subdir.mk.in
        cd $(top_builddir) && $(SHELL) ./config.status $@
+.gdbinit: $(top_builddir)/config.status $(srcdir)/gdbinit.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
index f44ea707755b908b64618917a11969e0019b8ab0..bd22472d68cdb8be043f1a2ad7fb7e12e11eee9b 100755 (executable)
@@ -587,7 +587,6 @@ LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
 sim_float
-cgen_breaks
 target_alias
 host_alias
 build_alias
@@ -1734,17 +1733,10 @@ fi
 fi
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2469,7 +2461,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
index 57b45a7b4271c9601d6d9efc843ea5c993057eeb..74e5dad3049871d295d42a32f328b8d0249d3521 100644 (file)
@@ -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/common/gdbinit.in b/sim/common/gdbinit.in
deleted file mode 100644 (file)
index ab9d7b3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-break sim_io_error
-break sim_core_signal
-@cgen_breaks@
-
-define dump
-set sim_debug_dump ()
-end
-
-document dump
-Dump cpu and simulator registers for debugging the simulator.
-Requires the simulator to provide function sim_debug_dump.
-end
index 019c2f41cf4227c23477f74a809ce05cc0d2290b..02a3fa5bb3c02fef3cf466f7b2ab002e0247e492 100755 (executable)
@@ -16287,7 +16287,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files arch-subdir.mk Makefile"
+ac_config_files="$ac_config_files arch-subdir.mk Makefile .gdbinit:gdbinit.in"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -17540,6 +17540,7 @@ do
     "depdir-example-synacor") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir-example-synacor" ;;
     "arch-subdir.mk") CONFIG_FILES="$CONFIG_FILES arch-subdir.mk" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:gdbinit.in" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
index 0c14b1da79e24ef44afb59bb11802c91949b3a6b..40a1efb96d33b2c3054d21289446a8fe4b42573f 100644 (file)
@@ -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/gdbinit.in b/sim/gdbinit.in
new file mode 100644 (file)
index 0000000..f9cd5f3
--- /dev/null
@@ -0,0 +1,14 @@
+break sim_io_error
+break sim_core_signal
+# 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 ()
+end
+
+document dump
+Dump cpu and simulator registers for debugging the simulator.
+Requires the simulator to provide function sim_debug_dump.
+end
index 22888bf214cf7ba0d0f51706f6869d320bf942ff..9eaeeff99f2844d16fd4a3e3c018f8a0959bae96 100644 (file)
@@ -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
index 956b967a0b6c82962092aa6db1019b72ec634620..2f635a50e1004495076cadb41ad8334caeec59ac 100755 (executable)
@@ -586,7 +586,6 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
-cgen_breaks
 sim_multi_obj
 sim_multi_src
 sim_multi_igen_configs
@@ -2182,17 +2181,10 @@ sim_micromips_flags=" -F ${sim_micromips_filter}  ${sim_micromips_machine}  ${si
 
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2917,7 +2909,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
index 46e30c1cff06c07a66fcc4ec643abb4a4cfc7369..569d09ba18e3acfec6c5b454c428605d6d1fbfa6 100755 (executable)
@@ -587,7 +587,6 @@ LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
 sim_float
-cgen_breaks
 target_alias
 host_alias
 build_alias
@@ -1734,17 +1733,10 @@ fi
 fi
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2469,7 +2461,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
index 46e30c1cff06c07a66fcc4ec643abb4a4cfc7369..569d09ba18e3acfec6c5b454c428605d6d1fbfa6 100755 (executable)
@@ -587,7 +587,6 @@ LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
 sim_float
-cgen_breaks
 target_alias
 host_alias
 build_alias
@@ -1734,17 +1733,10 @@ fi
 fi
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2469,7 +2461,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
index 577d4cd32e739930d988b147d0f233ac28e565c9..d3f0d47e26e87999d3a389937cee4e857d4a78d3 100755 (executable)
@@ -587,7 +587,6 @@ LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
 sim_float
-cgen_breaks
 target_alias
 host_alias
 build_alias
@@ -1740,17 +1739,10 @@ fi
 fi
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2475,7 +2467,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
index 46e30c1cff06c07a66fcc4ec643abb4a4cfc7369..569d09ba18e3acfec6c5b454c428605d6d1fbfa6 100755 (executable)
@@ -587,7 +587,6 @@ LIBOBJS
 SIM_COMMON_BUILD_FALSE
 SIM_COMMON_BUILD_TRUE
 sim_float
-cgen_breaks
 target_alias
 host_alias
 build_alias
@@ -1734,17 +1733,10 @@ fi
 fi
 
 
-cgen_breaks=""
-if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
-cgen_breaks="break cgen_rtx_error";
-fi
-
 ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
 
 ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
 
-ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
-
 ac_config_commands="$ac_config_commands Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
@@ -2469,7 +2461,6 @@ do
   case $ac_config_target in
     "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
     "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
-    ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;