diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-17 19:11:07 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-17 19:11:07 +0000 |
commit | 254f582e7e9b0f5112489bdc7700c3edb0d00a08 (patch) | |
tree | fc480d8a52530ab5239ddfe7514123c9db965ed2 /gdb/testsuite/gdb.threads | |
parent | 4fe85f5c276ced5f5c35f9d3ba32644e83b5dc07 (diff) | |
download | gdb-254f582e7e9b0f5112489bdc7700c3edb0d00a08.zip gdb-254f582e7e9b0f5112489bdc7700c3edb0d00a08.tar.gz gdb-254f582e7e9b0f5112489bdc7700c3edb0d00a08.tar.bz2 |
gdb/
* linux-thread-db.c (find_new_threads_callback): Exit on zero TI_TID
even if !TARGET_HAS_EXECUTION.
gdb/testsuite/
* gdb.threads/gcore-thread.exp ($core0file): New variable.
(clear __stack_user.next, clear stack_used.next)
(save a zeroed-threads corefile): New test.
Call core_load for $core0file.
(zeroed-threads cannot be listed): New test.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/gcore-thread.exp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index fa460bb..a072a6b 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -26,6 +26,7 @@ set testfile "gcore-thread" set srcfile pthreads.c set binfile ${objdir}/${subdir}/${testfile} set corefile ${objdir}/${subdir}/${testfile}.test +set core0file ${objdir}/${subdir}/${testfile}0.test if [istarget "*-*-linux"] then { set target_cflags "-D_MIT_POSIX_THREADS" @@ -110,6 +111,29 @@ if {!$core_supported} { } +# Test the uninitialized thread list. +# Provide the case of glibc td_thr_get_info handling of: +# /* Special case for the main thread before initialization. */ + +foreach symbol {__stack_user stack_used} { + set test "clear ${symbol}.next" + gdb_test_multiple "p *(void **) &${symbol} = 0" $test { + -re " = \\(void \\*\\) 0x0\r\n$gdb_prompt $" { + pass $test + } + -re "No symbol \"${symbol}\" in current context\\.\r\n$gdb_prompt $" { + xfail $test + # Do not do the verification. + set core0file "" + } + } +} + +if {"$core0file" != ""} { + gdb_test "gcore $core0file" "Saved corefile .*" "save a zeroed-threads corefile" +} + + # Now restart gdb and load the corefile. clean_restart ${testfile} @@ -160,3 +184,11 @@ gdb_test "info threads" ".* thread2 .*" \ gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \ "thread2 is current thread in corefile" + + +# Test the uninitialized thread list. + +if {"$core0file" != "" && [load_core $core0file]} { + + gdb_test "info threads" "Cannot find new threads: .*" "zeroed-threads cannot be listed" +} |