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: [PATCH v2] Add mi-threads-interrupt.exp test (PR 20039)


On 05/18/2016 02:27 PM, Simon Marchi wrote:

>> +  # Continue.
>> +  mi_gdb_test "565-exec-continue" "565\\^running\r\n\\*running,thread-id=\"all\"" "continue"
> 
> I was about to push this, but decided to run the test again.  For some reason, this line
> gives me a FAIL, which I didn't see before:
> 
>   FAIL: gdb.mi/mi-threads-interrupt.exp: continue
> 
> and I can't see what's wrong with:
> 
> 101 Expecting: ^(.*[^M
> 102 ]+)?(565\^running^M
> 103 \*running,thread-id="all"[^M
> 104 ]+[(]gdb[)] ^M
> 105 [ ]*)
> 106 565-exec-continue^M
> 107 565^running^M
> 108 *running,thread-id="all"^M
> 109 =thread-selected,id="3"^M
> 110 (gdb) ^M
> 111 FAIL: gdb.mi/mi-threads-interrupt.exp: continue
> 
> Changing this line to be
> 
>   mi_send_resuming_command "exec-continue" "continue"
> 
> makes it work, although I don't see why.  

The regex shown above, from mi_gdb_test:

...
 > 103 \*running,thread-id="all"[^M
 > 104 ]+[(]gdb[)] ^M
...

expects that nothing appears between the "*running" line
and the prompt.

Before the fix for PR 20045 (the spurious prompt),
you probably had:

 565-exec-continue^M
 565^running^M
 *running,thread-id="all"^M
 (gdb) ^M                        <<<<<<<<< spurious prompt
 =thread-selected,id="3"^M
 (gdb) ^M

which made the mi_gdb_test match output until the first
prompt.  That is, as if the output was:

 565-exec-continue^M
 565^running^M
 *running,thread-id="all"^M
 (gdb) ^M

But now without the spurious prompt we have:

 565-exec-continue^M
 565^running^M
 *running,thread-id="all"^M
 =thread-selected,id="3"^M
 (gdb) ^M

which no longer matches.

Does it sound like a good change?

It does.

> 
>> +  if { $async } {
>> +    # Workaround for PR 20045, where -exec-continue will output two (gdb) prompts
>> +    # when in "mi-async on" mode.  This mi_gdb_test will consume the extra (gdb).
>> +    # Once that bug is fixed, this can be removed.
>> +    mi_gdb_test
>> +  }
> 
> I'll remove this, since I'll put the fix for 20045 before this patch.
> 

BTW, noticed a missing space-before-parens:

>> +int
>> +main(void)

Thanks,
Pedro Alves


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