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: [RFA/testsuite] Reset the timeout duration at the start of each testcase.


> > Joel> gdb/testsuite/ChangeLog:
> > Joel>         * lib/gdb.exp (default_test_timeout): New global variable.
> > Joel>         Set it to timeout if not already set.
> > Joel>         (gdb_init): Reset the value of timeout to default_test_timeout.
> > 
> > Joel> OK to apply?
> > 
> > FWIW, it seems reasonable to me.
> 
> Ditto.  This will even work with existing board files that "set timeout".

I haven't looked when the board files are evaluated, so I'm missing
the point. I am wondering if this has an effect on the following:

Just something that occured to me: What if I changed the implementation
to just store $timeout at the time gdb.exp is evaluated. From the user's
perspective, the difference is that he would need to override the value
of $timeout, which is an already-known variable, instead of setting the
value of the new default_test_timeout variable.  Would that be ugly?

This isn't tested (it's getting late here), but this is what I have
in mind:

    # The default timeout used when testing GDB commands.  We want to use
    # the same timeout as the default dejagnu timeout, unless the user has
    # already overridden it with a new value (probably through a site.exp
    # file).  Either way, $timeout if the timeout value we should use.
    global default_test_timeout
    set default_test_timeout $timeout
       
    proc gdb_init { args } {
        # Reset the timeout value to the default.  This way, any testcase
        # that changes the timeout value without resetting it cannot affect
        # the timeout used in subsequent testcases.
        global default_test_timeout
        global timeout
        set timeout $default_test_timeout

I can test this if you like this approach better.  Otherwise, I'll commit
the first patch tomorrow.

-- 
Joel


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