summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging/scripts/commands/delete.qs
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripttools/debugging/scripts/commands/delete.qs')
-rw-r--r--src/scripttools/debugging/scripts/commands/delete.qs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/scripttools/debugging/scripts/commands/delete.qs b/src/scripttools/debugging/scripts/commands/delete.qs
new file mode 100644
index 0000000..84497a7
--- /dev/null
+++ b/src/scripttools/debugging/scripts/commands/delete.qs
@@ -0,0 +1,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;
+ }
+ }
+}