Qore Programming Language Reference Manual  0.8.13.8
QC_DebugProgram.dox.h
1 namespace Qore {
4 
41 class DebugProgram {
42 
43 public:
45 /***
46  */
47 nothing addProgram(ProgramControl pgm);
48 
49 public:
51 /*** @return 0 if the operation was successful, returns -1 if the program does not allow debugging (i.e. @ref Qore::PO_NO_DEBUGGING is set) or -2 if the program has not been set as a debug target
52  */
54 
55 public:
57 /*** @return 0 if the operation was successful, returns -1 if the program does not allow debugging (i.e. @ref Qore::PO_NO_DEBUGGING is set), -2 if the program has not been set as a debug target, or -3 if the given thread is not active in the target program
58  */
59 int breakProgramThread(ProgramControl pgm, int tid);
60 
61 public:
63 /***
64  */
65  constructor();
66 
67 public:
69 
71  copy();
72 
73 public:
75 /***
76  */
77  destructor();
78 
79 public:
81 /***
82  */
84 
85 public:
87 /***
88  */
90 
91 public:
93 /***
94  */
95 abstract onAttach(ProgramControl pgm, reference rs);
96 
97 public:
99 /***
100  */
101 abstract onDetach(ProgramControl pgm, reference rs);
102 
103 public:
105 
108 abstract onException(ProgramControl pgm, int statement, hash ex, reference dismiss, reference rs);
109 
110 public:
112 
115 abstract onExit(ProgramControl pgm, int statement, reference returnValue, reference rs);
116 
117 public:
119 
122 abstract onFunctionEnter(ProgramControl pgm, int statement, reference rs);
123 
124 public:
126 
129 abstract onFunctionExit(ProgramControl pgm, int statement, reference returnValue, reference rs);
130 
131 public:
133 /***
134  */
135 abstract onStep(ProgramControl pgm, int blockStatement, *int statement, *int breakpointId, reference flow, reference rs);
136 
137 public:
139 /***
140  */
141 nothing removeProgram(ProgramControl pgm);
142 
143 public:
145 /***
146  */
148 };
156 
158  const DebugDetach = DBG_RS_DETACH;
160  const DebugRun = DBG_RS_RUN;
162  const DebugStep = DBG_RS_STEP;
164  const DebugStepOver = DBG_RS_STEP_OVER;
166  const DebugUntilReturn = DBG_RS_UNTIL_RETURN;
168 
174 
176  const DebugFlowBreak = RC_BREAK;
178  const DebugFlowContinue = RC_CONTINUE;
180  const DebugFlowReturn = RC_RETURN;
182 };
abstract onExit(ProgramControl pgm, int statement, reference returnValue, reference rs)
Executed when a program/thread is exited.
DebugProgram class supports Qore Program debugging via ProgramControl.
Definition: QC_DebugProgram.dox.h:41
const DebugDetach
Detach program from debugging, it is not normally used from script.
Definition: QC_DebugProgram.dox.h:158
int breakProgramThread(ProgramControl pgm, int tid)
Break particular program thread.
abstract onFunctionEnter(ProgramControl pgm, int statement, reference rs)
Executed when a function is entered.
const DebugFlowBreak
force break Statements command
Definition: QC_DebugProgram.dox.h:176
int getInterruptedCount()
Get number of interrupted threads.
const DebugFlowContinue
force continue Statements command
Definition: QC_DebugProgram.dox.h:178
nothing waitForTerminationAndClear()
Clear all programs and wait for all threads to finish executing callbacks.
abstract onAttach(ProgramControl pgm, reference rs)
Executed when new thread is attached to program being debugged.
copy()
Throws an exception to prevent objects of this class from being copied.
int breakProgram(ProgramControl pgm)
Break program, i.e. all threads.
abstract onStep(ProgramControl pgm, int blockStatement, *int statement, *int breakpointId, reference flow, reference rs)
Executed when step is performed.
const DebugFlowReturn
force return Statements command
Definition: QC_DebugProgram.dox.h:180
list list(...)
Returns an untyped list of the arguments passed at the top level.
The ProgramControl class provides safe information about a Qore program.
Definition: QC_ProgramControl.dox.h:41
const DebugRun
Run program, avoid stepping.
Definition: QC_DebugProgram.dox.h:160
abstract onException(ProgramControl pgm, int statement, hash ex, reference dismiss, reference rs)
Executed when an exception is raised.
nothing addProgram(ProgramControl pgm)
Add program to debugging.
const DebugStepOver
Run one step in program, in case of function call stepping does not go to function.
Definition: QC_DebugProgram.dox.h:164
constructor()
Creates the debug program object with notification functions without any functionality.
const DebugUntilReturn
Run program till function is exited.
Definition: QC_DebugProgram.dox.h:166
abstract onDetach(ProgramControl pgm, reference rs)
Executed when thread is datached from program being debugged.
destructor()
Waits for all threads to finish executing, then deletes all global variables, dereferences the intern...
const DebugStep
Run one step in program, in case of function call stepping goes on in function.
Definition: QC_DebugProgram.dox.h:162
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
hash hash(object obj)
Returns a hash of an object's members.
abstract onFunctionExit(ProgramControl pgm, int statement, reference returnValue, reference rs)
Executed when a function is exited.
list getAllPrograms()
Get all programs being debugged.
nothing removeProgram(ProgramControl pgm)
Remove program from debugging.