summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging/scripts/commands/delete.qs
blob: 84497a77fd232d7e67a62f769821586502e75ffc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name = "delete";

group = "breakpoints";

shortDescription = "Delete breakpoint(s)";

longDescription = "delete <breakpoint-id> : Deletes the breakpoint with the given id.";

seeAlso = [ "clear", "disable" ];

function execute() {
    if (arguments.length == 0) {
        // delete all breakpoints
        scheduleClearBreakpoints();
        state = 1;
    } else {
        var id = parseInt(arguments[0]);
        if (isNaN(id)) {
            message("Breakpoint id expected.");
            return;
        }
        scheduleDeleteBreakpoint(id);
        breakpointId = id;
        state = 2;
    }
}

function handleResponse(resp) {
    if (state == 1) {
    } else if (state == 2) {
        if (resp.error != 0) {
            message("No breakpoint number " + breakpointId + ".");
            return;
        }
    }
}