[PATCH v3] gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.exp

Tom de Vries tdevries@suse.de
Fri Jun 23 11:36:02 GMT 2023


On 6/23/23 00:52, Thiago Jung Bauermann wrote:
> 
> Bruno Larsen <blarsen@redhat.com> writes:
> 
>> On 06/06/2023 01:28, Thiago Jung Bauermann wrote:
>>> This testcase sometimes gets stuck in a loop for hours when running in our
>>> CI.  The problem is that due to an issue unrelated to reverse debugging the
>>> inferior exits early, and because of the overly generic ".*" pattern the
>>> testcase keeps sending the "next" command without noticing that the
>>> inferior is gone.
>>>
>>> gdb_test_multiple has a pattern to detect that "The program is not being
>>> run.", but since it is placed after the patterns from the caller it won't
>>> be triggered.  It also has a timeout pattern but because it is triggered
>>> between successful matches, each time the test matches the '-re -wrap ".*"'
>>> this counts as a successful match and the timeout is reset.
>>>
>>> Since the test binary is compiled with debug information, fix by changing
>>> one of the generic patterns to match entering the main function and the
>>> other one to match the source code line number that is shown by GDB right
>>> after the "step" command.
>>>
>>> Also, as a precaution add a maximum number of times the "next" command will
>>> be sent.
>>>
>>> Co-Authored-By: Tom de Vries <tdevries@suse.de>
>>> ---
>>
>> Thanks for fixing all the nits, looks good to me now. Reviewed-By: Bruno Larsen
>> <blarsen@redhat.com>
>>
>> (Just making sure you know, the rb tag is not enough to push, you need an approval)
> 

Hi,

LGTM, thanks.

Approved-By: Tom de Vries <tdevries@suse.de>

- Tom



More information about the Gdb-patches mailing list