Debugger: Hide PdbEngine infrastructure from itself

Debuggers running inside the debugged application are weird.

Change-Id: I2452e3653221c8f585123852ea113bd2fdfd08ed
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
hjk
2015-02-13 15:45:19 +01:00
parent ee4cbafb0b
commit 5442d144b6
2 changed files with 7 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import linecache
import inspect import inspect
import os import os
def qdebug(cmd, args):
class Dumper: class Dumper:
def __init__(self): def __init__(self):
pass pass
@@ -273,12 +274,7 @@ class Dumper:
sys.stdout.write("@\n" + stuff + "@\n") sys.stdout.write("@\n" + stuff + "@\n")
sys.stdout.flush() sys.stdout.flush()
def qdebug(options = None,
expanded = None,
typeformats = None,
individualformats = None,
watchers = None):
sys.stdout.write("\n(Pdb)\n")
sys.stdout.flush()
theDumper = Dumper() d = Dumper()
method = getattr(d, cmd)
method(args)

View File

@@ -135,7 +135,7 @@ void PdbEngine::postCommand(const QByteArray &command, DebuggerCommand::Callback
void PdbEngine::runCommand(const DebuggerCommand &cmd) void PdbEngine::runCommand(const DebuggerCommand &cmd)
{ {
QTC_ASSERT(m_pdbProc.state() == QProcess::Running, notifyEngineIll()); QTC_ASSERT(m_pdbProc.state() == QProcess::Running, notifyEngineIll());
QByteArray command = "theDumper." + cmd.function + "({" + cmd.args + "})"; QByteArray command = "qdebug('" + cmd.function + "',{" + cmd.args + "})";
showMessage(_(command), LogInput); showMessage(_(command), LogInput);
m_pdbProc.write(command + '\n'); m_pdbProc.write(command + '\n');
} }
@@ -734,8 +734,7 @@ void PdbEngine::handleUpdateAll(const DebuggerResponse &response)
void PdbEngine::updateAll() void PdbEngine::updateAll()
{ {
postCommand("dir()"); postCommand("qdebug('stackListFrames',{})");
postCommand("theDumper.stackListFrames({})");
updateLocals(); updateLocals();
} }