Commit a4a7a4b2 authored by hjk's avatar hjk

Debugger: Add command for simpler dumper reloading

... to facilitate shorter round trips in dumper development.

Change-Id: Ie457293fd137528d74008fc11137b47d92f3859d
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d341c482
......@@ -12,18 +12,26 @@ import os
import os.path
import sys
import struct
import types
import importlib
def warn(message):
print("XXX: %s\n" % message.encode("latin1"))
from dumper import *
from qttypes import *
from stdtypes import *
from misctypes import *
from boosttypes import *
from creatortypes import *
from personaltypes import *
dumpermodules = [
"qttypes",
"stdtypes",
"misctypes",
"boosttypes",
"creatortypes",
"personaltypes",
]
for mod in dumpermodules:
importlib.import_module(mod)
#######################################################################
......@@ -1372,11 +1380,13 @@ class Dumper(DumperBase):
self.qqEditable = {}
self.typeCache = {}
# It's __main__ from gui, gdbbridge from test. Brush over it...
for modname in ['__main__', 'gdbbridge']:
dic = sys.modules[modname].__dict__
for mod in dumpermodules:
m = importlib.import_module(mod)
dic = m.__dict__
for name in dic.keys():
self.registerDumper(name, dic[name])
item = dic[name]
self.registerDumper(name, item)
def reportDumpers(self):
result = "dumpers=["
......@@ -1848,6 +1858,19 @@ def threadnames(arg):
registerCommand("threadnames", threadnames)
#######################################################################
#
# Reload Command
#
#######################################################################
def reloadDumper(arg):
for mod in dumpermodules:
importlib.reload(sys.modules[mod])
bbsetup()
registerCommand("reload", reloadDumper)
#######################################################################
#
# Mixed C++/Qml debugging
......
......@@ -4315,7 +4315,7 @@ void GdbEngine::loadInitScript()
void GdbEngine::reloadDebuggingHelpers()
{
postCommand("bbsetup");
postCommand("reload");
}
void GdbEngine::handleGdbError(QProcess::ProcessError error)
......
......@@ -774,6 +774,12 @@ void QmlCppEngine::resetLocation()
DebuggerEngine::resetLocation();
}
void QmlCppEngine::reloadDebuggingHelpers()
{
if (m_cppEngine)
m_cppEngine->reloadDebuggingHelpers();
}
DebuggerEngine *QmlCppEngine::cppEngine() const
{
return m_cppEngine;
......
......@@ -97,6 +97,7 @@ public:
protected:
void detachDebugger();
void reloadDebuggingHelpers();
void executeStep();
void executeStepOut();
void executeNext();
......
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