diff options
author | Maciej W. Rozycki <macro@codesourcery.com> | 2014-03-21 23:51:16 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@codesourcery.com> | 2014-03-21 23:51:16 +0000 |
commit | ecebef6a9acbca2f98e1ed64b986d792c6933ec5 (patch) | |
tree | 0d83cab3f2647b414ee2e712b66780132c0e1bb1 /gdb/testsuite/gdb.threads | |
parent | ecdf850f8515140a3c15bc8ca55172276bcc914d (diff) | |
download | gdb-ecebef6a9acbca2f98e1ed64b986d792c6933ec5.zip gdb-ecebef6a9acbca2f98e1ed64b986d792c6933ec5.tar.gz gdb-ecebef6a9acbca2f98e1ed64b986d792c6933ec5.tar.bz2 |
gdb.threads/thread-specific.exp: Fix uninitialized variable references
This fixes:
FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout)
ERROR: tcl error sourcing .../gdb/testsuite/gdb.threads/thread-specific.exp.
ERROR: can't read "this_breakpoint": no such variable
while executing
"gdb_test_multiple "info breakpoint $this_breakpoint" "info on bp" {
-re ".*stop only in thread (\[0-9\]*).*$gdb_prompt $" {
set this_thread $expe..."
(file ".../gdb/testsuite/gdb.threads/thread-specific.exp" line 108)
invoked from within
"source .../gdb/testsuite/gdb.threads/thread-specific.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source .../gdb/testsuite/gdb.threads/thread-specific.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
and then:
FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout)
UNTESTED: gdb.threads/thread-specific.exp: info on bp
ERROR: tcl error sourcing .../gdb/testsuite/gdb.threads/thread-specific.exp.
ERROR: can't read "this_thread": no such variable
while executing
"gdb_test {print $_thread} ".* = $this_thread" "thread var at break""
(file ".../gdb/testsuite/gdb.threads/thread-specific.exp" line 119)
invoked from within
"source .../gdb/testsuite/gdb.threads/thread-specific.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source .../gdb/testsuite/gdb.threads/thread-specific.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
Final results:
FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout)
UNTESTED: gdb.threads/thread-specific.exp: info on bp
UNTESTED: gdb.threads/thread-specific.exp: thread var at break
Of course the first failure best wasn't there, but failing that the script
shouldn't crash.
* gdb.threads/thread-specific.exp: Handle the lack of usable
$this_breakpoint and $this_thread.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/thread-specific.exp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.threads/thread-specific.exp b/gdb/testsuite/gdb.threads/thread-specific.exp index 90968e9..e271484 100644 --- a/gdb/testsuite/gdb.threads/thread-specific.exp +++ b/gdb/testsuite/gdb.threads/thread-specific.exp @@ -95,6 +95,7 @@ foreach thread [lrange $threads 1 end] { gdb_breakpoint "$line thread $thread" } +set this_breakpoint -1 gdb_test_multiple "continue" "continue to thread-specific breakpoint" { -re "Breakpoint $main_breakpoint, .* at .*\r\n$gdb_prompt $" { fail "continue to thread-specific breakpoint (wrong breakpoint)" @@ -105,13 +106,22 @@ gdb_test_multiple "continue" "continue to thread-specific breakpoint" { } } -gdb_test_multiple "info breakpoint $this_breakpoint" "info on bp" { - -re ".*stop only in thread (\[0-9\]*).*$gdb_prompt $" { - set this_thread $expect_out(1,string) - pass "found breakpoint for thread number" +set this_thread -1 +if { $this_breakpoint != -1 } { + gdb_test_multiple "info breakpoint $this_breakpoint" "info on bp" { + -re ".*stop only in thread (\[0-9\]*).*$gdb_prompt $" { + set this_thread $expect_out(1,string) + pass "found breakpoint for thread number" + } } +} else { + untested "info on bp" } -gdb_test {print $_thread} ".* = $this_thread" "thread var at break" +if { $this_thread != -1 } { + gdb_test {print $_thread} ".* = $this_thread" "thread var at break" +} else { + untested "thread var at break" +} return 0 |