Commit fe0bddbd authored by hjk's avatar hjk
Browse files

Debugger: Rework dumper detection



Recent versions of GDB seem to require 'make install' to find their
Python bits. Given that this is not really an option, check the
usual suspects, too.

Change-Id: I5217c0184681d4a86992fe0b8989498843b26cea
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent a66f0734
......@@ -520,7 +520,6 @@ class Dumper(DumperBase):
#warn("WATCHERS: %s" % watchers)
#warn("PARTIAL: %s" % self.partialUpdate)
#warn("NO LOCALS: %s" % self.noLocals)
module = sys.modules[__name__]
#
# Locals
......@@ -1759,13 +1758,12 @@ class Dumper(DumperBase):
self.qqFormats = {}
self.qqEditable = {}
self.typeCache = {}
module = sys.modules[__name__]
#warn("KEYS: %s " % module.__dict__.keys())
for name in module.__dict__.keys():
#warn("KEY: %s " % name)
#warn("FUNCT: %s " % module.__dict__[name])
self.registerDumper(name, module.__dict__[name])
# It's __main__ from gui, gdbbridge from test. Brush over it...
for modname in ['__main__', 'gdbbridge']:
dic = sys.modules[modname].__dict__
for name in dic.keys():
self.registerDumper(name, dic[name])
result = "dumpers=["
for key, value in self.qqFormats.items():
......
......@@ -4936,7 +4936,12 @@ void GdbEngine::tryLoadPythonDumpers()
const QByteArray dumperSourcePath =
Core::ICore::resourcePath().toLocal8Bit() + "/debugger/";
const QFileInfo gdbBinaryFile(m_gdb);
const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit()
+ "/data-directory/python";
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", ConsoleCommand);
postCommand("python sys.path.append('" + uninstalledData + "')", ConsoleCommand);
postCommand("python from gdbbridge import *", ConsoleCommand, CB(handlePythonSetup));
}
......
......@@ -893,6 +893,10 @@ void tst_Dumpers::dumper()
if (m_debuggerEngine == DumpTestGdbEngine) {
exe = m_debuggerBinary;
const QFileInfo gdbBinaryFile(QString::fromLatin1(exe));
const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit() + "/data-directory/python";
args << QLatin1String("-i")
<< QLatin1String("mi")
<< QLatin1String("-quiet")
......@@ -907,6 +911,7 @@ void tst_Dumpers::dumper()
if (m_usePython) {
cmds += "python sys.path.insert(1, '" + dumperDir + "')\n"
"python sys.path.append('" + uninstalledData + "')\n"
"python from gdbbridge import *\n"
"run " + nograb + "\n"
"up\n"
......
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