This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA/testsuite] Workaround timeout in default.exp


> > 2004-05-18  J. Brobecker  <brobecker@gnat.com>
> > 
> > 	* gdb.base/default.exp: Rewrite a couple of tests to work-around
> > 	a problem that causes this test and all the following tests to
> > 	timeout.
> > 
> > Tested on AIX 5.1 and x86-linux. Would that be OK to apply?
> 
> Rather than adding a FIXME, let me try to explain what is going on.

OK.

> The first part is a guess.  For some reason, the pattern "\(gdb\) $"
> never matches on GNU/Linux but does on AIX and Solaris.  I presume this
> is because of some difference in the pseudo-TTY layer or in the
> standard I/O library, which causes characters to be send in smaller
> batches.  So at some point on those systems, the buffer ends with the
> prompt.

There may be a crack in your theory, because there something it doesn't
explain. When I use the simple send_gdb/gdb_expect sequence, then I get
the whole output, ie the differences you are mentioning do not come into
play. I verified this by using expect_out.

I tried your suggestion, without much luck so far. Here is what I have
tried:

    print "DEBUG: Starting test...."
    gdb_test_multiple "info set" "info set" {
      -re "confirm:  Whether to confirm potentially dangerous operations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename:  The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize:  Number of source lines gdb will list by default is 10.*prompt:  Gdb's " {
        global saw_good_text
        set saw_good_text 1
        print "DEBUG: First part of output found."
        exp_continue
      }
      -re "prompt is \"$gdb_prompt \"" {
        print "DEBUG: Line with GDB prompt."
        exp_continue
      }
      -re "$gdb_prompt $" {
        global saw_good_text
        print "DEBUG: Final part of output."
        if {$saw_good_text} {
          pass "test name"
        } else {
          fail "test name (unknown output)"
        }
      }
    }

But none of the regexp matched (no DEBUG: output besides the first
one before gdb_test_multiple), and it eventually timedout.

I tried with verbose set to 3, and that gives me the following output.
First, it prints:

        Running ./gdb.base/joel.exp ...
        DEBUG: Starting test....
        Sending "info set" to gdb
        Looking to match ""confirm:  Whether to confirm potentially dangerous operations is o[a-z]*.([^\r\n]*[\r\n])+history filename:  The filename in which to record the command history is ([^\r\n]*[\r\n])+listsize:  Number of source lines gdb will list by default is 10.*prompt:  Gdb's "; "prompt is "\(gdb\) ""; "\(gdb\) $""
        Message is "info set"
        board_info host exists name
        board_info host name 
        getting cam name
        board_info cam exists name
        board_info cam exists protocol
        board_info cam generic_name 
        getting cam generic_name
        call_remote  send cam {info set
        } 
        board_info cam file_transfer 
        getting cam file_transfer
        board_info cam connect 
        getting cam connect
        call_remote calling standard_send
        board_info cam exists fileid
        board_info cam fileid 
        getting cam fileid
        shell_id in standard_send is 6
        board_info cam fileid 
        getting cam fileid
        send -i 6 -- {info set
        }
        board_info cam fileid 
        getting cam fileid
        board_info target exists gdb,timeout
        board_info host fileid 
        getting cam fileid

At which point we get stuck for a while, and then we receive the rest
of the output:

        FAIL: gdb.base/joel.exp: info set (timeout)
        Quitting /cam.a/brobecke/gdb-public/gdb/testsuite/../../gdb/gdb -nx
        [rest of output snip'ed]

-- 
Joel


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