aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/collection.exp
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2011-09-27 13:09:37 +0000
committerStan Shebs <shebs@codesourcery.com>2011-09-27 13:09:37 +0000
commit6710bf39b7c037de481a4b351fb69cec6b48b138 (patch)
tree49c698293333f96658a7f2859051a433cdf21d7f /gdb/testsuite/gdb.trace/collection.exp
parent21eb9156ec61765732abe5e2b8b0e717452bf7f1 (diff)
downloadgdb-6710bf39b7c037de481a4b351fb69cec6b48b138.zip
gdb-6710bf39b7c037de481a4b351fb69cec6b48b138.tar.gz
gdb-6710bf39b7c037de481a4b351fb69cec6b48b138.tar.bz2
Add return address collection for tracepoints.
* tracepoint.c (encode_actions_1): Add case for $_ret. (validate_actionline): Check for $_ret. (trace_dump_actions): Ditto. * ax-gdb.h (gen_trace_for_return_address): Declare. * ax-gdb.c: Include arch-utils.h. (gen_trace_for_return_address): New function. (agent_command): Add return address special case. * amd64-tdep.c: Include ax.h and ax-gdb.h. (amd64_gen_return_address): New function. (amd64_init_abi): Call it. * i386-tdep.c: Include ax.h and ax-gdb.h. (i386_gen_return_address): New function. (i386_init_abi): Call it. * arch-utils.h (default_gen_return_address): Declare. * arch-utils.c (default_gen_return_address): New function. * gdbarch.sh (gen_return_address): New method. * gdbarch.h, gdbarch.c: Regenerate. * gdb.texinfo (Tracepoint Action Lists): Document $_ret. * gdb.trace/collection.exp: Test collection of $_ret.
Diffstat (limited to 'gdb/testsuite/gdb.trace/collection.exp')
-rw-r--r--gdb/testsuite/gdb.trace/collection.exp32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
index 4d57ad4..6b73184 100644
--- a/gdb/testsuite/gdb.trace/collection.exp
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -588,6 +588,37 @@ proc gdb_collect_global_in_pieces_test { } {
"collect global in pieces: cease trace debugging"
}
+proc gdb_collect_return_test { } {
+
+ prepare_for_trace_test
+
+ # We'll simply re-use the args_test_function for this test
+ gdb_test "trace args_test_func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect \$_ret: set tracepoint"
+ gdb_trace_setactions "collect \$_ret: define actions" \
+ "" \
+ "collect \$_ret" "^$"
+
+ # Begin the test.
+ run_trace_experiment \$_ret args_test_func
+
+ # Since we can't guarantee that $_ret will give us the caller,
+ # pass either way, but giving different messages.
+ gdb_test_multiple "backtrace" "" {
+ -re ".*#1 .* in main .*" {
+ pass "collect \$_ret: backtrace lists main"
+ }
+ -re ".*#1 .* in ?? .*" {
+ pass "collect \$_ret: backtrace not listing main"
+ }
+ }
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect \$_ret: cease trace debugging"
+}
+
proc gdb_trace_collection_test {} {
global fpreg
global spreg
@@ -696,6 +727,7 @@ proc gdb_trace_collection_test {} {
gdb_collect_expression_test globals_test_func \
"globalarr\[\(l6, l7\)\]" "7" "a\[\(b, c\)\]"
+ gdb_collect_return_test
}
clean_restart $executable