This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb.mi/mi-nonstop.exp: fix racy tests (PR testsuite/12649)
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>, Marek Polacek <mpolacek at redhat dot com>
- Date: Thu, 26 May 2011 17:32:05 +0100
- Subject: Re: [PATCH] gdb.mi/mi-nonstop.exp: fix racy tests (PR testsuite/12649)
- References: <4DD4F3B7.2070003@redhat.com> <m34o4h1ldc.fsf@fleche.redhat.com>
> >>>>> "Marek" == Marek Polacek <mpolacek@redhat.com> writes:
>
> Marek> 2011-05-19 Marek Polacek <mpolacek@redhat.com>
> Marek> * gdb.mi/mi-nonstop.exp: Use the send_gdb+gdb_expect or mi_gdb_test
> Marek> instead of the gdb_test_multiple.
>
> Marek> set supported 0
> Marek> -gdb_test_multiple "-gdb-show non-stop" "" {
> Marek> - -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
> Marek> +send_gdb "-gdb-show non-stop\n"
> Marek> +gdb_expect {
> Marek> + -re "\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
> Marek> if { $expect_out(1,string) == "1" } {
> Marek> set supported 1
> Marek> }
> Marek> }
> Marek> + -re "\\^done,value=\"off\"\r\n$mi_gdb_prompt$" {
> Marek> + }
> Marek> -re ".*$mi_gdb_prompt$" {
> Marek> + fail "-gdb-show non-stop"
> Marek> }
> Marek> }
This pattern appears in all the MI non-stop tests. It'd be nice
to move it to mi-support.exp (ideally in a preparatory patch
that just does the factoring/moving, and nothing else.)
>
> Marek> -gdb_test_multiple "-exec-interrupt --thread 1" "interrupted" {
> Marek> +send_gdb "-exec-interrupt --thread 1\n"
> Marek> +gdb_expect {
> Marek> -re "\\^done\r\n$mi_gdb_prompt\\*stopped\[^\r\n\]+\r\n$" {
> Marek> pass "interrupted"
> Marek> }
> Marek> }
Can you use gdb_mi_expect_interrupt (+mi_gdb_test)? See mi-nsinterall.exp.
--
Pedro Alves