32 #ifndef _QORE_CLASS_DEBUGPROGRAM_H
34 #define _QORE_CLASS_DEBUGPROGRAM_H
37 DLLLOCAL
extern QoreClass* QC_DEBUGPROGRAM;
40 #include <qore/QoreDebugProgram.h>
41 #include <qore/ReferenceArgumentHelper.h>
51 for (
int i=0; i<paramCount; i++) {
53 args->push(params[i],
nullptr);
57 args->push(rsah.getArg(),
nullptr);
60 args->push(rtsah.getArg(),
nullptr);
61 printd(5,
"QoreDebugProgramWithCoreObject::callMethod(%s) this: %p, pgm: %p, param#: %d, rs: %d, rts: %d, xsink2: %d\n", name,
this, pgm, paramCount, rs, sid, xsink2.
isEvent());
64 rs = (DebugRunStateEnum) rsv.getAsBigInt();
68 sid = rtsv.getAsBigInt();
69 rtsv.discard(&xsink2);
84 DLLLOCAL QoreDebugProgramWithQoreObject(
QoreObject* n_qo): qo(n_qo) {
87 DLLLOCAL
virtual void onAttach(
QoreProgram *pgm, DebugRunStateEnum &rs,
const AbstractStatement* &rts,
ExceptionSink* xsink) {
90 callMethod(
"onAttach", pgm, 0, 0, rs, rts, xsink, xsink2);
92 DLLLOCAL
virtual void onDetach(
QoreProgram *pgm, DebugRunStateEnum &rs,
const AbstractStatement* &rts,
ExceptionSink* xsink) {
93 printd(5,
"QoreDebugProgramWithCoreObject::onDetach() this: %p, pgm: %p\n",
this, pgm);
95 callMethod(
"onDetach", pgm, 0, 0, rs, rts, xsink, xsink2);
97 DLLLOCAL
virtual void onStep(
QoreProgram *pgm,
const StatementBlock *blockStatement,
const AbstractStatement *statement,
unsigned bkptId,
int &flow, DebugRunStateEnum &rs,
const AbstractStatement* &rts,
ExceptionSink* xsink) {
111 params[3] = rah.getArg();
112 callMethod(
"onStep", pgm, 4, params, rs, rts, xsink, xsink2);
114 flow = v.getAsBigInt();
125 callMethod(
"onFunctionEnter", pgm, 1, params, rs, rts, xsink, xsink2);
137 params[1] = rah.getArg();
138 callMethod(
"onFunctionExit", pgm, 2, params, rs, rts, xsink, xsink2);
139 returnValue = rah.getOutputValue();
150 QoreException* except = xsink->getException();
151 params[1] = except->makeExceptionObject();
154 params[2] = rah.getArg();
155 callMethod(
"onException", pgm, 3, params, rs, rts, xsink, xsink2);
172 params[1] = rah.getArg();
173 callMethod(
"onExit", pgm, 2, params, rs, rts, xsink, xsink2);
174 returnValue = rah.getOutputValue();
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT bool isEvent() const
returns true if at least one exception is present or thread_exit has been triggered
DLLEXPORT void clear()
deletes the exception list immediately
defines a Qore-language class
Definition: QoreClass.h:249
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition: QoreDebugProgram.h:66
virtual DLLEXPORT void onFunctionEnter(QoreProgram *pgm, const StatementBlock *statement, 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)
virtual DLLEXPORT void onFunctionExit(QoreProgram *pgm, const StatementBlock *statement, QoreValue &returnValue, 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 onException(QoreProgram *pgm, const AbstractStatement *statement, DebugRunStateEnum &rs, const AbstractStatement *&rts, ExceptionSink *xsink)
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
contains constants, classes, and subnamespaces in QoreProgram objects
Definition: QoreNamespace.h:65
the implementation of Qore's object data type, reference counted, dynamically-allocated only
Definition: QoreObject.h:60
DLLEXPORT QoreValue evalMethod(const QoreString *name, const QoreListNode *args, ExceptionSink *xsink)
evaluates the given method with the arguments passed and returns the return value,...
supports parsing and executing Qore-language code, reference counted, dynamically-allocated only
Definition: QoreProgram.h:127
static DLLEXPORT QoreObject * getQoreObject(QoreProgram *pgm)
get QoreObject of QoreProgram
DLLEXPORT unsigned long getStatementId(const AbstractStatement *statement) const
get the statement id
DLLEXPORT AbstractStatement * resolveStatementId(unsigned long statementId) const
get the statement from statement id
allows a reference to be passed as an argument to Qore code
Definition: ReferenceArgumentHelper.h:58
unsigned qore_classid_t
used for the unique class ID for QoreClass objects
Definition: common.h:79
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275