diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-05-06 16:01:40 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-05-06 16:01:40 +0000 |
commit | 774094b87685f2a05d092a5b7b50f7d4864db98f (patch) | |
tree | efbd1547ad38d810caa1ff97a05076b5a75a432b /gdb | |
parent | 8be455d765a7cfb8f2cb045ec80e2b2af1597d15 (diff) | |
download | gdb-774094b87685f2a05d092a5b7b50f7d4864db98f.zip gdb-774094b87685f2a05d092a5b7b50f7d4864db98f.tar.gz gdb-774094b87685f2a05d092a5b7b50f7d4864db98f.tar.bz2 |
gdb/testsuite/
* gdb.threads/gcore-thread.exp (objfile, opts): New variables.
Try to compile the test using -Wl,-z,norelro first.
(load_core): New variable libthread_db_seen, initialize it.
(zeroed-threads cannot be listed): Protect it by XFAIL on
!$libthread_db_seen.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.threads/gcore-thread.exp | 25 |
2 files changed, 31 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 35db610..f2eb575 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-04-29 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.threads/gcore-thread.exp (objfile, opts): New variables. + Try to compile the test using -Wl,-z,norelro first. + (load_core): New variable libthread_db_seen, initialize it. + (zeroed-threads cannot be listed): Protect it by XFAIL on + !$libthread_db_seen. + 2011-05-06 Jan Kratochvil <jan.kratochvil@redhat.com> PR 12573 diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp index a072a6b..fc5a3cc 100644 --- a/gdb/testsuite/gdb.threads/gcore-thread.exp +++ b/gdb/testsuite/gdb.threads/gcore-thread.exp @@ -24,6 +24,7 @@ if $tracelevel then { # Single-threaded test case set testfile "gcore-thread" set srcfile pthreads.c +set objfile ${objdir}/${subdir}/${testfile}.o set binfile ${objdir}/${subdir}/${testfile} set corefile ${objdir}/${subdir}/${testfile}.test set core0file ${objdir}/${subdir}/${testfile}0.test @@ -34,7 +35,15 @@ if [istarget "*-*-linux"] then { set target_cflags "" } -if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { +# Attempt to prevent -Wl,-z,relro which happens by default at least on +# Kubuntu-10.10. Due to PR corefiles/11804 will then GDB be unable to find +# libpthread, therefore libthread_db will not fail as expected +# on the test `zeroed-threads cannot be listed'. + +set opts [list debug "incdir=${objdir}"] +if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${objfile}" object $opts] != "" + || ([gdb_compile_pthreads "${objfile}" "${binfile}" executable [concat $opts {additional_flags=-Wl,-z,norelro}] ] != "" + && [gdb_compile_pthreads "${objfile}" "${binfile}" executable $opts] != "") } { return -1 } @@ -139,9 +148,15 @@ clean_restart ${testfile} 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 $" { fail "re-load generated corefile (bad file format)" # No use proceeding from here. @@ -189,6 +204,12 @@ gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \ # Test the uninitialized thread list. if {"$core0file" != "" && [load_core $core0file]} { + set test "zeroed-threads cannot be listed" - gdb_test "info threads" "Cannot find new threads: .*" "zeroed-threads cannot be listed" + 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 + } } |