This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/4] gdbserver: Make `make TAGS' actually work
- From: "Maciej W. Rozycki" <macro at wdc dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jim Wilson <jimw at sifive dot com>, Andrew Burgess <andrew dot burgess at embecosm dot com>, Palmer Dabbelt <palmer at dabbelt dot com>, Tom Tromey <tom at tromey dot com>, guoren at kernel dot org, lifang_xia at c-sky dot com, yunhai_shang at c-sky dot com, jiangshuai_li at c-sky dot com
- Date: Thu, 23 Jan 2020 19:41:26 +0000 (GMT)
- Subject: [PATCH 3/4] gdbserver: Make `make TAGS' actually work
- Ironport-sdr: p+qKZzGvRAzhyYBxERBJjruQ1fPhnD4ztQJ7z+2TkChE7PILt4Suu/Lq8PzV/63jmO8Rg7EYob LdWWtPy0ETsMeGbkQq7sTBfpCM6xO0kd5Y5mKdMGCoaiVzRh+Y+AXlpgNJKdoTGyYK5uXIeA5j ieVhQF630Kp6H6EHEe1QgvydiURAHi8sBm1OtYCEm1AMlj6T2e2KcU4RmrRA9cnKP6i9+xBvPi 9+0GficUvcC+5z7bvgqxxQHYO/2f4jkBIjneX3wjtCo9QqyjF/Vx6psxe0iJvZGSWH+cwCov0d EzE=
- Ironport-sdr: XdWroLT9BjaNjqICFKPum5F8twCcKevBx2IRemSiiqhtvrVv0t3fSfH89krY16EeulGbs02xlP kggIR/eFcPsPS8vNq52DKoumYHk+xajlDGAivzx9UE4EedNOvx1l6LmOPjarzK1N2m5+P0S9R6 UAwbH09sUhlj+zuI3t52+Cff4hpB3I0a9n2nV6B7g/BKgBEjaHn+8ob4zebgsmmj1iqVxWJec+ MBTxOtHyIqR2zSEfZBbhvJdE4eZJka9pio3W7J62Gy4ZQ/Eb87D3cZK1ge7HhJ8UIkpwoRU8YF fK763CeSSqjWZOsAQPyCImWS
- Ironport-sdr: j+5fJcGRHo8tAXqSX1w1DD7xdDdig+4vYHtEnTCJ6rrrXPsNubpN5TKjJd7VuwuV8+9LAZAO1q kOY/q7/NO/lvnk6NqYSZi0SbWotPVHVYQ7QDP447azqd8ZVb+FrCKWvUmXxExgLWsrWjjCV1XB /C66posqYfUgwGkHrj7xrdVBOPWtsNyo7HtRK6ixqHtiSQOTdKvH455ra5XpL0hweO7QTY8Kph CbiynnwnqbsJlIaIyM8dJ1lxY+NCtsoIPtJeXhpKAYReWuKftKLSyQhM/hBFlkzdldCkC/NMPC w2c=
- References: <alpine.LFD.2.21.2001231412510.14118@redsun52.ssa.fujisawa.hgst.com>
- Wdcironportexception: Internal
Fix a:
make: *** No rule to make target '.../gdb/gdbserver/arch/arm.c', needed by 'TAGS'. Stop.
error produced by `make TAGS' by making the list of sources processed
match actual file locations and by moving host-specific object files
listed in DEPFILES to nat/ or target/ subdirectories as appropriate so
that the location of the corresponding source file can be mechanically
determined.
gdb/gdbserver/
* Makefile.in (SFILES): Adjust paths to point to real files.
(OBS): Move waitstatus.o to target/waitstatus.o.
(TAGS): Transform paths appropriately.
(%.o): Rename to...
(nat/%.o): ... this pattern rule.
(%.o): Rename to...
(target/%.o): ... this pattern rule.
* configure.srv: Adjust paths throughout to include nat/ prefix
with the revant files.
* configure.ac: Add `nat' and `target' to CONFIG_SRC_SUBDIR.
* configure: Regenerate.
---
Hi,
NB SFILES is only maintained for the purpose of `make TAGS', so I could
not persuade myself to put deliberate breakage there. I find it amazing
and amusing nobody has noticed that for many years and just been blindly
putting gibberish there.
Maciej
---
gdb/gdbserver/Makefile.in | 36 +++++++++++++++++---------------
gdb/gdbserver/configure | 2 -
gdb/gdbserver/configure.ac | 2 -
gdb/gdbserver/configure.srv | 49 ++++++++++++++++++++++++++------------------
4 files changed, 51 insertions(+), 38 deletions(-)
gdb-gdbserver-sfiles-paths.diff
Index: binutils-gdb/gdb/gdbserver/Makefile.in
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/Makefile.in
+++ binutils-gdb/gdb/gdbserver/Makefile.in
@@ -198,11 +198,11 @@ SFILES = \
$(srcdir)/win32-low.c \
$(srcdir)/wincecompat.c \
$(srcdir)/x86-low.c \
- $(srcdir)/arch/arm.c \
- $(srcdir)/arch/arm-get-next-pcs.c \
- $(srcdir)/arch/arm-linux.c \
- $(srcdir)/arch/ppc-linux-common.c \
$(srcdir)/../alloc.c \
+ $(srcdir)/../arch/arm.c \
+ $(srcdir)/../arch/arm-get-next-pcs.c \
+ $(srcdir)/../arch/arm-linux.c \
+ $(srcdir)/../arch/ppc-linux-common.c \
$(srcdir)/../../gdbsupport/btrace-common.c \
$(srcdir)/../../gdbsupport/buffer.c \
$(srcdir)/../../gdbsupport/cleanups.c \
@@ -229,15 +229,15 @@ SFILES = \
$(srcdir)/../../gdbsupport/safe-strerror.c \
$(srcdir)/../../gdbsupport/tdesc.c \
$(srcdir)/../../gdbsupport/xml-utils.c \
- $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
- $(srcdir)/nat/linux-btrace.c \
- $(srcdir)/nat/linux-namespaces.c \
- $(srcdir)/nat/linux-osdata.c \
- $(srcdir)/nat/linux-personality.c \
- $(srcdir)/nat/mips-linux-watch.c \
- $(srcdir)/nat/ppc-linux.c \
- $(srcdir)/nat/fork-inferior.c \
- $(srcdir)/target/waitstatus.c
+ $(srcdir)/../nat/aarch64-sve-linux-ptrace.c \
+ $(srcdir)/../nat/linux-btrace.c \
+ $(srcdir)/../nat/linux-namespaces.c \
+ $(srcdir)/../nat/linux-osdata.c \
+ $(srcdir)/../nat/linux-personality.c \
+ $(srcdir)/../nat/mips-linux-watch.c \
+ $(srcdir)/../nat/ppc-linux.c \
+ $(srcdir)/../nat/fork-inferior.c \
+ $(srcdir)/../target/waitstatus.c
DEPFILES = @GDBSERVER_DEPFILES@
@@ -295,7 +295,7 @@ OBS = \
tracepoint.o \
utils.o \
version.o \
- waitstatus.o \
+ target/waitstatus.o \
$(DEPFILES) \
$(LIBOBJS) \
$(XML_BUILTIN)
@@ -459,7 +459,9 @@ TAGS: ${TAGFILES}
etags \
`for i in yzzy ${DEPFILES}; do \
if [ x$$i != xyzzy ]; then \
- echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
+ echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' \
+ -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
+ -e 's,/\(gdbsupport\)/,/../../\1/,'; \
fi; \
done` \
${TAGFILES}
@@ -633,11 +635,11 @@ gdbsupport/%.o: ../../gdbsupport/%.c
$(COMPILE) $<
$(POSTCOMPILE)
-%.o: ../nat/%.c
+nat/%.o: ../nat/%.c
$(COMPILE) $<
$(POSTCOMPILE)
-%.o: ../target/%.c
+target/%.o: ../target/%.c
$(COMPILE) $<
$(POSTCOMPILE)
Index: binutils-gdb/gdb/gdbserver/configure
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure
+++ binutils-gdb/gdb/gdbserver/configure
@@ -6025,7 +6025,7 @@ ac_config_commands="$ac_config_commands
# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport"
+CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
ac_config_commands="$ac_config_commands gdbdepdir"
Index: binutils-gdb/gdb/gdbserver/configure.ac
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure.ac
+++ binutils-gdb/gdb/gdbserver/configure.ac
@@ -56,7 +56,7 @@ ACX_NONCANONICAL_HOST
ZW_CREATE_DEPDIR
# Create sub-directories for objects and dependencies.
-CONFIG_SRC_SUBDIR="arch gdbsupport"
+CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
AC_SUBST(CONFIG_SRC_SUBDIR)
AC_CONFIG_COMMANDS([gdbdepdir],[
Index: binutils-gdb/gdb/gdbserver/configure.srv
===================================================================
--- binutils-gdb.orig/gdb/gdbserver/configure.srv
+++ binutils-gdb/gdb/gdbserver/configure.srv
@@ -28,21 +28,22 @@ ipa_ppc_linux_regobj="powerpc-32l-ipa.o
# Linux object files. This is so we don't have to repeat
# these files over and over again.
-srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-waitpid.o linux-personality.o linux-namespaces.o fork-child.o fork-inferior.o"
+srv_linux_obj="linux-low.o nat/linux-osdata.o nat/linux-procfs.o nat/linux-ptrace.o nat/linux-waitpid.o nat/linux-personality.o nat/linux-namespaces.o fork-child.o nat/fork-inferior.o"
# Input is taken from the "${target}" variable.
case "${target}" in
- aarch64*-*-linux*) srv_tgtobj="linux-aarch64-low.o aarch64-linux-hw-point.o"
+ aarch64*-*-linux*) srv_tgtobj="linux-aarch64-low.o"
+ srv_tgtobj="$srv_tgtobj nat/aarch64-linux-hw-point.o"
srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
srv_tgtobj="$srv_tgtobj linux-aarch32-tdesc.o"
srv_tgtobj="${srv_tgtobj} arch/aarch32.o"
srv_tgtobj="${srv_tgtobj} arch/arm.o"
- srv_tgtobj="$srv_tgtobj aarch64-linux.o"
+ srv_tgtobj="$srv_tgtobj nat/aarch64-linux.o"
srv_tgtobj="$srv_tgtobj arch/aarch64-insn.o"
srv_tgtobj="$srv_tgtobj arch/aarch64.o"
srv_tgtobj="$srv_tgtobj linux-aarch64-tdesc.o"
- srv_tgtobj="$srv_tgtobj aarch64-sve-linux-ptrace.o"
+ srv_tgtobj="$srv_tgtobj nat/aarch64-sve-linux-ptrace.o"
srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
srv_linux_regsets=yes
srv_linux_thread_db=yes
@@ -86,14 +87,18 @@ case "${target}" in
srv_linux_thread_db=yes
;;
i[34567]86-*-cygwin*) srv_regobj=""
- srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+ srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
+ srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
;;
i[34567]86-*-linux*) srv_tgtobj="${srv_tgtobj} arch/i386.o"
- srv_tgtobj="${srv_tgtobj} $srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
+ srv_tgtobj="${srv_tgtobj} linux-x86-low.o x86-low.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-dregs.o i387-fp.o"
srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
- srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
- srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
+ srv_tgtobj="${srv_tgtobj} nat/linux-btrace.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-linux.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-linux-dregs.o"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
@@ -102,13 +107,15 @@ case "${target}" in
ipa_obj="${ipa_obj} arch/i386-ipa.o"
;;
i[34567]86-*-lynxos*) srv_regobj=""
- srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o fork-inferior.o"
+ srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o"
+ srv_tgtobj="${srv_tgtobj} nat/fork-inferior.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_lynxos=yes
;;
i[34567]86-*-mingw32ce*)
srv_regobj=""
- srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+ srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
+ srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_tgtobj="${srv_tgtobj} wincecompat.o"
# hostio_last_error implementation is in win32-low.c
@@ -117,7 +124,7 @@ case "${target}" in
srv_mingwce=yes
;;
i[34567]86-*-mingw*) srv_regobj=""
- srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
+ srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o" srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_mingw=yes
;;
@@ -159,7 +166,7 @@ case "${target}" in
srv_regobj="${srv_regobj} mips64-linux.o"
srv_regobj="${srv_regobj} mips64-dsp-linux.o"
srv_tgtobj="$srv_linux_obj linux-mips-low.o"
- srv_tgtobj="${srv_tgtobj} mips-linux-watch.o"
+ srv_tgtobj="${srv_tgtobj} nat/mips-linux-watch.o"
srv_xmlfiles="mips-linux.xml"
srv_xmlfiles="${srv_xmlfiles} mips-dsp-linux.xml"
srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
@@ -203,7 +210,8 @@ case "${target}" in
srv_regobj="${srv_regobj} powerpc-isa205-ppr-dscr-vsx64l.o"
srv_regobj="${srv_regobj} powerpc-isa207-vsx64l.o"
srv_regobj="${srv_regobj} powerpc-isa207-htm-vsx64l.o"
- srv_tgtobj="$srv_linux_obj linux-ppc-low.o ppc-linux.o"
+ srv_tgtobj="$srv_linux_obj linux-ppc-low.o"
+ srv_tgtobj="$srv_linux_obj nat/ppc-linux.o"
srv_tgtobj="${srv_tgtobj} arch/ppc-linux-common.o"
srv_xmlfiles="rs6000/powerpc-32l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
@@ -350,12 +358,13 @@ case "${target}" in
srv_linux_thread_db=yes
;;
x86_64-*-linux*) srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o"
- srv_tgtobj="${srv_tgtobj} x86-dregs.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-dregs.o i387-fp.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o arch/amd64.o"
srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
- srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
- srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
- srv_tgtobj="${srv_tgtobj} amd64-linux-siginfo.o"
+ srv_tgtobj="${srv_tgtobj} nat/linux-btrace.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-linux.o"
+ srv_tgtobj="${srv_tgtobj} nat/x86-linux-dregs.o"
+ srv_tgtobj="${srv_tgtobj} nat/amd64-linux-siginfo.o"
srv_linux_usrregs=yes # This is for i386 progs.
srv_linux_regsets=yes
srv_linux_thread_db=yes
@@ -364,12 +373,14 @@ case "${target}" in
ipa_obj="${ipa_obj} arch/amd64-ipa.o"
;;
x86_64-*-mingw*) srv_regobj=""
- srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
+ srv_tgtobj="x86-low.o nat/x86-dregs.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch/amd64.o"
srv_mingw=yes
;;
x86_64-*-cygwin*) srv_regobj=""
- srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
+ srv_tgtobj="x86-low.o nat/x86-dregs.o i387-fp.o"
+ srv_tgtobj="${srv_tgtobj} win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch/amd64.o"
;;