source: trunk/src/scripttools/debugging/scripts/commands/condition.qs@ 280

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

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

File size: 1.5 KB
Line 
1name = "condition";
2
3group = "breakpoints";
4
5shortDescription = "Specify breakpoint condition";
6
7longDescription = "condition <breakpoint-id> <expression> : Specify that the breakpoint with the given id should only be triggered if the given expression evaluates to true.";
8
9argumentTypes = [ "breakpoint-id", "script" ];
10
11seeAlso = [ "ignore" ];
12
13function execute() {
14 if (arguments.length == 0) {
15 message("Missing arguments (breakpoint number and condition).");
16 return;
17 }
18 var arg = arguments[0];
19 var spaceIndex = arg.indexOf(' ');
20 if (spaceIndex == -1)
21 spaceIndex = arg.length;
22 var id = parseInt(arg.slice(0, spaceIndex));
23 if (isNaN(id)) {
24 message("First argument must be a number (breakpoint id).");