diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 21:32:28 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 21:32:28 +0000 |
commit | a7bdde9e633ffde58462e01bdfb0d1ee9a642d7c (patch) | |
tree | 21df3445afaf8f0d2a61166c724029025fbf834c /gdb/testsuite/gdb.trace | |
parent | 64e3cf3d4f121e456a09c3998c4aa6d739e61f8a (diff) | |
download | gdb-a7bdde9e633ffde58462e01bdfb0d1ee9a642d7c.zip gdb-a7bdde9e633ffde58462e01bdfb0d1ee9a642d7c.tar.gz gdb-a7bdde9e633ffde58462e01bdfb0d1ee9a642d7c.tar.bz2 |
Unify actions and commands
* defs.h (read_command_lines, read_command_lines_1): New
parameters validator and closure.
* tracepoint.h (struct action_line): Remove.
* breakpoint.h (struct breakpoint): Remove the 'actions'
field.
* defs.h (enum command_control_type): New value
while_stepping_control.
(struct command_line): Add comments.
* breakpoint.c (breakoint_is_tracepoint): New.
(breakpoint_set_commands): For tracepoints,
verify the commands are permissible.
(check_tracepoint_commands): New.
(commands_command): Require that each new line is validated using
check_tracepoint_command, if we set commands for a tracepoint.
(create_tracepoint_from_upload): Likewise.
(print_one_breakpoint_location): Remove the code to print
actions specifically.
(tracepoint_save_command): Relay to print_command_lines.
* cli/cli-script.c (process_next_line): New parameters validator
and closure. Handle 'while-stepping'. Call validator if not null.
(read_command_lines, read_command_lines1): Likewise.
(recurse_read_control_structure): New parameters validator and
closure. Handle while_stepping_control.
(print_command_lines): Handle while-stepping.
(get_command_line, define_command, document_command): Adjust.
* remote.c (remote_download_tracepoint): Adjust.
* tracepoint.c (make_cleanup_free_actions, read_actions)
(free_actions, do_free_actions_cleanup): Remove.
(trace_actions_command): Use read_command_lines.
(validate_actionline): Use error in one place.
(encode_actions_1): New, extracted from...
(encode_actions): ...this. Also use cleanups for exception
safety.
(trace_dump_command): Adjust.
* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
it's tracepoint.
Diffstat (limited to 'gdb/testsuite/gdb.trace')
-rw-r--r-- | gdb/testsuite/gdb.trace/actions.exp | 38 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/while-stepping.exp | 11 |
2 files changed, 15 insertions, 34 deletions
diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp index 7168501..4bdf3e4 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -88,8 +88,7 @@ gdb_trace_setactions "5.1b: set actions for first tracepoint" \ 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 \]+A\[\t \]+collect gdb_char_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_char_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \ "5.1c: verify actions set for first tracepoint" @@ -101,11 +100,9 @@ gdb_trace_setactions "5.1d: set actions for second tracepoint" \ 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 \]+A\[\t \]+collect gdb_char_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_char_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_short_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_short_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+" \ "5.1e: verify actions set for second tracepoint" @@ -116,14 +113,11 @@ gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \ 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 \]+A\[\t \]+collect gdb_char_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_char_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_short_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_short_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_long_test. -\[\t \]+A\[\t \]+end." \ +\[\t \]+collect gdb_long_test." \ "5.1e: verify actions set for second tracepoint" # 5.3 replace actions set earlier @@ -135,14 +129,11 @@ gdb_trace_setactions "5.3a: reset actions for first tracepoint" \ 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 \]+A\[\t \]+collect gdb_struct1_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_struct1_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_short_test. -\[\t \]+A\[\t \]+end. +\[\t \]+collect gdb_short_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_long_test. -\[\t \]+A\[\t \]+end." \ +\[\t \]+collect gdb_long_test." \ "5.3b: verify actions set for first tracepoint" # @@ -184,7 +175,7 @@ gdb_test "actions [expr $trcpt2 + $trcpt3]" \ gdb_trace_setactions "5.7: invalid action" \ "$trcpt1" \ "print gdb_c_test" \ - "warning: .print gdb_c_test. is not a supported trace" + "'print gdb_c_test' is not a supported tracepoint action" # 5.8 help actions (collect, while-stepping, end) @@ -230,13 +221,10 @@ gdb_trace_setactions "5.10a: set teval action for second tracepoint" \ 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 \]+A\[\t \]+teval gdb_char_test. -\[\t \]+A\[\t \]+end. +\[\t \]+teval gdb_char_test. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_asm_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+teval \\\$tsv \\\+= 1. -\[\t \]+A\[\t \]+end. +\[\t \]+teval \\\$tsv \\\+= 1. \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_recursion_test at .*$srcfile:\[0-9\]+. -\[\t \]+A\[\t \]+collect gdb_long_test. -\[\t \]+A\[\t \]+end." \ +\[\t \]+collect gdb_long_test." \ "5.10a: verify teval actions set for two tracepoints" diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp index c75ac4f..228f66a 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -71,15 +71,9 @@ gdb_trace_setactions "5.12: set stepcount to $stepcount" \ 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 \]+step count 12 .*" \ - "5.12: confirm stepcount set to $stepcount" - -gdb_test "info tracepoints" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* -.*while-stepping $stepcount.*" \ +\[\t \]+while-stepping 12.*" \ "5.12: info trace shows \"while-stepping\"" - # 5.13 step out of context while collecting local variable # [deferred to dynamic test section] @@ -88,7 +82,7 @@ proc while_stepping_bogus_arg { bogus msgstring } { gdb_trace_setactions "$msgstring" \ "" \ - "while-stepping $bogus" "\[Ee\]rror|\[Ww\]arning" + "while-stepping $bogus" ".*bad step-count" } # 5.14 while-stepping (no argument) @@ -109,7 +103,6 @@ gdb_test "info tracepoints" \ "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+tracepoint keep y.* in gdb_c_test at .*$srcfile:\[0-9\]+. .*while-stepping $stepcount.* -.*end.* .*end.*" \ "5.16: confirm actions, step without collecting anything" |