Pārlūkot izejas kodu

Added support for clearing file breakpoints.

Brucey 5 gadi atpakaļ
vecāks
revīzija
867d8e7b2a
2 mainītis faili ar 12 papildinājumiem un 2 dzēšanām
  1. 9 0
      appstub.mod/debugger.glue.c
  2. 3 2
      appstub.mod/debugger.tcp.bmx

+ 9 - 0
appstub.mod/debugger.glue.c

@@ -201,6 +201,15 @@ int bmx_debugger_AddBreakpoint(BBString * filename, int line) {
 int bmx_debugger_RemoveBreakpoint(BBString * filename, int line) {
 	BBSource * src = bbSourceForName(filename);
 	if (src) {
+		if (line == 0) {
+			int count = src->count;
+			for (int i = 0; i < src->count; i++) {
+				src->lines[i] = 0;
+			}
+			src->count = 0;
+			return count;
+		}
+		
 		for (int i = 0; i < src->count; i++) {
 			if (line == src->lines[i]) {
 				for (int n = i; n < src->count; n++) {

+ 3 - 2
appstub.mod/debugger.tcp.bmx

@@ -1119,8 +1119,9 @@ Function OnDebugEnterStm( stm:Int Ptr )
 						Local file:String = s[2..off]
 						Local line:Int = s[off + 1..s.length - 2].ToInt()
 
-						If bmx_debugger_RemoveBreakpoint(file, line) Then
-							_bpCount :- 1
+						Local count:Int = bmx_debugger_RemoveBreakpoint(file, line)
+						If count Then
+							_bpCount :- count
 						End If
 					End If
 				End If