Eneboo - Documentación para desarrolladores
src/qsa/src/engine/qsdebugger.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qsdebugger.h  1.1.5   edited 2006-02-23T15:39:57$
00003 **
00004 ** Copyright (C) 2001-2006 Trolltech AS.  All rights reserved.
00005 **
00006 ** This file is part of the Qt Script for Applications framework (QSA).
00007 **
00008 ** This file may be distributed and/or modified under the terms of the
00009 ** GNU General Public License version 2 as published by the Free Software
00010 ** Foundation and appearing in the file LICENSE.GPL included in the
00011 ** packaging of this file.
00012 **
00013 ** Licensees holding a valid Qt Script for Applications license may use
00014 ** this file in accordance with the Qt Script for Applications License
00015 ** Agreement provided with the Software.
00016 **
00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00019 **
00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00021 **   information about QSA Commercial License Agreements.
00022 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00023 **
00024 ** Contact info@trolltech.com if any conditions of this licensing are
00025 ** not clear to you.
00026 **
00027 *****************************************************************************/
00028 
00029 #ifndef QSDEBUGGER_H
00030 #define QSDEBUGGER_H
00031 
00032 #ifdef QSDEBUGGER
00033 
00034 #include "qsinternal.h"
00035 
00036 class QSStatementNode;
00037 class QSEnv;
00038 
00039 class QUICKCORE_EXPORT Debugger
00040 {
00041   friend class QSEngineImp;
00042   friend class QSStatementNode;
00043   friend class QSClass;
00044 public:
00048   enum Mode { Disabled = 0, Next, Step, Continue, Stop };
00052   Debugger(QSEngine *s);
00057   virtual ~Debugger();
00061   void attach(QSEngine *e);
00066   QSEngine *engine() const {
00067     return eng;
00068   }
00072   void detach();
00077   virtual void setMode(Mode m) {
00078     dmode = m;
00079   }
00083   Mode mode() const {
00084     return dmode;
00085   }
00090   int lineNumber() const {
00091     return l;
00092   }
00097   int sourceId() const {
00098     return sid;
00099   }
00105   bool setBreakpoint(int id, int line);
00106   bool deleteBreakpoint(int id, int line);
00107   void clearAllBreakpoints(int id = -1);
00108   static bool validBreakpoint(const QString &code, int line);
00112   QString varInfo(const QString &ident) const;
00117   bool setVar(const QString &ident, const QSObject &value);
00118 
00119   QSEnv *env() const {
00120     return eng->env();
00121   }
00122 
00123   void setSourceId(int i) {
00124     sid = i;
00125   }
00126 
00127   virtual void storeExceptionStack() { }
00128   virtual void clear() {};
00129 
00130 protected:
00139   virtual bool stopEvent() {
00140     return true;
00141   }
00152   int freeSourceId() const;
00157   virtual void callEvent(const QString & = QString::null,
00158                          const QString & = QString::null) {}
00162   virtual void returnEvent() {}
00163 
00164 private:
00165   void reset() {
00166     l = -1;
00167   }
00168   bool hit(int line, bool breakPoint);
00169 
00170   QSEngine *eng;
00171   Mode dmode;
00172   int l;
00173   int sid;
00174 };
00175 
00176 #endif
00177 
00178 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'