Commit 62d21d12 authored by hjk's avatar hjk

Debugger: Remove traces of outdated attempt at combined stepping

Has not been usable for a while and will be superseded by
"native" mixed stepping.

Change-Id: I2902a98b7ad4e4b29e389e54fb6488bf711840dd
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 48915c62
...@@ -1924,20 +1924,4 @@ registerCommand("stackListFrames", stackListFrames) ...@@ -1924,20 +1924,4 @@ registerCommand("stackListFrames", stackListFrames)
# #
####################################################################### #######################################################################
def qmlb(args):
# executeCommand(command, to_string=True).split("\n")
warn("RUNNING: break -f QScript::FunctionWrapper::proxyCall")
output = gdb.execute("rbreak -f QScript::FunctionWrapper::proxyCall", to_string=True).split("\n")
warn("OUTPUT: %s " % output)
bp = output[0]
warn("BP: %s " % bp)
# BP: ['Breakpoint 3 at 0xf166e7: file .../qscriptfunction.cpp, line 75.\\n'] \n"
pos = bp.find(' ') + 1
warn("POS: %s " % pos)
nr = bp[bp.find(' ') + 1 : bp.find(' at ')]
warn("NR: %s " % nr)
return bp
registerCommand("qmlb", qmlb)
bbsetup() bbsetup()
...@@ -263,9 +263,6 @@ public: ...@@ -263,9 +263,6 @@ public:
bool isMasterEngine() const; bool isMasterEngine() const;
DebuggerEngine *masterEngine() const; DebuggerEngine *masterEngine() const;
virtual bool setupQmlStep(bool /*on*/) { return false; }
virtual void readyToExecuteQmlStep() {}
virtual bool canDisplayTooltip() const { return state() == InferiorStopOk; } virtual bool canDisplayTooltip() const { return state() == InferiorStopOk; }
virtual void notifyInferiorIll(); virtual void notifyInferiorIll();
......
...@@ -222,7 +222,6 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters) ...@@ -222,7 +222,6 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
m_pendingBreakpointRequests = 0; m_pendingBreakpointRequests = 0;
m_commandsDoneCallback = 0; m_commandsDoneCallback = 0;
m_stackNeeded = false; m_stackNeeded = false;
m_preparedForQmlBreak = false;
m_terminalTrap = startParameters.useTerminal; m_terminalTrap = startParameters.useTerminal;
m_fullStartDone = false; m_fullStartDone = false;
m_systemDumpersLoaded = false; m_systemDumpersLoaded = false;
...@@ -642,15 +641,6 @@ void GdbEngine::handleResponse(const QByteArray &buff) ...@@ -642,15 +641,6 @@ void GdbEngine::handleResponse(const QByteArray &buff)
const Task::TaskType type = isFatalWinException(exCode) ? Task::Error : Task::Warning; const Task::TaskType type = isFatalWinException(exCode) ? Task::Error : Task::Warning;
TaskHub::addTask(type, m_lastWinException, Constants::TASK_CATEGORY_DEBUGGER_RUNTIME); TaskHub::addTask(type, m_lastWinException, Constants::TASK_CATEGORY_DEBUGGER_RUNTIME);
} }
if (data.startsWith("QMLBP:")) {
int pos1 = 6;
int pos2 = data.indexOf(' ', pos1);
m_qmlBreakpointResponseId2 = BreakpointResponseId(data.mid(pos1, pos2 - pos1));
//qDebug() << "FOUND QMLBP: " << m_qmlBreakpointNumbers[2];
//qDebug() << "CURRENT: " << m_qmlBreakpointNumbers;
}
break; break;
} }
...@@ -1404,9 +1394,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1404,9 +1394,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
showMessage(_("INVALID STOPPED REASON"), LogWarning); showMessage(_("INVALID STOPPED REASON"), LogWarning);
} }
if (rid.isValid() && frame.isValid() if (rid.isValid() && frame.isValid() && !isQFatalBreakpoint(rid)) {
&& !isQmlStepBreakpoint(rid)
&& !isQFatalBreakpoint(rid)) {
// Use opportunity to update the breakpoint marker position. // Use opportunity to update the breakpoint marker position.
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
//qDebug() << " PROBLEM: " << m_qmlBreakpointNumbers << rid //qDebug() << " PROBLEM: " << m_qmlBreakpointNumbers << rid
...@@ -1427,7 +1415,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1427,7 +1415,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// Quickly set the location marker. // Quickly set the location marker.
if (lineNumber && !boolSetting(OperateByInstruction) if (lineNumber && !boolSetting(OperateByInstruction)
&& QFileInfo::exists(fullName) && QFileInfo::exists(fullName)
&& !isQmlStepBreakpoint(rid)
&& !isQFatalBreakpoint(rid)) && !isQFatalBreakpoint(rid))
gotoLocation(Location(fullName, lineNumber)); gotoLocation(Location(fullName, lineNumber));
...@@ -1470,8 +1457,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1470,8 +1457,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state()); QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
if (isQmlStepBreakpoint1(rid))
return;
if (gotoHandleStop1) if (gotoHandleStop1)
handleStop1(data); handleStop1(data);
...@@ -4591,54 +4576,6 @@ void GdbEngine::resetCommandQueue() ...@@ -4591,54 +4576,6 @@ void GdbEngine::resetCommandQueue()
} }
} }
bool GdbEngine::setupQmlStep(bool on)
{
QTC_ASSERT(isSlaveEngine(), return false);
m_qmlBreakpointResponseId1 = BreakpointResponseId();
m_qmlBreakpointResponseId2 = BreakpointResponseId();
//qDebug() << "CLEAR: " << m_qmlBreakpointNumbers;
postCommand("tbreak '" + qtNamespace() + "QScript::FunctionWrapper::proxyCall'\n"
"commands\n"
"set $d=(void*)((FunctionWrapper*)callee)->data->function\n"
"tbreak *$d\nprintf \"QMLBP:%d \\n\",$bpnum\ncontinue\nend",
NeedsStop, CB(handleSetQmlStepBreakpoint));
m_preparedForQmlBreak = on;
return true;
}
void GdbEngine::handleSetQmlStepBreakpoint(const GdbResponse &response)
{
//QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
if (response.resultClass == GdbResultDone) {
// logStreamOutput: "tbreak 'myns::QScript::FunctionWrapper::proxyCall'\n"
// consoleStreamOutput: "Temporary breakpoint 1 at 0xf166e7:
// file bridge/qscriptfunction.cpp, line 75.\n"}
QByteArray ba = parsePlainConsoleStream(response);
const int pos2 = ba.indexOf(" at 0x");
const int pos1 = ba.lastIndexOf(" ", pos2 - 1) + 1;
QByteArray mid = ba.mid(pos1, pos2 - pos1);
m_qmlBreakpointResponseId1 = BreakpointResponseId(mid);
//qDebug() << "SET: " << m_qmlBreakpointResponseId1;
}
QTC_ASSERT(masterEngine(), return);
masterEngine()->readyToExecuteQmlStep();
}
bool GdbEngine::isQmlStepBreakpoint(const BreakpointResponseId &id) const
{
return isQmlStepBreakpoint1(id) || isQmlStepBreakpoint2(id);
}
bool GdbEngine::isQmlStepBreakpoint1(const BreakpointResponseId &id) const
{
return id.isValid() && m_qmlBreakpointResponseId1 == id;
}
bool GdbEngine::isQmlStepBreakpoint2(const BreakpointResponseId &id) const
{
return id.isValid() && m_qmlBreakpointResponseId2 == id;
}
bool GdbEngine::isQFatalBreakpoint(const BreakpointResponseId &id) const bool GdbEngine::isQFatalBreakpoint(const BreakpointResponseId &id) const
{ {
return id.isValid() && m_qFatalBreakpointResponseId == id; return id.isValid() && m_qFatalBreakpointResponseId == id;
...@@ -4646,7 +4583,7 @@ bool GdbEngine::isQFatalBreakpoint(const BreakpointResponseId &id) const ...@@ -4646,7 +4583,7 @@ bool GdbEngine::isQFatalBreakpoint(const BreakpointResponseId &id) const
bool GdbEngine::isHiddenBreakpoint(const BreakpointResponseId &id) const bool GdbEngine::isHiddenBreakpoint(const BreakpointResponseId &id) const
{ {
return isQFatalBreakpoint(id) || isQmlStepBreakpoint(id); return isQFatalBreakpoint(id);
} }
bool GdbEngine::usesExecInterrupt() const bool GdbEngine::usesExecInterrupt() const
......
...@@ -472,17 +472,6 @@ protected: ...@@ -472,17 +472,6 @@ protected:
// For short-circuiting stack and thread list evaluation. // For short-circuiting stack and thread list evaluation.
bool m_stackNeeded; bool m_stackNeeded;
//
// Qml
//
BreakpointResponseId m_qmlBreakpointResponseId1;
BreakpointResponseId m_qmlBreakpointResponseId2;
bool m_preparedForQmlBreak;
bool setupQmlStep(bool on);
void handleSetQmlStepBreakpoint(const GdbResponse &response);
bool isQmlStepBreakpoint(const BreakpointResponseId &id) const;
bool isQmlStepBreakpoint1(const BreakpointResponseId &id) const;
bool isQmlStepBreakpoint2(const BreakpointResponseId &id) const;
bool isQFatalBreakpoint(const BreakpointResponseId &id) const; bool isQFatalBreakpoint(const BreakpointResponseId &id) const;
bool isHiddenBreakpoint(const BreakpointResponseId &id) const; bool isHiddenBreakpoint(const BreakpointResponseId &id) const;
......
...@@ -285,26 +285,10 @@ void QmlCppEngine::detachDebugger() ...@@ -285,26 +285,10 @@ void QmlCppEngine::detachDebugger()
void QmlCppEngine::executeStep() void QmlCppEngine::executeStep()
{ {
// TODO: stepping from qml -> cpp requires more thought
// if (m_activeEngine == m_qmlEngine) {
// QTC_CHECK(m_cppEngine->state() == InferiorRunOk);
// if (m_cppEngine->setupQmlStep(true))
// return; // Wait for callback to readyToExecuteQmlStep()
// } else {
// notifyInferiorRunRequested();
// m_cppEngine->executeStep();
// }
notifyInferiorRunRequested(); notifyInferiorRunRequested();
m_activeEngine->executeStep(); m_activeEngine->executeStep();
} }
void QmlCppEngine::readyToExecuteQmlStep()
{
notifyInferiorRunRequested();
m_qmlEngine->executeStep();
}
void QmlCppEngine::executeStepOut() void QmlCppEngine::executeStepOut()
{ {
notifyInferiorRunRequested(); notifyInferiorRunRequested();
......
...@@ -138,7 +138,6 @@ private: ...@@ -138,7 +138,6 @@ private:
void setState(DebuggerState newState, bool forced = false); void setState(DebuggerState newState, bool forced = false);
void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state); void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state);
void readyToExecuteQmlStep();
void setActiveEngine(DebuggerEngine *engine); void setActiveEngine(DebuggerEngine *engine);
private: private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment