gdb/gdb-dlopen-stap-probe-test2...

70 lines
2.1 KiB
Diff

http://sourceware.org/ml/gdb-patches/2012-08/msg00500.html
Subject: [patch] testsuite: Make solib-corrupted.exp untested for probes [Re: [RFA 0/4 take 2] Improved linker-debugger interface]
On Fri, 17 Aug 2012 22:53:53 +0200, Jan Kratochvil wrote:
> It regresses with glibc-debuginfo installed:
>
> info sharedlibrary^M
> From To Syms Read Shared Object Library^M
> 0x00007ffff7ddcb20 0x00007ffff7df63d9 Yes /lib64/ld-linux-x86-64.so.2^M
> 0x00007ffff7ae05b0 0x00007ffff7b4ad78 Yes /lib64/libm.so.6^M
> 0x00007ffff77431a0 0x00007ffff7883cf0 Yes /lib64/libc.so.6^M
> (gdb) FAIL: gdb.base/solib-corrupted.exp: corrupted list
>
> But I guess there is no longer a way to test it with probes so it should just
> run some 'info probes' and make this test UNTESTED if rtld probes are
> available.
I had to implement it for Fedora already anyway.
Regards,
Jan
gdb/testsuite/
2012-08-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/solib-corrupted.exp: New variable probes.
(info probes): New test.
diff --git a/gdb/testsuite/gdb.base/solib-corrupted.exp b/gdb/testsuite/gdb.base/solib-corrupted.exp
index 84b3b0c..c9f55d6 100644
--- a/gdb/testsuite/gdb.base/solib-corrupted.exp
+++ b/gdb/testsuite/gdb.base/solib-corrupted.exp
@@ -36,6 +36,33 @@ if ![runto_main] {
return
}
+# With probes interface GDB no longer scans the inferior library list so its
+# corruption cannot be tested. There is no way to disable the probes
+# interface.
+
+set probes { init_start init_complete map_start reloc_complete unmap_start
+ unmap_complete }
+set test "info probes"
+gdb_test_multiple $test $test {
+ -re "^rtld\[ \t\]+(?:rtld_)?(\[a-z_\]+)\[ \t\]" {
+ set idx [lsearch -exact $probes $expect_out(1,string)]
+ if { $idx >= 0 } {
+ set probes [lreplace $probes $idx $idx]
+ }
+ exp_continue
+ }
+ -re "^\[^\r\n\]*\r\n" {
+ exp_continue
+ }
+ -re "^$gdb_prompt $" {
+ }
+}
+if { [llength $probes] == 0 } {
+ xfail $test
+ untested "GDB is using probes"
+ return
+}
+
gdb_test "info sharedlibrary" "From * To .*" "normal list"
# GDB checks there for matching L_PREV.