Qore Programming Language  1.7.0
QoreDebugProgram Class Reference

supports parsing and executing Qore-language code, reference counted, dynamically-allocated only More...

#include <QoreDebugProgram.h>

Inheritance diagram for QoreDebugProgram:
Collaboration diagram for QoreDebugProgram:

Public Member Methods

DLLEXPORT QoreDebugProgram ()
 creates the object
 
DLLEXPORT int breakProgram (QoreProgram *pgm) const
 
DLLEXPORT int breakProgramThread (QoreProgram *pgm, int tid) const
 
DLLEXPORT int getInterruptedCount ()
 get number of program currently interrupted
 
virtual DLLEXPORT void onException (QoreProgram *pgm, const AbstractStatement *statement, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
 
virtual DLLEXPORT void onExit (QoreProgram *pgm, const StatementBlock *statement, QoreValue &returnValue, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
 
virtual DLLEXPORT void onFunctionEnter (QoreProgram *pgm, const StatementBlock *statement, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
 
virtual DLLEXPORT void onFunctionExit (QoreProgram *pgm, const StatementBlock *statement, QoreValue &returnValue, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
 
virtual DLLEXPORT void onStep (QoreProgram *pgm, const StatementBlock *blockStatement, const AbstractStatement *statement, unsigned bkptId, int &flow, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
 
DLLEXPORT void waitForTerminationAndClear (ExceptionSink *xsink)
 remove programs and wait till the program's last thread terminates More...
 
- Public Member Methods inherited from AbstractPrivateData
virtual DLLLOCAL void deref ()
 decrements the reference count of the object without the possibility of throwing a Qore-language exception
 
virtual DLLLOCAL void deref (ExceptionSink *xsink)
 decrements the reference count of the object More...
 
DLLLOCAL void ref () const
 increments the reference count of the object
 
- Public Member Methods inherited from QoreReferenceCounter
DLLEXPORT QoreReferenceCounter ()
 creates the reference counter object
 
DLLEXPORT QoreReferenceCounter (const QoreReferenceCounter &old)
 creates a new object with a reference count of 1 More...
 
DLLEXPORT ~QoreReferenceCounter ()
 destroys the reference counter object
 
DLLEXPORT bool is_unique () const
 returns true if the reference count is 1 More...
 
DLLEXPORT int reference_count () const
 gets the reference count More...
 
DLLEXPORT bool ROdereference () const
 atomically decrements the reference count More...
 
DLLEXPORT void ROreference () const
 atomically increments the reference count
 

Private Member Methods

virtual DLLLOCAL ~QoreDebugProgram ()
 the destructor is private in order to prohibit the object from being allocated on the stack More...
 
- Private Member Methods inherited from AbstractPrivateData
virtual DLLLOCAL ~AbstractPrivateData ()
 as these objects are reference counted, the destructor should be called only when the reference count = 0 and not manually
 

Detailed Description

supports parsing and executing Qore-language code, reference counted, dynamically-allocated only

This class implements a transaction and thread-safe container for qore-language code This class implements two-layered reference counting to address problems with circular references. When a program has a global variable that contains an object that references the program... objects now reference the dependency counter, so when the object's counter reaches zero and the global variable list is deleted, then the variables will in turn dereference the program so it can be deleted.

Constructor & Destructor Documentation

◆ ~QoreDebugProgram()

virtual DLLLOCAL QoreDebugProgram::~QoreDebugProgram ( )
privatevirtual

the destructor is private in order to prohibit the object from being allocated on the stack

the destructor will wait till all debug calls are terminated

Member Function Documentation

◆ breakProgram()

DLLEXPORT int QoreDebugProgram::breakProgram ( QoreProgram pgm) const

Break program, i.e. all threads

Returns
0 if the operation was successful, -1 if the target program does not allow debugging, -2 if xxx

◆ breakProgramThread()

DLLEXPORT int QoreDebugProgram::breakProgramThread ( QoreProgram pgm,
int  tid 
) const

Break specific program thread

Returns
0 if the operation was successful, -1 if the target program does not allow debugging, -2 if xxx

◆ onException()

virtual DLLEXPORT void QoreDebugProgram::onException ( QoreProgram pgm,
const AbstractStatement *  statement,
DebugRunStateEnum &  rs,
const AbstractStatement *&  rts,
ExceptionSink xsink 
)
virtual

Executed when an exception is raised.

◆ onExit()

virtual DLLEXPORT void QoreDebugProgram::onExit ( QoreProgram pgm,
const StatementBlock *  statement,
QoreValue returnValue,
DebugRunStateEnum &  rs,
const AbstractStatement *&  rts,
ExceptionSink xsink 
)
virtual

Executed when a thread/program is exited.

◆ onFunctionEnter()

virtual DLLEXPORT void QoreDebugProgram::onFunctionEnter ( QoreProgram pgm,
const StatementBlock *  statement,
DebugRunStateEnum &  rs,
const AbstractStatement *&  rts,
ExceptionSink xsink 
)
virtual

Executed when a function is entered.

◆ onFunctionExit()

virtual DLLEXPORT void QoreDebugProgram::onFunctionExit ( QoreProgram pgm,
const StatementBlock *  statement,
QoreValue returnValue,
DebugRunStateEnum &  rs,
const AbstractStatement *&  rts,
ExceptionSink xsink 
)
virtual

Executed when a function is exited.

◆ onStep()

virtual DLLEXPORT void QoreDebugProgram::onStep ( QoreProgram pgm,
const StatementBlock *  blockStatement,
const AbstractStatement *  statement,
unsigned  bkptId,
int &  flow,
DebugRunStateEnum &  rs,
const AbstractStatement *&  rts,
ExceptionSink xsink 
)
virtual

Executed on every step of StatementBlock.

Parameters
pgm
blockStatement
bkptIdbreakpoint id if hit otherwise 0
statementcurrent AbstractStatement of blockStatement being processed. Executed also when blockStatement is entered with value of NULL
flowloop flow
rsrun state
rts"run to" statement
xsinkif an error occurs, the Qore-language exception information will be added here

◆ waitForTerminationAndClear()

DLLEXPORT void QoreDebugProgram::waitForTerminationAndClear ( ExceptionSink xsink)

remove programs and wait till the program's last thread terminates

Parameters
xsinkif an error occurs, the Qore-language exception information will be added here

The documentation for this class was generated from the following file: