Commit d0655e5c authored by hjk's avatar hjk

Debugger: Remove unused code from pdbbridge.py

Starting from unused command line commands like
'up' and 'down' up to the (Pdb) prompt handling.

Change-Id: I93ab5025a52b259e3f9d80f3251e88bdb18a3467
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b8231102
This diff is collapsed.
...@@ -345,6 +345,19 @@ void PdbEngine::requestModuleSymbols(const QString &moduleName) ...@@ -345,6 +345,19 @@ void PdbEngine::requestModuleSymbols(const QString &moduleName)
runCommand(cmd); runCommand(cmd);
} }
void PdbEngine::refreshLocation(const GdbMi &reportedLocation)
{
StackFrame frame;
frame.file = reportedLocation["file"].toUtf8();
frame.line = reportedLocation["line"].toInt();
if (state() == InferiorRunOk) {
showMessage(QString::fromLatin1("STOPPED AT: %1:%2").arg(frame.file).arg(frame.line));
gotoLocation(frame);
notifyInferiorSpontaneousStop();
updateAll();
}
}
void PdbEngine::refreshSymbols(const GdbMi &symbols) void PdbEngine::refreshSymbols(const GdbMi &symbols)
{ {
QString moduleName = symbols["module"].toUtf8(); QString moduleName = symbols["module"].toUtf8();
...@@ -448,13 +461,11 @@ void PdbEngine::handleOutput(const QByteArray &data) ...@@ -448,13 +461,11 @@ void PdbEngine::handleOutput(const QByteArray &data)
{ {
m_inbuffer.append(data); m_inbuffer.append(data);
while (true) { while (true) {
int pos = m_inbuffer.indexOf("(Pdb)"); int pos = m_inbuffer.indexOf('\n');
if (pos == -1)
pos = m_inbuffer.indexOf(">>>");
if (pos == -1) if (pos == -1)
break; break;
QByteArray response = m_inbuffer.left(pos).trimmed(); QByteArray response = m_inbuffer.left(pos).trimmed();
m_inbuffer = m_inbuffer.mid(pos + 6); m_inbuffer = m_inbuffer.mid(pos + 1);
handleOutput2(response); handleOutput2(response);
} }
} }
...@@ -477,6 +488,8 @@ void PdbEngine::handleOutput2(const QByteArray &data) ...@@ -477,6 +488,8 @@ void PdbEngine::handleOutput2(const QByteArray &data)
refreshModules(item); refreshModules(item);
} else if (line.startsWith("symbols={")) { } else if (line.startsWith("symbols={")) {
refreshSymbols(item); refreshSymbols(item);
} else if (line.startsWith("location={")) {
refreshLocation(item);
} else if (line.startsWith("Breakpoint")) { } else if (line.startsWith("Breakpoint")) {
int pos1 = line.indexOf(" at "); int pos1 = line.indexOf(" at ");
QTC_ASSERT(pos1 != -1, continue); QTC_ASSERT(pos1 != -1, continue);
...@@ -495,26 +508,6 @@ void PdbEngine::handleOutput2(const QByteArray &data) ...@@ -495,26 +508,6 @@ void PdbEngine::handleOutput2(const QByteArray &data)
QTC_CHECK(!bp.needsChange()); QTC_CHECK(!bp.needsChange());
bp.notifyBreakpointInsertOk(); bp.notifyBreakpointInsertOk();
} }
} else {
if (line.startsWith("> /")) {
lineContext = line;
int pos1 = line.indexOf('(');
int pos2 = line.indexOf(')', pos1);
if (pos1 != -1 && pos2 != -1) {
int lineNumber = line.mid(pos1 + 1, pos2 - pos1 - 1).toInt();
QByteArray fileName = line.mid(2, pos1 - 2);
StackFrame frame;
frame.file = _(fileName);
frame.line = lineNumber;
if (state() == InferiorRunOk) {
showMessage(QString::fromLatin1("STOPPED AT: %1:%2").arg(frame.file).arg(frame.line));
gotoLocation(frame);
notifyInferiorSpontaneousStop();
updateAll();
continue;
}
}
}
} }
} }
} }
......
...@@ -101,6 +101,7 @@ private: ...@@ -101,6 +101,7 @@ private:
void runCommand(const DebuggerCommand &cmd); void runCommand(const DebuggerCommand &cmd);
void postDirectCommand(const QByteArray &command); void postDirectCommand(const QByteArray &command);
void refreshLocation(const GdbMi &reportedLocation);
void refreshStack(const GdbMi &stack); void refreshStack(const GdbMi &stack);
void refreshLocals(const GdbMi &vars); void refreshLocals(const GdbMi &vars);
void refreshModules(const GdbMi &modules); void refreshModules(const GdbMi &modules);
......
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