* [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
@ 2019-06-21 15:27 Tom de Vries
2019-06-21 15:47 ` Pedro Alves
0 siblings, 1 reply; 9+ messages in thread
From: Tom de Vries @ 2019-06-21 15:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
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
}
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 15:27 [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id Tom de Vries
@ 2019-06-21 15:47 ` Pedro Alves
2019-06-21 15:53 ` Simon Marchi
2019-06-21 15:54 ` Tom de Vries
0 siblings, 2 replies; 9+ messages in thread
From: Pedro Alves @ 2019-06-21 15:47 UTC (permalink / raw)
To: Tom de Vries, gdb-patches; +Cc: Simon Marchi
On 6/21/19 4:27 PM, Tom de Vries wrote:
> 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.
What is "vanilla" here? A non-combined gcc/build-gdb build?
Or is "combined gcc/build-gdb build" irrelevant here, and
"vanilla" means "no-distro-patches build"? Was the testcase
written on a system with a compiler that defaults to --build-id ?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 15:47 ` Pedro Alves
@ 2019-06-21 15:53 ` Simon Marchi
2019-06-21 15:54 ` Tom de Vries
1 sibling, 0 replies; 9+ messages in thread
From: Simon Marchi @ 2019-06-21 15:53 UTC (permalink / raw)
To: Pedro Alves, Tom de Vries, gdb-patches
On 2019-06-21 11:47 a.m., Pedro Alves wrote:
> Was the testcase
> written on a system with a compiler that defaults to --build-id ?
Yes, gcc on Ubuntu (which I use) is compiled with --enable-linker-build-id.
I think it's correct to change the test case to not assume the linker generates a build-id by default.
Simon
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 15:47 ` Pedro Alves
2019-06-21 15:53 ` Simon Marchi
@ 2019-06-21 15:54 ` Tom de Vries
2019-06-21 16:32 ` Pedro Alves
1 sibling, 1 reply; 9+ messages in thread
From: Tom de Vries @ 2019-06-21 15:54 UTC (permalink / raw)
To: Pedro Alves, gdb-patches; +Cc: Simon Marchi
On 21-06-19 17:47, Pedro Alves wrote:
> On 6/21/19 4:27 PM, Tom de Vries wrote:
>> 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.
>
> What is "vanilla" here? A non-combined gcc/build-gdb build?
> Or is "combined gcc/build-gdb build" irrelevant here, and
> "vanilla" means "no-distro-patches build"?
The latter.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 15:54 ` Tom de Vries
@ 2019-06-21 16:32 ` Pedro Alves
2019-06-21 16:51 ` Tom de Vries
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2019-06-21 16:32 UTC (permalink / raw)
To: Tom de Vries, gdb-patches; +Cc: Simon Marchi
On 6/21/19 4:54 PM, Tom de Vries wrote:
> On 21-06-19 17:47, Pedro Alves wrote:
>> On 6/21/19 4:27 PM, Tom de Vries wrote:
>>> 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.
>>
>> What is "vanilla" here? A non-combined gcc/build-gdb build?
>> Or is "combined gcc/build-gdb build" irrelevant here, and
>> "vanilla" means "no-distro-patches build"?
>
> The latter.
OK. Please tweak the commit log in that direction then.
The fix LGTM too.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 16:32 ` Pedro Alves
@ 2019-06-21 16:51 ` Tom de Vries
2019-06-21 16:51 ` Tom de Vries
2019-06-25 19:06 ` Testcase regression (gdb.base/index-cache.exp) on x86_64 (was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id) Sergio Durigan Junior
0 siblings, 2 replies; 9+ messages in thread
From: Tom de Vries @ 2019-06-21 16:51 UTC (permalink / raw)
To: Pedro Alves, gdb-patches; +Cc: Simon Marchi
On 21-06-19 18:32, Pedro Alves wrote:
> On 6/21/19 4:54 PM, Tom de Vries wrote:
>> On 21-06-19 17:47, Pedro Alves wrote:
>>> On 6/21/19 4:27 PM, Tom de Vries wrote:
>>>> 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.
>>>
>>> What is "vanilla" here? A non-combined gcc/build-gdb build?
>>> Or is "combined gcc/build-gdb build" irrelevant here, and
>>> "vanilla" means "no-distro-patches build"?
>>
>> The latter.
>
> OK. Please tweak the commit log in that direction then.
>
> The fix LGTM too.
Thanks for the review, I've updated the rationale.
I'll commit in a bit unless there are further comments.
Thanks,
- Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id
2019-06-21 16:51 ` Tom de Vries
@ 2019-06-21 16:51 ` Tom de Vries
2019-06-25 19:06 ` Testcase regression (gdb.base/index-cache.exp) on x86_64 (was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id) Sergio Durigan Junior
1 sibling, 0 replies; 9+ messages in thread
From: Tom de Vries @ 2019-06-21 16:51 UTC (permalink / raw)
To: Pedro Alves, gdb-patches; +Cc: Simon Marchi
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
[ENOPATCH]
On 21-06-19 18:50, Tom de Vries wrote:
> On 21-06-19 18:32, Pedro Alves wrote:
>> On 6/21/19 4:54 PM, Tom de Vries wrote:
>>> On 21-06-19 17:47, Pedro Alves wrote:
>>>> On 6/21/19 4:27 PM, Tom de Vries wrote:
>>>>> 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.
>>>>
>>>> What is "vanilla" here? A non-combined gcc/build-gdb build?
>>>> Or is "combined gcc/build-gdb build" irrelevant here, and
>>>> "vanilla" means "no-distro-patches build"?
>>>
>>> The latter.
>>
>> OK. Please tweak the commit log in that direction then.
>>
>> The fix LGTM too.
>
> Thanks for the review, I've updated the rationale.
>
> I'll commit in a bit unless there are further comments.
>
[-- Attachment #2: 0001-gdb-testsuite-Compile-index-cache.c-with-Wl-build-id.patch --]
[-- Type: text/x-patch, Size: 1451 bytes --]
[gdb/testsuite] Compile index-cache.c with -Wl,--build-id
When testing gdb.base/index-cache.exp using a gcc build without
--enable-linker-build-id 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 find:
...
(gdb) file index-cache
Reading symbols from index-cache...
index cache: objfile index-cache has no build id
...
The problem is that a build-id is required for the index-cache functionality.
Fix this by compiling index-cache.c with -Wl,--build-id.
Tested on x86_64-linux.
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
}
^ permalink raw reply [flat|nested] 9+ messages in thread* Testcase regression (gdb.base/index-cache.exp) on x86_64 (was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id)
2019-06-21 16:51 ` Tom de Vries
2019-06-21 16:51 ` Tom de Vries
@ 2019-06-25 19:06 ` Sergio Durigan Junior
2019-06-26 3:55 ` [committed][gdb/testsuite] Add back missing debug for index-cache.exp Tom de Vries
1 sibling, 1 reply; 9+ messages in thread
From: Sergio Durigan Junior @ 2019-06-25 19:06 UTC (permalink / raw)
To: Tom de Vries; +Cc: Pedro Alves, gdb-patches, Simon Marchi
On Friday, June 21 2019, Tom de Vries wrote:
> Thanks for the review, I've updated the rationale.
>
> I'll commit in a bit unless there are further comments.
Hi Tom,
This has caused a testcase regression on x86_64. It was caught by the
BuildBot:
https://sourceware.org/ml/gdb-testers/2019-q2/msg06515.html
The failures are:
PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats
PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created
PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache stats
PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
^ permalink raw reply [flat|nested] 9+ messages in thread
* [committed][gdb/testsuite] Add back missing debug for index-cache.exp
2019-06-25 19:06 ` Testcase regression (gdb.base/index-cache.exp) on x86_64 (was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id) Sergio Durigan Junior
@ 2019-06-26 3:55 ` Tom de Vries
0 siblings, 0 replies; 9+ messages in thread
From: Tom de Vries @ 2019-06-26 3:55 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: Pedro Alves, gdb-patches, Simon Marchi
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
[ was: Re: Testcase regression (gdb.base/index-cache.exp) on x86_64
(was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with
-Wl,--build-id) ]
On 25-06-19 21:06, Sergio Durigan Junior wrote:
> On Friday, June 21 2019, Tom de Vries wrote:
>
>> Thanks for the review, I've updated the rationale.
>>
>> I'll commit in a bit unless there are further comments.
>
> Hi Tom,
>
> This has caused a testcase regression on x86_64. It was caught by the
> BuildBot:
>
> https://sourceware.org/ml/gdb-testers/2019-q2/msg06515.html
>
> The failures are:
>
> PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats
> PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created
> PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: check index-cache stats
> PASS -> FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: expected file is there
>
Fixed by patch attached below.
Committed.
Thanks,
- Tom
[-- Attachment #2: 0001-gdb-testsuite-Add-back-missing-debug-for-index-cache.exp.patch --]
[-- Type: text/x-patch, Size: 1193 bytes --]
[gdb/testsuite] Add back missing debug for index-cache.exp
The proc prepare_for_testing has "debug" as default argument for the options
parameter.
In the commit c596f180a1 "[gdb/testsuite] Compile index-cache.c with
-Wl,--build-id", by setting the options argument we've effectively dropped
"debug". This causes index-cache.exp to not contain any debug info anymore on
most systems (though not on openSUSE), which causes index-cache.exp FAILs.
Fix this by adding back the missing "debug" option.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-06-26 Tom de Vries <tdevries@suse.de>
* gdb.base/index-cache.exp: Add back missing debug option.
---
gdb/testsuite/gdb.base/index-cache.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/index-cache.exp b/gdb/testsuite/gdb.base/index-cache.exp
index 6f1488e037..f14cbb01ef 100644
--- a/gdb/testsuite/gdb.base/index-cache.exp
+++ b/gdb/testsuite/gdb.base/index-cache.exp
@@ -19,7 +19,7 @@
standard_testfile
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- {additional_flags=-Wl,--build-id}] } {
+ {debug additional_flags=-Wl,--build-id}] } {
return
}
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-06-26 3:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21 15:27 [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id Tom de Vries
2019-06-21 15:47 ` Pedro Alves
2019-06-21 15:53 ` Simon Marchi
2019-06-21 15:54 ` Tom de Vries
2019-06-21 16:32 ` Pedro Alves
2019-06-21 16:51 ` Tom de Vries
2019-06-21 16:51 ` Tom de Vries
2019-06-25 19:06 ` Testcase regression (gdb.base/index-cache.exp) on x86_64 (was: Re: [PATCH][gdb/testsuite] Compile index-cache.c with -Wl,--build-id) Sergio Durigan Junior
2019-06-26 3:55 ` [committed][gdb/testsuite] Add back missing debug for index-cache.exp Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox