[PATCH][gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10
Tom de Vries
tdevries@suse.de
Thu Jan 28 17:50:05 GMT 2021
On 1/28/21 4:03 PM, Simon Marchi wrote:
>
>
> On 2021-01-26 1:03 p.m., Tom de Vries wrote:
>> Hi,
>>
>> When running test-case gdb.opt/solib-intra-step.exp with target board
>> unix/-m32 and gcc-10, I run into:
>> ...
>> (gdb) step^M
>> __x86.get_pc_thunk.bx () at ../sysdeps/i386/crti.S:68^M
>> 68 ../sysdeps/i386/crti.S: No such file or directory.^M
>> (gdb) step^M
>> shlib_second (dummy=0) at solib-intra-step-lib.c:23^M
>> 23 abort (); /* second-hit */^M
>> (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit
>> ...
>>
>> The problem is that the test-case expects to step past the retry line,
>> which is optional.
>>
>> Fix this by make the retry line step optional, both for shlib_first and
>> shlib_second.
>>
>> Any comments?
>>
>> Thanks,
>> - Tom
>>
>> [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp with -m32 and gcc-10
>>
>> gdb/testsuite/ChangeLog:
>>
>> 2021-01-26 Tom de Vries <tdevries@suse.de>
>>
>> * gdb.opt/solib-intra-step.exp: Make step into retry line optional.
>>
>> ---
>> gdb/testsuite/gdb.opt/solib-intra-step.exp | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp
>> index ad19895d890..13e0cf04c7a 100644
>> --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp
>> +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp
>> @@ -63,7 +63,7 @@ gdb_test_multiple "step" $test {
>> exp_continue
>> }
>> -re -wrap "get_pc_thunk.*" {
>> - if { $state != 1 } {
>> + if { $state != 0 && $state != 1 } {
>> set state -1
>> } else {
>> set state 2
>> @@ -89,7 +89,7 @@ gdb_test_multiple "step" $test {
>> exp_continue
>> }
>> -re -wrap "get_pc_thunk.*" {
>> - if { $state != 1 } {
>> + if { $state != 0 && $state != 1 } {
>> set state -1
>> } else {
>> set state 2
>>
>
> I don't really understand what happens here, what state value means what.
>
> A bit of commenting would help.
I tried to add comments but didn't manage to come up with something
sensible.
Instead, I simplified gdb_test_multiple to just track the order of
events, and then added a few asserts about order of events.
I hope this clarifies what the test is trying to do. WDYT?
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-gdb-testsuite-Fix-gdb.opt-solib-intra-step.exp-with-m32-and-gcc-10.patch
Type: text/x-patch
Size: 3149 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20210128/4e2bac1d/attachment-0001.bin>
More information about the Gdb-patches
mailing list