This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
- From: Tom de Vries <tdevries at suse dot de>
- To: gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Fri, 21 Jun 2019 17:27:43 +0200
- Subject: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
Hi,
When building gdb using a combined gcc/binutils-gdb build and running
gdb.base/index-cache.exp we get:
...
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: couldn't get executable build id
FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats
...
With "set debug index-cache on" we get:
...
(gdb) file index-cache
Reading symbols from index-cache...
index cache: objfile index-cache has no build id
...
The problem is that the vanilla toolchain does not add a build-id, which is
required for the index-cache functionality.
Fix this by compiling index-cache.c with -Wl,--build-id.
Tested on x86_64-linux.
OK for trunk?
Thanks,
- Tom
[gdb/testsuite] Compile index-cache.c with -Wl,--build-id
gdb/testsuite/ChangeLog:
2019-06-21 Tom de Vries <tdevries@suse.de>
* gdb.base/index-cache.exp: Add additional_flags=-Wl,--build-id.
---
gdb/testsuite/gdb.base/index-cache.exp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 075dffe3f5..6f1488e037 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -18,7 +18,8 @@
standard_testfile
-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
+ {additional_flags=-Wl,--build-id}] } {
return
}