Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix debugger

  • Loading branch information...
commit b5fe5a6ceff1b0f0848014f99db8529682870c4d 1 parent edc574b
@txus authored
Showing with 2 additions and 14 deletions.
  1. +2 −13 src/terror/debugger.c
  2. +0 −1  src/terror/debugger.h
View
15 src/terror/debugger.c
@@ -94,7 +94,6 @@ Debugger_prompt(STATE)
printf("\nl: show locals");
printf("\nt: show backtrace");
printf("\nb: set breakpoint in a line. Example: b 30");
- printf("\nk: kill breakpoint in a line. Example: d 30");
printf("\n\n");
break;
case 's':
@@ -102,13 +101,10 @@ Debugger_prompt(STATE)
cont = 1;
break;
case 'b': {
+ scanf("%s", arg);
Debugger_set_breakpoint(state, atoi(arg));
break;
}
- case 'k': {
- Debugger_kill_breakpoint(state, atoi(arg));
- break;
- }
case 'p':
scanf("%s", arg);
if(strcmp(arg, "self") == 0) {
@@ -158,7 +154,6 @@ Debugger_prompt(STATE)
printf("I don't understand.\n");
break;
}
- /* getchar(); */
}
}
@@ -195,13 +190,6 @@ Debugger_set_breakpoint(STATE, int line)
}
void
-Debugger_kill_breakpoint(STATE, int line)
-{
- printf("Kill breakpoint at line %i.", line);
- /* DArray_push(DEBUGGER->breakpoints, line); */
-}
-
-void
Debugger_breakpoint(STATE)
{
for(int i=0; i < DArray_count(DEBUGGER->breakpoints); i++) {
@@ -210,6 +198,7 @@ Debugger_breakpoint(STATE)
strcmp(bp->filename, CURR_FRAME->fn->filename) == 0) {
printf("Breakpoint");
Debugger_stop(state);
+ DEBUGGER->current_line++; // to avoid breaking in the same point after 'c'
}
}
}
View
1  src/terror/debugger.h
@@ -36,7 +36,6 @@ void Debugger_print_context(struct state_s* state);
Breakpoint* Breakpoint_new(char *filename, int line);
void Debugger_set_breakpoint(struct state_s* state, int line);
-void Debugger_kill_breakpoint(struct state_s* state, int line);
void Debugger_breakpoint(struct state_s* state);
#define Debugger_setline(S, L) \
Please sign in to comment.
Something went wrong with that request. Please try again.