aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2010-03-23 21:32:28 +0000
committerVladimir Prus <vladimir@codesourcery.com>2010-03-23 21:32:28 +0000
commita7bdde9e633ffde58462e01bdfb0d1ee9a642d7c (patch)
tree21df3445afaf8f0d2a61166c724029025fbf834c /gdb/defs.h
parent64e3cf3d4f121e456a09c3998c4aa6d739e61f8a (diff)
downloadgdb-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/defs.h')
-rw-r--r--gdb/defs.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index 5983289..b7fd97a 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -691,6 +691,7 @@ enum command_control_type
if_control,
commands_control,
python_control,
+ while_stepping_control,
invalid_control
};
@@ -702,12 +703,21 @@ struct command_line
struct command_line *next;
char *line;
enum command_control_type control_type;
+ /* The number of elements in body_list. */
int body_count;
+ /* For composite commands, the nested lists of
+ commands. For example, for "if" command this
+ will contain the then branch and the else
+ branch, if that is available. */
struct command_line **body_list;
};
-extern struct command_line *read_command_lines (char *, int, int);
-extern struct command_line *read_command_lines_1 (char * (*) (void), int);
+extern struct command_line *read_command_lines (char *, int, int,
+ void (*)(char *, void *),
+ void *);
+extern struct command_line *read_command_lines_1 (char * (*) (void), int,
+ void (*)(char *, void *),
+ void *);
extern void free_command_lines (struct command_line **);