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();
180 #endif // _QORE_CLASS_DEBUGPROGRAM_H