diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-07-02 20:28:38 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-07-02 20:28:38 +0000 |
commit | fcb4437118d0bbc82cf56f76d00c44c0220c0005 (patch) | |
tree | 9ee61b56376d07324026d6d4fc3400436b668758 /gdb/testsuite/gdb.threads | |
parent | 0f3c2347e62bde314690425592d9f141f929ef2e (diff) | |
download | gdb-fcb4437118d0bbc82cf56f76d00c44c0220c0005.zip gdb-fcb4437118d0bbc82cf56f76d00c44c0220c0005.tar.gz gdb-fcb4437118d0bbc82cf56f76d00c44c0220c0005.tar.bz2 |
gdb/
* linux-thread-db.c (inferior_has_bug): New function.
(thread_db_find_new_threads_silently): Return boolean as checked by
inferior_has_bug, describe it in the comments.
(try_thread_db_load_1): Move call to thread_db_find_new_threads_silently
earlier. Abort the initialization if it returned non-zero.
(thread_db_find_new_threads_2): Preinitialize ERR. Check errors also
if UNTIL_NO_NEW,
gdb/testsuite/
* gdb.threads/gcore-thread.exp: Remove variable libthread_db_seen.
Wrap the test into loop for corefile and core0file.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/gcore-thread.exp | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index a47f931..37eadd3 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -141,11 +141,9 @@ proc load_core { corefile } { global gdb_prompt global libthread_db_seen - set libthread_db_seen 0 gdb_test_multiple "core $corefile" \ "re-load generated corefile" { -re "\\\[Thread debugging using \[^ \r\n\]* enabled\\\]\r\n" { - set libthread_db_seen 1 exp_continue } -re " is not a core dump:.*\r\n$gdb_prompt $" { @@ -168,39 +166,27 @@ proc load_core { corefile } { return 1 } -if ![load_core $corefile] { - return -} - -# FIXME: now what can we test about the thread state? -# We do not know for certain that there should be at least -# three threads, because who knows what kind of many-to-one -# mapping various OS's may do? Let's assume that there must -# be at least two threads: - -gdb_test "info threads" ".*${nl} 2 ${horiz}${nl}\\* 1 .*" \ - "corefile contains at least two threads" - -# One thread in the corefile should be in the "thread2" function. - -gdb_test "info threads" ".* thread2 .*" \ - "a corefile thread is executing thread2" +foreach name { corefile core0file } { with_test_prefix $name { + if ![load_core [subst $$name]] { + continue + } -# The thread2 thread should be marked as the current thread. + # FIXME: now what can we test about the thread state? + # We do not know for certain that there should be at least + # three threads, because who knows what kind of many-to-one + # mapping various OS's may do? Let's assume that there must + # be at least two threads: -gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \ - "thread2 is current thread in corefile" + gdb_test "info threads" ".*${nl} 2 ${horiz}${nl}\\* 1 .*" \ + "corefile contains at least two threads" + # One thread in the corefile should be in the "thread2" function. -# Test the uninitialized thread list. + gdb_test "info threads" ".* thread2 .*" \ + "a corefile thread is executing thread2" -if {"$core0file" != "" && [load_core $core0file]} { - set test "zeroed-threads cannot be listed" + # The thread2 thread should be marked as the current thread. - if {!$libthread_db_seen} { - verbose -log "No libthread_db loaded - -Wl,-z,relro compilation?" - xfail $test - } else { - gdb_test "info threads" "Cannot find new threads: .*" $test - } -} + gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \ + "thread2 is current thread in corefile" +}} |