sim: gdbinit: hoist setup to common code

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.
This commit is contained in:
Mike Frysinger 2022-02-17 00:35:31 -05:00
parent 144459531d
commit 216722984f
12 changed files with 11 additions and 70 deletions

View 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)

9
sim/bpf/configure vendored
View File

@ -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" ;;

View 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

3
sim/configure vendored
View File

@ -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

View 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

View File

@ -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 ()

View 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

9
sim/mips/configure vendored
View File

@ -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" ;;

View File

@ -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" ;;

9
sim/or1k/configure vendored
View File

@ -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" ;;

9
sim/riscv/configure vendored
View File

@ -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" ;;

9
sim/v850/configure vendored
View File

@ -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" ;;