summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>2010-06-18 17:44:33 +0000
committerStan Shebs <shebs@apple.com>2010-06-18 17:44:33 +0000
commitd2328f2aa90d894baab7dda8ec2cf5dbab13233d (patch)
tree9c715ca144a215a729c1a06cf00ced320ba7b0ed /gdb/testsuite/gdb.threads
parent06d611d9bd4a0a1027dc35e52ea1ff26e28dd466 (diff)
downloadgdb-d2328f2aa90d894baab7dda8ec2cf5dbab13233d.tar.gz
* thread.c (thread_id_make_value): Make a value representing the
current thread. (_initialize_thread): Create $_thread. * gdb.texinfo (Debugging Programs with Multiple Threads): Describe $_thread. * gdb.threads/thread-specific.exp: Add tests of $_thread.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r--gdb/testsuite/gdb.threads/thread-specific.exp16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.threads/thread-specific.exp b/gdb/testsuite/gdb.threads/thread-specific.exp
index 623d805bd86..662eec36640 100644
--- a/gdb/testsuite/gdb.threads/thread-specific.exp
+++ b/gdb/testsuite/gdb.threads/thread-specific.exp
@@ -75,6 +75,8 @@ gdb_load ${binfile}
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set width 0"
+gdb_test {print $_thread} ".* = 0" "thread var when not running"
+
runto_main
gdb_breakpoint [gdb_get_line_number "thread-specific.exp: last thread start"]
@@ -88,6 +90,8 @@ if {[llength $threads] == 0} {
return 1
}
+gdb_test {print $_thread} ".* = [lindex $threads 0]" "thread var in main"
+
gdb_test_multiple "break $line thread [lindex $threads 0]" \
"breakpoint $line main thread" {
-re "Breakpoint (\[0-9\]*) at.* file .*$srcfile, line.*$gdb_prompt $" {
@@ -104,9 +108,19 @@ 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)"
}
- -re "Breakpoint .* at .*\r\n$gdb_prompt $" {
+ -re "Breakpoint (\[0-9\]*), .* at .*\r\n$gdb_prompt $" {
+ set this_breakpoint $expect_out(1,string)
pass "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"
+ }
+}
+
+gdb_test {print $_thread} ".* = $this_thread" "thread var at break"
+
return 0