All Classes Namespaces Functions Variables Groups Pages
DebugProgramControl.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* DebugProgramControl.qm Copyright 2013 - 2018 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum required Qore version
// child program won't inherit parent program options (including %allow-debugger)
namespace DebugProgramControl {
class DebugProgramControl : public DebugProgram,public AbstractDebugControl {
public:
private :
hash ctxThread;
hash ctxConnection;
Qore::Thread::RWLock rwlThread();
Qore::Thread::RWLock rwlConnection();
string serverName;
string sourceSearchPath = "";
const frameOffset = 2;
public:
constructor(string serverName) ;
destructor();
shutdown();
registerConnection(hash cx);
connectionRegistered(hash cx);
unregisterConnection(hash cx);
private:
updateConnectionContext(hash cx, auto cx_data);
public:
abstract sendDataImpl(hash cx, auto data);
abstract broadcastDataImpl(auto data);
private:
broadcastBreakpoint(hash cx, Breakpoint b, string change);
public:
Program createProgram(string fileName, *hash opts, list args, *string script);
private:
*int runAndDetach(Program pgm);
public:
*hash processCommand(hash cx, hash receiveData);
private:
auto resolveValue(string name, *string val, hash strings, auto defVal);
public:
private:
string encodeValue(string name, auto val, hash strings);
public:
private:
int resolveStatement(ProgramControl pgm, *hash value);
public:
private:
hash getBreakpointInfo(Breakpoint b);
public:
private:
*hash getSourceCode(ProgramControl pgmb, string type, hash rd);
public:
private:
string getSourceCodeForLabel(string name);
public:
private:
string getSourceCodeFromFile(string name);
public:
private:
*hash serializeLocal(string name, hash val);
public:
private:
*hash serializeLocals(*hash vals);
public:
private:
list adjustStack(list stack, *hash ctx);
public:
private:
*hash handleInterrupt(string func, ProgramControl pgm, reference runState, *int statementId, *string refName, *reference refValue, *int breakpointId, *hash except);
public:
onAttach(ProgramControl pgm, reference rs);
onDetach(ProgramControl pgm, reference rs);
onStep(ProgramControl pgm, int blockStatementId, *int statementId, *int breakpointId, reference flow, reference rs);
// backward compatability only when executed with <=0.8.13.2
onStep(ProgramControl pgm, int blockStatementId, *int statementId, reference flow, reference rs);
onFunctionEnter(ProgramControl pgm, int statementId, reference rs);
onFunctionExit(ProgramControl pgm, int statementId, reference result, reference rs);
onException(ProgramControl pgm, int statementId, hash ex, reference dismiss, reference rs);
onExit(ProgramControl pgm, int statementId, reference result, reference rs);
};
};
DebugProgramControl::DebugProgramControl::constructor
constructor(string serverName)
creates the object
DebugProgramControl::DebugProgramControl::rwlConnection
Qore::Thread::RWLock rwlConnection()
lock for ctxConnection access
DebugProgramControl::DebugProgramControl::unregisterConnection
unregisterConnection(hash cx)
unregister a connection context
DebugProgramControl::DebugProgramControl::ctxThread
hash ctxThread
data pool related to suspended thread, key is threadId
Definition: DebugProgramControl.qm.dox.h:61
list
list list(...)
DebugProgramControl::DebugProgramControl::registerConnection
registerConnection(hash cx)
register context for new connection
DebugProgramControl::DebugProgramControl
Class implementing DebugProgram control using commands.
Definition: DebugProgramControl.qm.dox.h:56
DebugProgramControl::DebugProgramControl::rwlThread
Qore::Thread::RWLock rwlThread()
lock for ctxThread access
DebugProgramControl::DebugProgramControl::runAndDetach
*int runAndDetach(Program pgm)
run and remove program from debugging
DebugProgramControl::DebugProgramControl::sendDataImpl
abstract sendDataImpl(hash cx, auto data)
send data to particular client
DebugProgramControl::DebugProgramControl::ctxConnection
hash ctxConnection
data pool for data related to cx.id
Definition: DebugProgramControl.qm.dox.h:63
DebugProgramControl::DebugProgramControl::broadcastDataImpl
abstract broadcastDataImpl(auto data)
send data to all clients
type
string type(auto arg)
DebugProgramControl::DebugProgramControl::shutdown
shutdown()
resume any blocked threads
DebugProgramControl::DebugProgramControl::connectionRegistered
connectionRegistered(hash cx)
send welcome message
DebugProgramControl::DebugProgramControl::processCommand
*hash processCommand(hash cx, hash receiveData)
process message in debugging thread, if message is related to debugged thread then put it in particul...
DebugProgramControl::DebugProgramControl::createProgram
Program createProgram(string fileName, *hash opts, list args, *string script)
Create new program.
DebugProgramControl::DebugProgramControl::sourceSearchPath
string sourceSearchPath
source file search path
Definition: DebugProgramControl.qm.dox.h:71
Qore::Thread::RWLock
hash
hash hash(object obj)
DebugProgramControl::DebugProgramControl::serverName
string serverName
server name
Definition: DebugProgramControl.qm.dox.h:69
DebugProgramControl::DebugProgramControl::destructor
destructor()
resumes any blocked threads and destroys the object