forked from qt-creator/qt-creator
Debugger: Replace unneeded requests for updates in PdbEngine
... by more direct flushing on the dumper side. Change-Id: I53d91e564bb948e3c934242fec4f23f36ee8c10e Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -731,7 +731,7 @@ class Dumper:
|
||||
def sigint_handler(self, signum, frame):
|
||||
if self.allow_kbdint:
|
||||
raise KeyboardInterrupt
|
||||
self.message("\nProgram interrupted. (Use 'cont' to resume).")
|
||||
self.report('state="stopped"')
|
||||
self.set_step()
|
||||
self.set_trace(frame)
|
||||
# restore previous signal handler
|
||||
@@ -1484,7 +1484,8 @@ class Dumper:
|
||||
self.flushOutput()
|
||||
|
||||
def flushOutput(self):
|
||||
sys.stdout.write(self.output)
|
||||
sys.stdout.write("@\n" + self.output + "@\n")
|
||||
sys.stdout.flush()
|
||||
self.output = ""
|
||||
|
||||
def put(self, value):
|
||||
|
||||
@@ -179,7 +179,6 @@ void PdbEngine::interruptInferior()
|
||||
{
|
||||
QString error;
|
||||
interruptProcess(m_proc.processId(), GdbEngineType, &error);
|
||||
notifyInferiorStopOk();
|
||||
}
|
||||
|
||||
void PdbEngine::executeStep()
|
||||
@@ -188,7 +187,6 @@ void PdbEngine::executeStep()
|
||||
notifyInferiorRunRequested();
|
||||
notifyInferiorRunOk();
|
||||
postDirectCommand("step");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::executeStepI()
|
||||
@@ -197,7 +195,6 @@ void PdbEngine::executeStepI()
|
||||
notifyInferiorRunRequested();
|
||||
notifyInferiorRunOk();
|
||||
postDirectCommand("step");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::executeStepOut()
|
||||
@@ -206,7 +203,6 @@ void PdbEngine::executeStepOut()
|
||||
notifyInferiorRunRequested();
|
||||
notifyInferiorRunOk();
|
||||
postDirectCommand("return");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::executeNext()
|
||||
@@ -215,7 +211,6 @@ void PdbEngine::executeNext()
|
||||
notifyInferiorRunRequested();
|
||||
notifyInferiorRunOk();
|
||||
postDirectCommand("next");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::executeNextI()
|
||||
@@ -224,7 +219,6 @@ void PdbEngine::executeNextI()
|
||||
notifyInferiorRunRequested();
|
||||
notifyInferiorRunOk();
|
||||
postDirectCommand("next");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::continueInferior()
|
||||
@@ -234,7 +228,6 @@ void PdbEngine::continueInferior()
|
||||
notifyInferiorRunOk();
|
||||
// Callback will be triggered e.g. when breakpoint is hit.
|
||||
postDirectCommand("continue");
|
||||
updateAll();
|
||||
}
|
||||
|
||||
void PdbEngine::executeRunToLine(const ContextData &data)
|
||||
@@ -348,6 +341,17 @@ void PdbEngine::requestModuleSymbols(const QString &moduleName)
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
void PdbEngine::refreshState(const GdbMi &reportedState)
|
||||
{
|
||||
QByteArray newState = reportedState.data();
|
||||
if (newState == "stopped") {
|
||||
notifyInferiorSpontaneousStop();
|
||||
updateAll();
|
||||
} else if (newState == "inferiorexited") {
|
||||
notifyInferiorExited();
|
||||
}
|
||||
}
|
||||
|
||||
void PdbEngine::refreshLocation(const GdbMi &reportedLocation)
|
||||
{
|
||||
StackFrame frame;
|
||||
@@ -476,13 +480,12 @@ void PdbEngine::handleOutput(const QByteArray &data)
|
||||
|
||||
void PdbEngine::handleOutput2(const QByteArray &data)
|
||||
{
|
||||
QByteArray lineContext;
|
||||
foreach (QByteArray line, data.split('\n')) {
|
||||
|
||||
GdbMi item;
|
||||
item.fromString(line);
|
||||
|
||||
showMessage(_("LINE: " + line));
|
||||
showMessage(_(line), LogOutput);
|
||||
|
||||
if (line.startsWith("stack={")) {
|
||||
refreshStack(item);
|
||||
@@ -494,6 +497,8 @@ void PdbEngine::handleOutput2(const QByteArray &data)
|
||||
refreshSymbols(item);
|
||||
} else if (line.startsWith("location={")) {
|
||||
refreshLocation(item);
|
||||
} else if (line.startsWith("state=")) {
|
||||
refreshState(item);
|
||||
} else if (line.startsWith("Breakpoint")) {
|
||||
int pos1 = line.indexOf(" at ");
|
||||
QTC_ASSERT(pos1 != -1, continue);
|
||||
|
||||
@@ -105,6 +105,7 @@ private:
|
||||
void refreshStack(const GdbMi &stack);
|
||||
void refreshLocals(const GdbMi &vars);
|
||||
void refreshModules(const GdbMi &modules);
|
||||
void refreshState(const GdbMi &reportedState);
|
||||
void refreshSymbols(const GdbMi &symbols);
|
||||
|
||||
QString errorMessage(QProcess::ProcessError error) const;
|
||||
|
||||
Reference in New Issue
Block a user