]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.trace/ftrace.exp
Initialize target description early in IPA
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.trace / ftrace.exp
index b8626804c9aa8f841e38a16350b41199efd83505..3aa8883982b93d10f4df61a90e984bcec493e8e7 100644 (file)
@@ -63,9 +63,36 @@ proc run_trace_experiment {} {
 
     gdb_test_no_output "tstart" "start trace experiment"
 
-    gdb_test "continue" \
-       ".*Breakpoint \[0-9\]+, end .*" \
-       "advance through tracing"
+    # Fast tracepoint can be set in signal handler, so gdb_collect in
+    # IPA shouldn't call any non-async-signal-safe functions.  It is
+    # impractical to list all non-async-signal-safe functions, and set
+    # breakpoints on them, so choose malloc only in this test.
+    gdb_test "b -q malloc"
+
+    # Performance-wise, gdb_collect in IPA shouldn't call any syscall
+    # in order to keep fast tracepoint fast enough.
+    global gdb_prompt
+    set test "catch syscall"
+    gdb_test_multiple $test $test {
+       -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" {
+       }
+       -re ".*$gdb_prompt $" {
+           pass $test
+       }
+    }
+
+    global decimal
+    set test "advance through tracing"
+    gdb_test_multiple "continue" $test {
+       -re "Thread 2 .* hit Catchpoint $decimal \\(call to syscall .*\\).*\r\n$gdb_prompt $" {
+           # IPA starts a helper thread, which calls accept.  Ignore it.
+           send_gdb "continue\n"
+           exp_continue
+       }
+       -re "Breakpoint $decimal, end .*$gdb_prompt $" {
+           pass $test
+       }
+    }
 
     gdb_test "tstatus" ".*Trace .*" "check on trace status"