diff options
author | Yao Qi <yao@codesourcery.com> | 2013-01-18 06:40:58 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-01-18 06:40:58 +0000 |
commit | 5ae4861a11c9487e991607689ebabc2e0008a670 (patch) | |
tree | bf5e32a7baa077facd26ccb53b5f59f6996b65af /gdb/testsuite | |
parent | 257e7a09728bb1b846ff4e1a7587832b050d38b9 (diff) | |
download | gdb-5ae4861a11c9487e991607689ebabc2e0008a670.zip gdb-5ae4861a11c9487e991607689ebabc2e0008a670.tar.gz gdb-5ae4861a11c9487e991607689ebabc2e0008a670.tar.bz2 |
gdb/gdbserver:
* ax.h (struct eval_agent_expr_context): New.
(gdb_eval_agent_expr): Update declaration.
* ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
TFRAME. Add new argument CTX.
* server.h (struct eval_agent_expr_context): Declare.
(agent_mem_read, agent_tsv_read): Update declaration.
(agent_mem_read_string): Likewise.
* tracepoint.c (eval_tracepoint_agent_expr): Remove.
(add_traceframe_block): Add new argument TPOINT.
Increase TPOINT->traceframe_usage.
(do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
eval_tracepoint_agent_expr.
(condition_true_at_tracepoint): Likewise.
(agent_mem_read): Remove argument TFRAME. Add argument CTX.
(agent_mem_read_string, agent_tsv_read): Likewise.
Callers update.
gdb/testsuite:
* gdb.trace/infotrace.exp: Check 'traceframe usage' in the
output of 'info tracepoints'.
* gdb.trace/disconnected-tracing.exp (disconnected_tracing):
Likewise.
* gdb.trace/tstatus.exp (run_trace_experiment): Likewise.
* gdb.trace/disconnected-tracing.c (struct foo): New.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/disconnected-tracing.c | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/disconnected-tracing.exp | 29 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/infotrace.exp | 29 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/tstatus.exp | 10 |
5 files changed, 76 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d7d7e05..ba9de03 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2013-01-18 Yao Qi <yao@codesourcery.com> + + * gdb.trace/infotrace.exp: Check 'traceframe usage' in the + output of 'info tracepoints'. + * gdb.trace/disconnected-tracing.exp (disconnected_tracing): + Likewise. + * gdb.trace/tstatus.exp (run_trace_experiment): Likewise. + * gdb.trace/disconnected-tracing.c (struct foo): New. + 2013-01-17 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.dwarf2/dw2-dos-drive.S: New file. diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.c b/gdb/testsuite/gdb.trace/disconnected-tracing.c index 9776a61..f7de31f 100644 --- a/gdb/testsuite/gdb.trace/disconnected-tracing.c +++ b/gdb/testsuite/gdb.trace/disconnected-tracing.c @@ -19,6 +19,14 @@ void end (void) {} +struct foo +{ + int bar1; + long bar2; +}; + +struct foo foo; + void start (void) {} diff --git a/gdb/testsuite/gdb.trace/disconnected-tracing.exp b/gdb/testsuite/gdb.trace/disconnected-tracing.exp index 7c0e6ce..bb73581 100644 --- a/gdb/testsuite/gdb.trace/disconnected-tracing.exp +++ b/gdb/testsuite/gdb.trace/disconnected-tracing.exp @@ -47,6 +47,8 @@ if ![gdb_target_supports_trace] { proc disconnected_tracing { } { with_test_prefix "trace" { global executable + global decimal + global srcfile # Start with a fresh gdb. clean_restart ${executable} @@ -57,10 +59,18 @@ proc disconnected_tracing { } { with_test_prefix "trace" { gdb_test_no_output "set confirm off" gdb_test_no_output "set disconnected-tracing on" - gdb_test "trace main" ".*" + gdb_test "trace start" ".*" + gdb_trace_setactions "collect on tracepoint 2" "2" \ + "collect foo" "^$" + gdb_test "break end" "Breakpoint ${decimal} at .*" + gdb_test_no_output "tstart" - gdb_test "info tracepoints" ".*in main at.*" "first info tracepoints" + gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" + gdb_test_no_output "tstop" + + gdb_test "info tracepoints" ".*in start at.*" \ + "first info tracepoints" gdb_test "disconnect" "Ending remote debugging\\." "first disconnect" if { [gdb_reconnect] == 0 } { @@ -69,10 +79,12 @@ proc disconnected_tracing { } { with_test_prefix "trace" { fail "first reconnect after unload" return 0 } - gdb_test "info tracepoints" ".*in main at.*" "second info tracepoints" + gdb_test "info tracepoints" ".*in start at.*" \ + "second info tracepoints" delete_breakpoints - gdb_test "info tracepoints" ".*No tracepoints..*" "third info tracepoints" + gdb_test "info tracepoints" ".*No tracepoints..*" \ + "third info tracepoints" gdb_test "disconnect" "Ending remote debugging\\." "second disconnect" if { [gdb_reconnect] == 0 } { @@ -81,7 +93,14 @@ proc disconnected_tracing { } { with_test_prefix "trace" { fail "second reconnect after unload" return 0 } - gdb_test "info tracepoints" ".*in main at.*" "fourth info tracepoints" + gdb_test "tstatus" + gdb_test "info tracepoints" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* +\[0-9\]+\[\t \]+tracepoint keep y.* in start at .*$srcfile:\[0-9\]+. +\[\t \]+tracepoint already hit 1 time. +\[\t \]+trace buffer usage ${decimal} bytes. +\[\t \]+collect foo.*" \ + "fourth info tracepoints" }} disconnected_tracing diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp index b71444b..7c0f717 100644 --- a/gdb/testsuite/gdb.trace/infotrace.exp +++ b/gdb/testsuite/gdb.trace/infotrace.exp @@ -89,3 +89,32 @@ gdb_test "help info tracepoints" \ "Status of specified tracepoints .all tracepoints if no argument.*" \ "2.5: help info tracepoints" +# 2.6 info tracepoints (check trace buffer usage). We need a live +# tracing. +gdb_breakpoint "main" +gdb_trace_setactions "collect on tracepoint 1" "1" \ + "collect gdb_struct1_test" "^$" +gdb_run_cmd +gdb_test "" "Breakpoint ${decimal}, main.*" + +if { ![gdb_target_supports_trace] } then { + unsupported "Current target does not support trace" + return 1; +} + +gdb_test "break end" "Breakpoint \[0-9\] at .*" +gdb_test_no_output "tstart" +gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*" \ + "continue to end" +gdb_test_no_output "tstop" +gdb_test "tstatus" +gdb_test "info tracepoints" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+. +\[\t \]+tracepoint already hit 1 time. +\[\t \]+trace buffer usage ${decimal} bytes. +\[\t \]+collect gdb_struct1_test. +\tinstalled on target. +\[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. +\tinstalled on target." \ + "2.6: info tracepoints (trace buffer usage)" diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp index c620a64..8a0bbdf 100644 --- a/gdb/testsuite/gdb.trace/tstatus.exp +++ b/gdb/testsuite/gdb.trace/tstatus.exp @@ -55,6 +55,7 @@ if ![runto_main] { proc run_trace_experiment {} { global gdb_prompt + global decimal # gdb_test_no_output "set debug remote 1" "" @@ -114,14 +115,15 @@ proc run_trace_experiment {} { } } - # Tracepoint hit count is optional, so pass it either way. + # Hit count and traceframe usage of tracepoint is optional, so + # pass it either way. gdb_test_multiple "info trace" "show tracepoint state" { - -re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+tracepoint already hit 1 time\[\r\n\]+\[\t ]+collect parm.*\r\n$gdb_prompt $" { - pass "info trace reports tracepoint hit count" + -re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+tracepoint already hit 1 time\[\r\n\]+\[\t ]+trace buffer usage ${decimal} bytes\.\[\r\n\]+\[\t ]+collect parm.*\r\n$gdb_prompt $" { + pass "info trace reports tracepoint hit count and traceframe usage" } -re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+collect parm.*\r\n$gdb_prompt $" { - pass "info trace does not report tracepoint hit count" + pass "info trace does not report tracepoint hit count and traceframe usage" } } } |