aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-04-19 13:19:41 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-04-19 13:23:32 -0400
commitf31c089e788f7b45c9030ac399cd34eb3ccdb9c1 (patch)
tree16d1978a261b8c1f89afe3dde7d402ec8be69e34 /gdb/gdbserver
parentd83d54033545c0e7b668950b127753c88a33f950 (diff)
downloadgdb-f31c089e788f7b45c9030ac399cd34eb3ccdb9c1.zip
gdb-f31c089e788f7b45c9030ac399cd34eb3ccdb9c1.tar.gz
gdb-f31c089e788f7b45c9030ac399cd34eb3ccdb9c1.tar.bz2
Fix dependency tracking in gdbserver subdirectories
The dependency tracking (the thing that knows which source file included which other source file during last build to know what to rebuild when an included file changes) is broken for gdbserver subdirectories (arch and common). The dependency tracking files are created in the form arch/.deps/i386.Po but we try to include .deps/arch/i386.Po An easy smoke test is too "touch" the gdb/features/i386/32bit-core.c file in the source directory and try to rebuild gdbserver. This file is included by gdb/arch/i386.c, so it should cause gdb/gdbserver/arch/i386.o in the build directory to be rebuilt. It currently isn't rebuilt, but is with this patch applied. This patch copies the technique used in GDB to transform the dep file paths to the proper form. Also, while testing using the depcomp method of dependency tracking (by just hacking the condition), I noticed that depcomp was not found. The path to depcomp seems to be missing a "..". gdb/gdbserver/ChangeLog: * Makefile.in (depcomp): Add "..". (all_deps_files): New and use it.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/Makefile.in8
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 9d2d049..5557532 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-19 Simon Marchi <simon.marchi@ericsson.com>
+
+ * Makefile.in (depcomp): Add "..".
+ (all_deps_files): New and use it.
+
2018-04-18 Alan Hayward <alan.hayward@arm.com>
* configure.srv (aarch64*-*-linux*): Don't include xml.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 4a54235..c377378 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -62,7 +62,7 @@ AR_FLAGS = rc
# Dependency tracking information.
DEPMODE = @CCDEPMODE@
DEPDIR = @DEPDIR@
-depcomp = $(SHELL) $(srcdir)/../depcomp
+depcomp = $(SHELL) $(srcdir)/../../depcomp
# Directory containing source files. Don't clean up the spacing,
# this exact string is matched for by the "configure" script.
@@ -652,8 +652,12 @@ else
$(all_object_files) : $(generated_files)
endif
+# All the .deps files to include.
+all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
+ $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
+
# Dependencies.
--include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
+-include $(all_deps_files)
# Disable implicit make rules.
include $(srcdir)/../disable-implicit-rules.mk