From: Vladimir Prus Date: Tue, 23 Mar 2010 21:48:14 +0000 (+0000) Subject: Implement -break-passcount. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b4c786c6c9f2599873343b935a46a446ba1c029;p=binutils-gdb.git Implement -break-passcount. * mi/mi-cmd-break.c (mi_cmd_break_passcount): New. * mi/mi-cmds.c (mi_cmds): Register -break-passcount. * mi/mi-cmds.h (mi_cmd_break_passcount): Declare. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebd90410233..497e4ee4275 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2010-03-24 Vladimir Prus + + Implement -break-passcount. + + * mi/mi-cmd-break.c (mi_cmd_break_passcount): New. + * mi/mi-cmds.c (mi_cmds): Register -break-passcount. + * mi/mi-cmds.h (mi_cmd_break_passcount): Declare. + 2010-03-24 Vladimir Prus -trace-start/-trace-end/-trace-status. diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 3fcd85b3344..c5a098e9d02 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -170,6 +170,31 @@ enum wp_type ACCESS_WP }; +void +mi_cmd_break_passcount (char *command, char **argv, int argc) +{ + int n; + int p; + struct breakpoint *t; + + if (argc != 2) + error (_("Usage: tracepoint-number passcount")); + + n = atoi (argv[0]); + p = atoi (argv[1]); + t = get_tracepoint (n); + + if (t) + { + t->pass_count = p; + observer_notify_tracepoint_modified (n); + } + else + { + error (_("Cound not find tracepoint %d"), n); + } +} + /* Insert a watchpoint. The type of watchpoint is specified by the first argument: -break-watch --> insert a regular wp. diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index c2183fbe3e4..6b260fc5f1a 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -43,6 +43,7 @@ struct mi_cmd mi_cmds[] = { "break-info", { "info break", 1 }, NULL }, { "break-insert", { NULL, 0 }, mi_cmd_break_insert}, { "break-list", { "info break", }, NULL }, + { "break-passcount", { NULL, 0 }, mi_cmd_break_passcount}, { "break-watch", { NULL, 0 }, mi_cmd_break_watch}, { "data-disassemble", { NULL, 0 }, mi_cmd_disassemble}, { "data-evaluate-expression", { NULL, 0 }, mi_cmd_data_evaluate_expression}, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 702dd9e61e7..b5ff61f952d 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -39,6 +39,7 @@ typedef void (mi_cmd_argv_ftype) (char *command, char **argv, int argc); extern mi_cmd_argv_ftype mi_cmd_add_inferior; extern mi_cmd_argv_ftype mi_cmd_break_insert; extern mi_cmd_argv_ftype mi_cmd_break_commands; +extern mi_cmd_argv_ftype mi_cmd_break_passcount; extern mi_cmd_argv_ftype mi_cmd_break_watch; extern mi_cmd_argv_ftype mi_cmd_disassemble; extern mi_cmd_argv_ftype mi_cmd_data_evaluate_expression;