record-btrace: show trace from enable location
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.btrace / tailcall.exp
index c965675fd828de56dae43eae2060c7b836f781be..23988f2235938de638cb23e4f58289e1388db032 100644 (file)
@@ -49,14 +49,31 @@ gdb_test "next"
 
 # show the flat branch trace
 gdb_test "record function-call-history 1" [join [list \
-  "1\tfoo" \
-  "2\tbar" \
-  "3\tmain" \
+  "1\tmain" \
+  "2\tfoo" \
+  "3\tbar" \
+  "4\tmain" \
   ] "\r\n"] "flat"
 
 # show the branch trace with calls indented
 gdb_test "record function-call-history /c 1" [join [list \
-  "1\t  foo" \
-  "2\t    bar" \
-  "3\tmain" \
+  "1\tmain" \
+  "2\t  foo" \
+  "3\t    bar" \
+  "4\tmain" \
   ] "\r\n"] "indented"
+
+# go into bar
+gdb_test "record goto 4" ".*bar \\(\\) at .*x86-tailcall.c:24\r\n.*"
+
+# check the backtrace
+gdb_test "backtrace" [join [list \
+  "#0.*bar \\(\\) at x86-tailcall.c:24" \
+  "#1.*foo \\(\\) at x86-tailcall.c:29" \
+  "#2.*main \\(\\) at x86-tailcall.c:37" \
+  "Backtrace stopped: not enough registers or memory available to unwind further" \
+  ] "\r\n"]
+
+# walk the backtrace
+gdb_test "up" "#1\[^\r\n\]*foo \\(\\) at x86-tailcall.c:29\r\n.*" "up to foo"
+gdb_test "up" "#2\[^\r\n\]*main \\(\\) at x86-tailcall.c:37\r\n.*" "up to main"
This page took 0.024036 seconds and 4 git commands to generate.