source: branches/4.5.1/src/scripttools/debugging/scripts/commands/clear.qs

Last change on this file was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 1.6 KB
Line 
1name = "clear";
2
3group = "breakpoints";
4
5shortDescription = "Clear breakpoint at specified location";
6
7longDescription = "clear <file>:<line> : Clear breakpoints at the given location.";
8longDescription += "\nclear <line> : Clear breakpoints at the given line of the current script.";
9
10seeAlso = [ "delete" ];
11
12argumentTypes = [ "script-filename" ];
13
14function execute() {
15 if (arguments.length == 0) {
16 message("Missing argument.");
17 return;
18 }
19 var arg = arguments[0];
20 var colonIndex = arg.lastIndexOf(':');
21 if (colonIndex == -1) {
22 lineNumber = parseInt(arg);
23 if (isNaN(lineNumber)) {
24 message("Breakpoint location must be of the form <file>:<line> or <line>.");
25 return;
26 }
27 var sid = getCurrentScriptId();
28 if (sid == -1) {
29 message("No script.");
30 return;
31 }
32 scriptId = sid;
33 } else {
34 fileName = arg.slice(0, colonIndex);
35 lineNumber = parseInt(arg.slice(colonIndex+1));
36 }
37 scheduleGetBreakpoints();
38 state = 1;
39}
40
41function handleResponse(resp) {
42 if (state == 1) {
43 var breakpoints = resp.result;
44 if (breakpoints == undefined)
45 return;
46 for (var id in breakpoints) {
47 var data = breakpoints[id];
48 if ((data.lineNumber == lineNumber)
49 && (data.fileName == fileName)
50 || ((data.scriptId != -1) && (data.scriptId = scriptId))) {
51 scheduleDeleteBreakpoint(id);
52 message("Deleted breakpoint " + id + ".");
53 }
54 }
55 state = 2;
56 } else if (state == 2) {
57
58 }
59}
Note: See TracBrowser for help on using the repository browser.