Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix debugger

  • Loading branch information...
commit b5fe5a6ceff1b0f0848014f99db8529682870c4d 1 parent edc574b
Josep M. Bach authored

Showing 2 changed files with 2 additions and 14 deletions. Show diff stats Hide diff stats

  1. +2 13 src/terror/debugger.c
  2. +0 1  src/terror/debugger.h
15 src/terror/debugger.c
@@ -94,7 +94,6 @@ Debugger_prompt(STATE)
94 94 printf("\nl: show locals");
95 95 printf("\nt: show backtrace");
96 96 printf("\nb: set breakpoint in a line. Example: b 30");
97   - printf("\nk: kill breakpoint in a line. Example: d 30");
98 97 printf("\n\n");
99 98 break;
100 99 case 's':
@@ -102,13 +101,10 @@ Debugger_prompt(STATE)
102 101 cont = 1;
103 102 break;
104 103 case 'b': {
  104 + scanf("%s", arg);
105 105 Debugger_set_breakpoint(state, atoi(arg));
106 106 break;
107 107 }
108   - case 'k': {
109   - Debugger_kill_breakpoint(state, atoi(arg));
110   - break;
111   - }
112 108 case 'p':
113 109 scanf("%s", arg);
114 110 if(strcmp(arg, "self") == 0) {
@@ -158,7 +154,6 @@ Debugger_prompt(STATE)
158 154 printf("I don't understand.\n");
159 155 break;
160 156 }
161   - /* getchar(); */
162 157 }
163 158 }
164 159
@@ -195,13 +190,6 @@ Debugger_set_breakpoint(STATE, int line)
195 190 }
196 191
197 192 void
198   -Debugger_kill_breakpoint(STATE, int line)
199   -{
200   - printf("Kill breakpoint at line %i.", line);
201   - /* DArray_push(DEBUGGER->breakpoints, line); */
202   -}
203   -
204   -void
205 193 Debugger_breakpoint(STATE)
206 194 {
207 195 for(int i=0; i < DArray_count(DEBUGGER->breakpoints); i++) {
@@ -210,6 +198,7 @@ Debugger_breakpoint(STATE)
210 198 strcmp(bp->filename, CURR_FRAME->fn->filename) == 0) {
211 199 printf("Breakpoint");
212 200 Debugger_stop(state);
  201 + DEBUGGER->current_line++; // to avoid breaking in the same point after 'c'
213 202 }
214 203 }
215 204 }
1  src/terror/debugger.h
@@ -36,7 +36,6 @@ void Debugger_print_context(struct state_s* state);
36 36
37 37 Breakpoint* Breakpoint_new(char *filename, int line);
38 38 void Debugger_set_breakpoint(struct state_s* state, int line);
39   -void Debugger_kill_breakpoint(struct state_s* state, int line);
40 39 void Debugger_breakpoint(struct state_s* state);
41 40
42 41 #define Debugger_setline(S, L) \

0 comments on commit b5fe5a6

Please sign in to comment.
Something went wrong with that request. Please try again.