Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a delete breakpoint debugger op

  • Loading branch information...
commit 76d7adfb2ec89308c133c3be75429183e6793f6d 1 parent 09a47a1
Nathan Brown nbrown authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/m0/c/m0_debugger.c
18 src/m0/c/m0_debugger.c
View
@@ -503,6 +503,22 @@ debug_add_breakpoint(char * arg, M0_Debugger_Info* db_info)
}
static void
+debug_delete_breakpoint(char * arg, M0_Debugger_Info* db_info)
+{
+ unsigned long bp;
+ if(!arg) {
+ printf("You must specify a breakpoint # in order to delete a breakpoint\n");
+ return;
+ }
+ bp = strtoul(arg, NULL, 10);
+ if(bp < db_info->n_breakpoints) {
+ for( ; bp < db_info->n_breakpoints - 1; bp++)
+ db_info->breakpoints[bp] = db_info->breakpoints[bp+1];
+ db_info->n_breakpoints--;
+ }
+}
+
+static void
debug_list_breakpoints(char * arg, M0_Debugger_Info* db_info)
{
unsigned int n_bp = db_info->n_breakpoints;
@@ -568,7 +584,7 @@ db_prompt(M0_Debugger_Info *db_info, M0_CallFrame *cf, const unsigned char *ops,
debug_add_breakpoint(arg, db_info);
break;
case Delete_Breakpoint:
- NYI();
+ debug_delete_breakpoint(arg, db_info);
break;
case List_Breakpoints:
debug_list_breakpoints(arg, db_info);
Please sign in to comment.
Something went wrong with that request. Please try again.