1/****************************************************************************
2**
3** Copyright (C) 2018 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the QtSCriptTools module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "qscriptdebuggercommand_p.h"
41#include "qscriptbreakpointdata_p.h"
42#include "qscriptdebuggervalue_p.h"
43
44#include <QtCore/qhash.h>
45#include <QtCore/qdatastream.h>
46#include <QtCore/qstringlist.h>
47
48Q_DECLARE_METATYPE(QScriptBreakpointData)
49Q_DECLARE_METATYPE(QScriptDebuggerValue)
50
51QT_BEGIN_NAMESPACE
52
53/*!
54 \since 4.5
55 \class QScriptDebuggerCommand
56 \internal
57
58 \brief The QScriptDebuggerCommand class represents a command issued to a QScriptDebuggerFrontend.
59
60 A debugger command is described by a command type and zero or more
61 attributes. Such commands are generated internally by the
62 QScriptDebuggerFrontend class (through the scheduleXXX commands). A
63 command is typically passed on to a QScriptDebuggerCommandExecutor
64 that applies the command to a QScriptDebuggerBackend.
65*/
66
67class QScriptDebuggerCommandPrivate
68{
69public:
70 QScriptDebuggerCommandPrivate();
71 ~QScriptDebuggerCommandPrivate();
72
73 QScriptDebuggerCommand::Type type;
74 QHash<QScriptDebuggerCommand::Attribute, QVariant> attributes;
75};
76
77QScriptDebuggerCommandPrivate::QScriptDebuggerCommandPrivate()
78 : type(QScriptDebuggerCommand::None)
79{
80}
81
82QScriptDebuggerCommandPrivate::~QScriptDebuggerCommandPrivate()
83{
84}
85
86/*!
87 Constructs a QScriptDebuggerCommand of type None.
88*/
89QScriptDebuggerCommand::QScriptDebuggerCommand()
90 : d_ptr(new QScriptDebuggerCommandPrivate)
91{
92 d_ptr->type = None;
93}
94
95/*!
96 Constructs a QScriptDebuggerCommand of the given \a type, with no
97 attributes defined.
98*/
99QScriptDebuggerCommand::QScriptDebuggerCommand(Type type)
100 : d_ptr(new QScriptDebuggerCommandPrivate)
101{
102 d_ptr->type = type;
103}
104
105/*!
106 Constructs a QScriptDebuggerCommand that is a copy of the \a other
107 command.
108*/
109QScriptDebuggerCommand::QScriptDebuggerCommand(const QScriptDebuggerCommand &other)
110 : d_ptr(new QScriptDebuggerCommandPrivate)
111{
112 *d_ptr = *other.d_ptr;
113}
114
115/*!
116 Destroys this QScriptDebuggerCommand.
117*/
118QScriptDebuggerCommand::~QScriptDebuggerCommand()
119{
120}
121
122/*!
123 Assigns the \a other value to this QScriptDebuggerCommand.
124*/
125QScriptDebuggerCommand &QScriptDebuggerCommand::operator=(const QScriptDebuggerCommand &other)
126{
127 *d_ptr = *other.d_ptr;
128 return *this;
129}
130
131/*!
132 Returns the type of this command.
133*/
134QScriptDebuggerCommand::Type QScriptDebuggerCommand::type() const
135{
136 Q_D(const QScriptDebuggerCommand);
137 return d->type;
138}
139
140/*!
141 Returns the value of the given \a attribute, or \a defaultValue
142 if the attribute is not defined.
143*/
144QVariant QScriptDebuggerCommand::attribute(Attribute attribute,
145 const QVariant &defaultValue) const
146{
147 Q_D(const QScriptDebuggerCommand);
148 return d->attributes.value(akey: attribute, adefaultValue: defaultValue);
149}
150
151/*!
152 Sets the \a value of the given \a attribute.
153*/
154void QScriptDebuggerCommand::setAttribute(Attribute attribute,
155 const QVariant &value)
156{
157 Q_D(QScriptDebuggerCommand);
158 if (!value.isValid())
159 d->attributes.remove(akey: attribute);
160 else
161 d->attributes[attribute] = value;
162}
163
164QHash<QScriptDebuggerCommand::Attribute, QVariant> QScriptDebuggerCommand::attributes() const
165{
166 Q_D(const QScriptDebuggerCommand);
167 return d->attributes;
168}
169
170/*!
171 Returns the FileName attribute of this command converted to a string.
172 This function is provided for convenience.
173
174 \sa attribute()
175*/
176QString QScriptDebuggerCommand::fileName() const
177{
178 Q_D(const QScriptDebuggerCommand);
179 return d->attributes.value(akey: FileName).toString();
180}
181
182void QScriptDebuggerCommand::setFileName(const QString &fileName)
183{
184 Q_D(QScriptDebuggerCommand);
185 d->attributes[FileName] = fileName;
186}
187
188/*!
189 Returns the LineNumber attribute of this command converted to an int.
190 This function is provided for convenience.
191
192 \sa attribute()
193*/
194int QScriptDebuggerCommand::lineNumber() const
195{
196 Q_D(const QScriptDebuggerCommand);
197 return d->attributes.value(akey: LineNumber, adefaultValue: -1).toInt();
198}
199
200void QScriptDebuggerCommand::setLineNumber(int lineNumber)
201{
202 Q_D(QScriptDebuggerCommand);
203 d->attributes[LineNumber] = lineNumber;
204}
205
206/*!
207 Returns the ScriptID attribute of this command converted to a qint64.
208 This function is provided for convenience.
209
210 \sa attribute()
211*/
212qint64 QScriptDebuggerCommand::scriptId() const
213{
214 Q_D(const QScriptDebuggerCommand);
215 return d->attributes.value(akey: ScriptID, adefaultValue: -1).toLongLong();
216}
217
218void QScriptDebuggerCommand::setScriptId(qint64 id)
219{
220 Q_D(QScriptDebuggerCommand);
221 d->attributes[ScriptID] = id;
222}
223
224QString QScriptDebuggerCommand::program() const
225{
226 Q_D(const QScriptDebuggerCommand);
227 return d->attributes.value(akey: Program).toString();
228}
229
230void QScriptDebuggerCommand::setProgram(const QString &program)
231{
232 Q_D(QScriptDebuggerCommand);
233 d->attributes[Program] = program;
234}
235
236int QScriptDebuggerCommand::breakpointId() const
237{
238 Q_D(const QScriptDebuggerCommand);
239 return d->attributes.value(akey: BreakpointID, adefaultValue: -1).toInt();
240}
241
242void QScriptDebuggerCommand::setBreakpointId(int id)
243{
244 Q_D(QScriptDebuggerCommand);
245 d->attributes[BreakpointID] = id;
246}
247
248QScriptBreakpointData QScriptDebuggerCommand::breakpointData() const
249{
250 Q_D(const QScriptDebuggerCommand);
251 return qvariant_cast<QScriptBreakpointData>(v: d->attributes.value(akey: BreakpointData));
252}
253
254void QScriptDebuggerCommand::setBreakpointData(const QScriptBreakpointData &data)
255{
256 Q_D(QScriptDebuggerCommand);
257 d->attributes[BreakpointData] = QVariant::fromValue(value: data);
258}
259
260QScriptDebuggerValue QScriptDebuggerCommand::scriptValue() const
261{
262 Q_D(const QScriptDebuggerCommand);
263 return qvariant_cast<QScriptDebuggerValue>(v: d->attributes.value(akey: ScriptValue));
264}
265
266void QScriptDebuggerCommand::setScriptValue(const QScriptDebuggerValue &value)
267{
268 Q_D(QScriptDebuggerCommand);
269 d->attributes[ScriptValue] = QVariant::fromValue(value);
270}
271
272int QScriptDebuggerCommand::contextIndex() const
273{
274 Q_D(const QScriptDebuggerCommand);
275 return d->attributes.value(akey: ContextIndex, adefaultValue: -1).toInt();
276}
277
278void QScriptDebuggerCommand::setContextIndex(int index)
279{
280 Q_D(QScriptDebuggerCommand);
281 d->attributes[ContextIndex] = index;
282}
283
284int QScriptDebuggerCommand::iteratorId() const
285{
286 Q_D(const QScriptDebuggerCommand);
287 return d->attributes.value(akey: IteratorID, adefaultValue: -1).toInt();
288}
289
290void QScriptDebuggerCommand::setIteratorId(int id)
291{
292 Q_D(QScriptDebuggerCommand);
293 d->attributes[IteratorID] = id;
294}
295
296QString QScriptDebuggerCommand::name() const
297{
298 Q_D(const QScriptDebuggerCommand);
299 return d->attributes.value(akey: Name).toString();
300}
301
302void QScriptDebuggerCommand::setName(const QString &name)
303{
304 Q_D(QScriptDebuggerCommand);
305 d->attributes[Name] = name;
306}
307
308QScriptDebuggerValue QScriptDebuggerCommand::subordinateScriptValue() const
309{
310 Q_D(const QScriptDebuggerCommand);
311 return qvariant_cast<QScriptDebuggerValue>(v: d->attributes.value(akey: SubordinateScriptValue));
312}
313
314void QScriptDebuggerCommand::setSubordinateScriptValue(const QScriptDebuggerValue &value)
315{
316 Q_D(QScriptDebuggerCommand);
317 d->attributes[SubordinateScriptValue] = QVariant::fromValue(value);
318}
319
320int QScriptDebuggerCommand::snapshotId() const
321{
322 Q_D(const QScriptDebuggerCommand);
323 return d->attributes.value(akey: SnapshotID, adefaultValue: -1).toInt();
324}
325
326void QScriptDebuggerCommand::setSnapshotId(int id)
327{
328 Q_D(QScriptDebuggerCommand);
329 d->attributes[SnapshotID] = id;
330}
331
332/*!
333 Returns true if this QScriptDebuggerCommand is equal to the \a other
334 command, otherwise returns false.
335*/
336bool QScriptDebuggerCommand::operator==(const QScriptDebuggerCommand &other) const
337{
338 Q_D(const QScriptDebuggerCommand);
339 const QScriptDebuggerCommandPrivate *od = other.d_func();
340 if (d == od)
341 return true;
342 if (!d || !od)
343 return false;
344 return ((d->type == od->type)
345 && (d->attributes == od->attributes));
346}
347
348/*!
349 Returns true if this QScriptDebuggerCommand is not equal to the \a
350 other command, otherwise returns false.
351*/
352bool QScriptDebuggerCommand::operator!=(const QScriptDebuggerCommand &other) const
353{
354 return !(*this == other);
355}
356
357QScriptDebuggerCommand QScriptDebuggerCommand::interruptCommand()
358{
359 QScriptDebuggerCommand cmd(Interrupt);
360 return cmd;
361}
362
363QScriptDebuggerCommand QScriptDebuggerCommand::continueCommand()
364{
365 QScriptDebuggerCommand cmd(Continue);
366 return cmd;
367}
368
369QScriptDebuggerCommand QScriptDebuggerCommand::stepIntoCommand(int count)
370{
371 QScriptDebuggerCommand cmd(StepInto);
372 cmd.setAttribute(attribute: StepCount, value: count);
373 return cmd;
374}
375
376QScriptDebuggerCommand QScriptDebuggerCommand::stepOverCommand(int count)
377{
378 QScriptDebuggerCommand cmd(StepOver);
379 cmd.setAttribute(attribute: StepCount, value: count);
380 return cmd;
381}
382
383QScriptDebuggerCommand QScriptDebuggerCommand::stepOutCommand()
384{
385 QScriptDebuggerCommand cmd(StepOut);
386 return cmd;
387}
388
389QScriptDebuggerCommand QScriptDebuggerCommand::runToLocationCommand(const QString &fileName, int lineNumber)
390{
391 QScriptDebuggerCommand cmd(RunToLocation);
392 cmd.setFileName(fileName);
393 cmd.setLineNumber(lineNumber);
394 return cmd;
395}
396
397QScriptDebuggerCommand QScriptDebuggerCommand::runToLocationCommand(qint64 scriptId, int lineNumber)
398{
399 QScriptDebuggerCommand cmd(RunToLocationByID);
400 cmd.setScriptId(scriptId);
401 cmd.setLineNumber(lineNumber);
402 return cmd;
403}
404
405QScriptDebuggerCommand QScriptDebuggerCommand::forceReturnCommand(int contextIndex, const QScriptDebuggerValue &value)
406{
407 QScriptDebuggerCommand cmd(ForceReturn);
408 cmd.setContextIndex(contextIndex);
409 cmd.setScriptValue(value);
410 return cmd;
411}
412
413QScriptDebuggerCommand QScriptDebuggerCommand::resumeCommand()
414{
415 QScriptDebuggerCommand cmd(Resume);
416 return cmd;
417}
418
419QScriptDebuggerCommand QScriptDebuggerCommand::setBreakpointCommand(const QString &fileName, int lineNumber)
420{
421 QScriptDebuggerCommand cmd(SetBreakpoint);
422 cmd.setBreakpointData(QScriptBreakpointData(fileName, lineNumber));
423 return cmd;
424}
425
426QScriptDebuggerCommand QScriptDebuggerCommand::setBreakpointCommand(const QScriptBreakpointData &data)
427{
428 QScriptDebuggerCommand cmd(SetBreakpoint);
429 cmd.setBreakpointData(data);
430 return cmd;
431}
432
433QScriptDebuggerCommand QScriptDebuggerCommand::deleteBreakpointCommand(int id)
434{
435 QScriptDebuggerCommand cmd(DeleteBreakpoint);
436 cmd.setBreakpointId(id);
437 return cmd;
438}
439
440QScriptDebuggerCommand QScriptDebuggerCommand::deleteAllBreakpointsCommand()
441{
442 QScriptDebuggerCommand cmd(DeleteAllBreakpoints);
443 return cmd;
444}
445
446QScriptDebuggerCommand QScriptDebuggerCommand::getBreakpointsCommand()
447{
448 QScriptDebuggerCommand cmd(GetBreakpoints);
449 return cmd;
450}
451
452QScriptDebuggerCommand QScriptDebuggerCommand::getBreakpointDataCommand(int id)
453{
454 QScriptDebuggerCommand cmd(GetBreakpointData);
455 cmd.setBreakpointId(id);
456 return cmd;
457}
458
459QScriptDebuggerCommand QScriptDebuggerCommand::setBreakpointDataCommand(int id, const QScriptBreakpointData &data)
460{
461 QScriptDebuggerCommand cmd(SetBreakpointData);
462 cmd.setBreakpointId(id);
463 cmd.setBreakpointData(data);
464 return cmd;
465}
466
467QScriptDebuggerCommand QScriptDebuggerCommand::getScriptsCommand()
468{
469 QScriptDebuggerCommand cmd(GetScripts);
470 return cmd;
471}
472
473QScriptDebuggerCommand QScriptDebuggerCommand::getScriptDataCommand(qint64 id)
474{
475 QScriptDebuggerCommand cmd(GetScriptData);
476 cmd.setScriptId(id);
477 return cmd;
478}
479
480QScriptDebuggerCommand QScriptDebuggerCommand::scriptsCheckpointCommand()
481{
482 QScriptDebuggerCommand cmd(ScriptsCheckpoint);
483 return cmd;
484}
485
486QScriptDebuggerCommand QScriptDebuggerCommand::getScriptsDeltaCommand()
487{
488 QScriptDebuggerCommand cmd(GetScriptsDelta);
489 return cmd;
490}
491
492QScriptDebuggerCommand QScriptDebuggerCommand::resolveScriptCommand(const QString &fileName)
493{
494 QScriptDebuggerCommand cmd(ResolveScript);
495 cmd.setFileName(fileName);
496 return cmd;
497}
498
499QScriptDebuggerCommand QScriptDebuggerCommand::getBacktraceCommand()
500{
501 QScriptDebuggerCommand cmd(GetBacktrace);
502 return cmd;
503}
504
505QScriptDebuggerCommand QScriptDebuggerCommand::getContextCountCommand()
506{
507 QScriptDebuggerCommand cmd(GetContextCount);
508 return cmd;
509}
510
511QScriptDebuggerCommand QScriptDebuggerCommand::getContextStateCommand(int contextIndex)
512{
513 QScriptDebuggerCommand cmd(GetContextState);
514 cmd.setContextIndex(contextIndex);
515 return cmd;
516}
517
518QScriptDebuggerCommand QScriptDebuggerCommand::getContextInfoCommand(int contextIndex)
519{
520 QScriptDebuggerCommand cmd(GetContextInfo);
521 cmd.setContextIndex(contextIndex);
522 return cmd;
523}
524
525QScriptDebuggerCommand QScriptDebuggerCommand::getContextIdCommand(int contextIndex)
526{
527 QScriptDebuggerCommand cmd(GetContextID);
528 cmd.setContextIndex(contextIndex);
529 return cmd;
530}
531
532QScriptDebuggerCommand QScriptDebuggerCommand::getThisObjectCommand(int contextIndex)
533{
534 QScriptDebuggerCommand cmd(GetThisObject);
535 cmd.setContextIndex(contextIndex);
536 return cmd;
537}
538
539QScriptDebuggerCommand QScriptDebuggerCommand::getActivationObjectCommand(int contextIndex)
540{
541 QScriptDebuggerCommand cmd(GetActivationObject);
542 cmd.setContextIndex(contextIndex);
543 return cmd;
544}
545
546QScriptDebuggerCommand QScriptDebuggerCommand::getScopeChainCommand(int contextIndex)
547{
548 QScriptDebuggerCommand cmd(GetScopeChain);
549 cmd.setContextIndex(contextIndex);
550 return cmd;
551}
552
553QScriptDebuggerCommand QScriptDebuggerCommand::contextsCheckpoint()
554{
555 QScriptDebuggerCommand cmd(ContextsCheckpoint);
556 return cmd;
557}
558
559QScriptDebuggerCommand QScriptDebuggerCommand::getPropertyExpressionValue(
560 int contextIndex, int lineNumber, const QStringList &path)
561{
562 QScriptDebuggerCommand cmd(GetPropertyExpressionValue);
563 cmd.setContextIndex(contextIndex);
564 cmd.setLineNumber(lineNumber);
565 cmd.setAttribute(attribute: UserAttribute, value: path);
566 return cmd;
567}
568
569QScriptDebuggerCommand QScriptDebuggerCommand::getCompletions(
570 int contextIndex, const QStringList &path)
571{
572 QScriptDebuggerCommand cmd(GetCompletions);
573 cmd.setContextIndex(contextIndex);
574 cmd.setAttribute(attribute: UserAttribute, value: path);
575 return cmd;
576}
577
578QScriptDebuggerCommand QScriptDebuggerCommand::newScriptObjectSnapshotCommand()
579{
580 QScriptDebuggerCommand cmd(NewScriptObjectSnapshot);
581 return cmd;
582}
583
584QScriptDebuggerCommand QScriptDebuggerCommand::scriptObjectSnapshotCaptureCommand(int id, const QScriptDebuggerValue &object)
585{
586 Q_ASSERT(object.type() == QScriptDebuggerValue::ObjectValue);
587 QScriptDebuggerCommand cmd(ScriptObjectSnapshotCapture);
588 cmd.setSnapshotId(id);
589 cmd.setScriptValue(object);
590 return cmd;
591}
592
593QScriptDebuggerCommand QScriptDebuggerCommand::deleteScriptObjectSnapshotCommand(int id)
594{
595 QScriptDebuggerCommand cmd(DeleteScriptObjectSnapshot);
596 cmd.setSnapshotId(id);
597 return cmd;
598}
599
600QScriptDebuggerCommand QScriptDebuggerCommand::newScriptValueIteratorCommand(const QScriptDebuggerValue &object)
601{
602 QScriptDebuggerCommand cmd(NewScriptValueIterator);
603 Q_ASSERT(object.type() == QScriptDebuggerValue::ObjectValue);
604 cmd.setScriptValue(object);
605 return cmd;
606}
607
608QScriptDebuggerCommand QScriptDebuggerCommand::getPropertiesByIteratorCommand(int id, int count)
609{
610 Q_UNUSED(count);
611 QScriptDebuggerCommand cmd(GetPropertiesByIterator);
612 cmd.setIteratorId(id);
613 return cmd;
614}
615
616QScriptDebuggerCommand QScriptDebuggerCommand::deleteScriptValueIteratorCommand(int id)
617{
618 QScriptDebuggerCommand cmd(DeleteScriptValueIterator);
619 cmd.setIteratorId(id);
620 return cmd;
621}
622
623QScriptDebuggerCommand QScriptDebuggerCommand::evaluateCommand(
624 int contextIndex, const QString &program, const QString &fileName, int lineNumber)
625{
626 QScriptDebuggerCommand cmd(Evaluate);
627 cmd.setContextIndex(contextIndex);
628 cmd.setProgram(program);
629 cmd.setFileName(fileName);
630 cmd.setLineNumber(lineNumber);
631 return cmd;
632}
633
634QScriptDebuggerCommand QScriptDebuggerCommand::scriptValueToStringCommand(const QScriptDebuggerValue &value)
635{
636 QScriptDebuggerCommand cmd(ScriptValueToString);
637 cmd.setScriptValue(value);
638 return cmd;
639}
640
641QScriptDebuggerCommand QScriptDebuggerCommand::setScriptValuePropertyCommand(
642 const QScriptDebuggerValue &object, const QString &name,
643 const QScriptDebuggerValue &value)
644{
645 QScriptDebuggerCommand cmd(SetScriptValueProperty);
646 cmd.setScriptValue(object);
647 cmd.setName(name);
648 cmd.setSubordinateScriptValue(value);
649 return cmd;
650}
651
652QScriptDebuggerCommand QScriptDebuggerCommand::clearExceptionsCommand()
653{
654 QScriptDebuggerCommand cmd(ClearExceptions);
655 return cmd;
656}
657
658/*!
659 \relates QScriptDebuggerCommand
660
661 Writes the given \a command to the specified \a stream.
662*/
663QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command)
664{
665 const QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
666 out << (quint32)d->type;
667 out << (qint32)d->attributes.size();
668 QHash<QScriptDebuggerCommand::Attribute, QVariant>::const_iterator it;
669 for (it = d->attributes.constBegin(); it != d->attributes.constEnd(); ++it) {
670 out << (quint32)it.key();
671 out << it.value();
672 }
673 return out;
674}
675
676/*!
677 \relates QScriptDebuggerCommand
678
679 Reads a QScriptDebuggerCommand from the specified \a stream into the
680 given \a command.
681*/
682QDataStream &operator>>(QDataStream &in, QScriptDebuggerCommand &command)
683{
684 QScriptDebuggerCommandPrivate *d = command.d_ptr.data();
685
686 quint32 type;
687 in >> type;
688 d->type = QScriptDebuggerCommand::Type(type);
689
690 qint32 attribCount;
691 in >> attribCount;
692 QHash<QScriptDebuggerCommand::Attribute, QVariant> attribs;
693 for (qint32 i = 0; i < attribCount; ++i) {
694 quint32 key;
695 in >> key;
696 QVariant value;
697 in >> value;
698 attribs[QScriptDebuggerCommand::Attribute(key)] = value;
699 }
700 d->attributes = attribs;
701
702 return in;
703}
704
705QT_END_NAMESPACE
706

source code of qtscript/src/scripttools/debugging/qscriptdebuggercommand.cpp