public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
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	[thread overview]
Message-ID: <20220217054035.10127-1-vapier@gentoo.org> (raw)

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


             reply	other threads:[~2022-02-17  5:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17  5:40 Mike Frysinger [this message]
2022-02-22  3:09 ` Hans-Peter Nilsson
2022-02-22  3:29   ` Mike Frysinger
2022-02-22  3:36   ` [PATCH] sim: add arch/.gdbinit stub scripts Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220217054035.10127-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hp@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).