[PATCH][gdb/testsuite] Fix g0 search in gdb.arch/i386-sse-stack-align.exp
Simon Marchi
simon.marchi@polymtl.ca
Thu Jan 28 16:23:40 GMT 2021
On 2021-01-28 11:21 a.m., Tom de Vries wrote:
> On 1/28/21 4:04 PM, Simon Marchi wrote:
>>
>>
>> On 2021-01-26 1:03 p.m., Tom de Vries wrote:
>>> Hi,
>>>
>>> When running test-case gdb.arch/i386-sse-stack-align.exp on target board
>>> unix/-m32, I run into:
>>> ...
>>> (gdb) print (int) g0 ()^M
>>> Invalid data type for function to be called.^M
>>> (gdb) FAIL: gdb.arch/i386-sse-stack-align.exp: print (int) g0 ()
>>> ...
>>>
>>> Gdb is supposed to use minimal symbol g0:
>>> ...
>>> $ nm i386-sse-stack-align | grep g0
>>> 08049194 t g0
>>> ...
>>> but instead it finds a g0 symbol in the debug info of libm, specifically in
>>> ./sysdeps/ieee754/ldbl-96/e_lgammal_r.c.
>>>
>>> Fix this by disabling reading symbols for shared libs.
>>>
>>> Tested on x86_64-linux.
>>>
>>> Any comments?
>>>
>>> Thanks,
>>> - Tom
>>>
>>> [gdb/testsuite] Fix g0 search in gdb.arch/i386-sse-stack-align.exp
>>>
>>> gdb/testsuite/ChangeLog:
>>>
>>> 2021-01-26 Tom de Vries <tdevries@suse.de>
>>>
>>> * gdb.arch/i386-sse-stack-align.exp: Set auto-solib-add to off.
>>>
>>> ---
>>> gdb/testsuite/gdb.arch/i386-sse-stack-align.exp | 5 +++++
>>> 1 file changed, 5 insertions(+)
>>>
>>> diff --git a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
>>> index 2c1cdd89c70..57dd12f9830 100644
>>> --- a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
>>> +++ b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
>>> @@ -37,6 +37,11 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts
>>>
>>> clean_restart $executable
>>>
>>> +# With libm debug info installed, I get a g0 from
>>> +# ./sysdeps/ieee754/ldbl-96/e_lgammal_r.c instead of the local g0.
>>> +# Fix this by disabling reading symbols for shared libs.
>>> +gdb_test_no_output "set auto-solib-add off"
>>> +
>>> if ![runto_main] then {
>>> return -1
>>> }
>>>
>>
>> Couldn't we simply use some less common, more scoped name?
>>
>
> Yep, that also works. How about this?
>
> Thanks,
> - Tom
>
>
Yep, that LGTM.
Simon
More information about the Gdb-patches
mailing list