|
Envision
A visual programming IDE for object-oriented languages
|
A Connector to a Java VM via the JDWP protocol. More...
Public Types | |
| using | EventListener = std::function< void(Event)> |
Public Member Functions | |
| DebugConnector () | |
| ~DebugConnector () | |
| void | addEventListener (Protocol::EventKind kind, EventListener listener) |
| Add the listener callback to the connector. More... | |
| QList< qint64 > | allThreadIds () |
| int | arrayLength (qint64 arrayId) |
| ArrayValues | arrayValues (qint64 arrayId, qint32 firstIndex, qint32 length) |
| bool | breakAtClassLoad (QString className) |
| qint64 | classIdOf (const QString &signature) |
| bool | clearBreakpoint (qint32 requestId) |
| void | connect (QString vmHostName="localhost", int vmHostPort=4000) |
| Connects to the JVM at vmHostName on port vmHostPort. More... | |
| QString | fileNameForReference (qint64 referenceId) |
| Frames | frames (qint64 threadId, qint32 numFrames, qint32 startFrame=0) |
| LineTable | lineTable (qint64 classId, qint64 methodId) |
| qint64 | methodIdOf (qint64 classId, const QString &signature) |
| bool | resume () |
| Resumes the VM, do not use this function inside event handlers, use wantResume instead. More... | |
| int | setBreakpoint (Location breakLocation) |
| QString | signatureOf (qint64 referenceId) |
| int | singleStep (qint64 threadId, Protocol::StepSize stepSize=Protocol::StepSize::LINE, Protocol::StepDepth stepDepth=Protocol::StepDepth::OVER) |
| QString | stringFromId (qint64 stringId) |
| bool | suspend () |
| Suspends the execution on the VM and returns true on succes. More... | |
| QString | threadName (qint64 threadId) |
| Values | values (qint64 threadId, qint64 frameId, QList< StackVariable > variables) |
| VariableTable | variableTableForMethod (qint64 classId, qint64 methodId) |
| bool | vmAlive () |
| Returns if the program on the target VM is running. More... | |
| void | wantResume (bool resume) |
| Specify that you want to resume, if there are multiple events all should agree otherwise we don't resume. More... | |
Static Public Attributes | |
| static constexpr int | NO_RESULT {-1} |
Private Types | |
| enum class | ResumeRequest : int { NEUTRAL , RESUME , DONTRESUME } |
Private Member Functions | |
| void | checkIdSizes () |
| void | checkVersion () |
| void | dispatchEvents () |
| void | handleComposite (QByteArray data) |
| void | handleSocketError (QAbstractSocket::SocketError socketError) |
| void | readFromSocket () |
| void | readHandshake () |
| QByteArray | sendCommand (const Command &command) |
| Sends the command to the VM and returns the corresponding reply as a QByteArray. More... | |
| void | sendHandshake () |
| QByteArray | waitForReply (qint32 requestId) |
| Waits until the Reply for the request with id requestId is received. More... | |
Private Attributes | |
| QHash< Protocol::EventKind, EventListener > | eventListeners_ |
| QByteArray | incompleteData_ |
| QList< QByteArray > | messagesReadyForProcessing_ |
| enum OODebug::DebugConnector::ResumeRequest | resumeRequest_ |
| QTcpSocket | tcpSocket_ |
| bool | vmAlive_ {} |
A Connector to a Java VM via the JDWP protocol.
| using OODebug::DebugConnector::EventListener = std::function<void (Event)> |
|
strongprivate |
| OODebug::DebugConnector::DebugConnector | ( | ) |
| OODebug::DebugConnector::~DebugConnector | ( | ) |
|
inline |
Add the listener callback to the connector.
The listener is called whenever and Event of type kind is received.
If there is already a listener for this kind the previous one is replaced!
| QList< qint64 > OODebug::DebugConnector::allThreadIds | ( | ) |
| int OODebug::DebugConnector::arrayLength | ( | qint64 | arrayId | ) |
| ArrayValues OODebug::DebugConnector::arrayValues | ( | qint64 | arrayId, |
| qint32 | firstIndex, | ||
| qint32 | length | ||
| ) |
| bool OODebug::DebugConnector::breakAtClassLoad | ( | QString | className | ) |
|
private |
|
private |
| qint64 OODebug::DebugConnector::classIdOf | ( | const QString & | signature | ) |
| bool OODebug::DebugConnector::clearBreakpoint | ( | qint32 | requestId | ) |
| void OODebug::DebugConnector::connect | ( | QString | vmHostName = "localhost", |
| int | vmHostPort = 4000 |
||
| ) |
Connects to the JVM at vmHostName on port vmHostPort.
|
private |
| QString OODebug::DebugConnector::fileNameForReference | ( | qint64 | referenceId | ) |
| Frames OODebug::DebugConnector::frames | ( | qint64 | threadId, |
| qint32 | numFrames, | ||
| qint32 | startFrame = 0 |
||
| ) |
|
private |
|
private |
| LineTable OODebug::DebugConnector::lineTable | ( | qint64 | classId, |
| qint64 | methodId | ||
| ) |
| qint64 OODebug::DebugConnector::methodIdOf | ( | qint64 | classId, |
| const QString & | signature | ||
| ) |
|
private |
|
private |
| bool OODebug::DebugConnector::resume | ( | ) |
Resumes the VM, do not use this function inside event handlers, use wantResume instead.
|
private |
Sends the command to the VM and returns the corresponding reply as a QByteArray.
|
private |
| int OODebug::DebugConnector::setBreakpoint | ( | Location | breakLocation | ) |
| QString OODebug::DebugConnector::signatureOf | ( | qint64 | referenceId | ) |
| int OODebug::DebugConnector::singleStep | ( | qint64 | threadId, |
| Protocol::StepSize | stepSize = Protocol::StepSize::LINE, |
||
| Protocol::StepDepth | stepDepth = Protocol::StepDepth::OVER |
||
| ) |
| QString OODebug::DebugConnector::stringFromId | ( | qint64 | stringId | ) |
| bool OODebug::DebugConnector::suspend | ( | ) |
Suspends the execution on the VM and returns true on succes.
| QString OODebug::DebugConnector::threadName | ( | qint64 | threadId | ) |
| Values OODebug::DebugConnector::values | ( | qint64 | threadId, |
| qint64 | frameId, | ||
| QList< StackVariable > | variables | ||
| ) |
| VariableTable OODebug::DebugConnector::variableTableForMethod | ( | qint64 | classId, |
| qint64 | methodId | ||
| ) |
|
inline |
Returns if the program on the target VM is running.
|
private |
Waits until the Reply for the request with id requestId is received.
| void OODebug::DebugConnector::wantResume | ( | bool | resume | ) |
Specify that you want to resume, if there are multiple events all should agree otherwise we don't resume.
Note that this function should only be used in event handlers.
|
private |
|
private |
|
private |
|
staticconstexpr |
|
private |
|
private |
|
private |