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