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]

Testcase problem in chng-syms.exp


Hello,

I'm seeing failures in chng-sym.exp which appear to be test case bugs.

The output of GDB near the end of the test run is:

Executing on host: spu-gcc /home/uweigand/fsf/gdb-head/gdb/testsuite/gdb.base/chng-syms.c  -DVARIABLE=var2 -g  -lm   -o /home/uweig
and/fsf/gdb-head-build/gdb/testsuite/gdb.base/chng-syms    (timeout = 300)
run ^M
`/home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/chng-syms' has changed; re-reading symbols.^M
Error in re-setting breakpoint 1:^M
No symbol "var1" in current context.^M
Starting program: /home/uweigand/fsf/gdb-head-build/gdb/testsuite/gdb.base/chng-syms ^M
^M
Program exited normally.^M
(gdb) FAIL: gdb.base/chng-syms.exp: running with invalidated bpt condition after executable changes

Now, the corresponding test case code reads:

    gdb_run_cmd
    gdb_expect {
        -re "Error in re-setting .*No symbol .var1..*Program exited normally.*$gdb_prompt $" {
            pass "running with invalidated bpt condition after executable changes"
        }
        -re "Error in re-setting .*No symbol .var1..*Breakpoint .*,( 0x.* in)? exit .*$gdb_prompt $" {
            pass "running with invalidated bpt condition after executable changes"
        }
        -re "$gdb_prompt $" {
            fail "running with invalidated bpt condition after executable changes"
        }
        timeout {
            fail "(timeout) running with invalidated bpt condition after executable changes"
        }
    }

So you'd expect that the output would match the first pattern, right?
However, it doesn't.  This appears to be caused by the implementation
of gdb_run_cmd, which ends in:

    send_gdb "run $args\n"
# This doesn't work quite right yet.
    gdb_expect 60 {
        -re "The program .* has been started already.*y or n. $" {
            send_gdb "y\n"
            exp_continue
        }
        -re "Starting program: \[^\r\n\]*" {}
    }

This means everything up to and including the line "Starting program: ..."
is swallowed up by this gdb_expect, and the second one in chng-syms.exp
does see the lines it is looking for any more.


Did I overlook anything here?  How can we best fix this?
I'd appreciate any suggestions ...

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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