This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] PR 15075 dprintf interferes with "next"


On Tue, May 28, 2013 at 11:36 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 05/28/2013 08:01 AM, Hui Zhu wrote:
>>>>
>>>> +gdb_test_multiple $test $test {
>>>> >>+    -re "interrupt\r\n$gdb_prompt " {
>>>> >>+     pass $test
>>>> >>+    }
>>>> >>+}
>>>> >>+
>>>> >>+set test "inferior stopped"
>>>> >>+gdb_test_multiple "" $test {
>>>> >>+    -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" {
>>>> >>+     pass $test
>>>> >>+    }
>>>> >>+}
>>>
>>> >
>>> >This leaves the prompt in the expect buffer.  I think
>>> >this is likely to confuse the following test that runs.
>>> >
>>
>> After change this part to:
>> gdb_test_multiple "" $test {
>>      -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n$gdb_prompt" {
>>         pass $test
>>      }
>> }
>> I got:
>> Running ../../../src/gdb/testsuite/gdb.base/dprintf-non-stop.exp ...
>> FAIL: gdb.base/dprintf-non-stop.exp: inferior stopped (timeout)
>>
>
> because the gdb_prompt has been consumed by the previous matching:
>
> gdb_test_multiple $test $test {
>     -re "interrupt\r\n$gdb_prompt " {
>                       ^^^^^^^^^^^^
>      pass $test
>
>     }
> }

I tried move $gdb_prompt to other part but still not work.

>
>> +set test "interrupt"
>> +gdb_test_multiple $test $test {
>> +    -re "interrupt\r\n$gdb_prompt " {
>> +       pass $test
>> +    }
>> +}
>> +
>> +set test "inferior stopped"
>> +gdb_test_multiple "" $test {
>> +    -re "\r\n\\\[.* \[0-9\]+\\\] #1 stopped\\\.\r\n" {
>> +       pass $test
>> +    }
>> +}
>
>
> I raise a question here that no one asked before, why don't combine these
> two gdb_test_multiple into one? like:
>
> set test "interrupt inferior"
> gdb_test_multiple "interrupt" $test {
>     -re "interrupt\r\n.*\\\[.* \[0-9\]+\\\] #1 stopped\\\." {
>         pass $test
>     }
> }

This cannot pass test with gdbserver.  I think that is why
async-shell.exp do something like it.

Thanks,
Hui


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]