forked from qt-creator/qt-creator
debugger: remove some hard coded typenames for std container dumpers to "user land"
This commit is contained in:
@@ -116,6 +116,12 @@ def call(value, func):
|
|||||||
#warn(" -> %s" % result)
|
#warn(" -> %s" % result)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def qtNamespace():
|
||||||
|
try:
|
||||||
|
type = str(gdb.parse_and_eval("&QString::null").type.target().unqualified())
|
||||||
|
return type[0:len(type) - len("QString::null")]
|
||||||
|
except RuntimeError:
|
||||||
|
return ""
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#
|
#
|
||||||
@@ -146,10 +152,6 @@ class FrameCommand(gdb.Command):
|
|||||||
super(FrameCommand, self).__init__("bb", gdb.COMMAND_OBSCURE)
|
super(FrameCommand, self).__init__("bb", gdb.COMMAND_OBSCURE)
|
||||||
|
|
||||||
def invoke(self, arg, from_tty):
|
def invoke(self, arg, from_tty):
|
||||||
print('locals={iname="local",name="Locals",value=" ",type=" ",'
|
|
||||||
+ 'children=[%s]}' % self.doit(arg).encode("latin1"))
|
|
||||||
|
|
||||||
def doit(self, arg):
|
|
||||||
args = arg.split(' ')
|
args = arg.split(' ')
|
||||||
#warn("ARG: %s" % arg)
|
#warn("ARG: %s" % arg)
|
||||||
#warn("ARGS: %s" % args)
|
#warn("ARGS: %s" % args)
|
||||||
@@ -193,15 +195,8 @@ class FrameCommand(gdb.Command):
|
|||||||
d = Dumper()
|
d = Dumper()
|
||||||
d.dumpers = self.dumpers
|
d.dumpers = self.dumpers
|
||||||
d.passExceptions = passExceptions
|
d.passExceptions = passExceptions
|
||||||
|
d.ns = qtNamespace()
|
||||||
block = frame.block()
|
block = frame.block()
|
||||||
|
|
||||||
# initialize namespace
|
|
||||||
try:
|
|
||||||
type = str(gdb.parse_and_eval("&QString::null").type.target().unqualified())
|
|
||||||
d.ns = type[0:len(type) - len("QString::null")]
|
|
||||||
except RuntimeError:
|
|
||||||
d.ns = ""
|
|
||||||
|
|
||||||
#warn(" NAMESPACE IS: '%s'" % d.ns)
|
#warn(" NAMESPACE IS: '%s'" % d.ns)
|
||||||
#warn("FRAME %s: " % frame)
|
#warn("FRAME %s: " % frame)
|
||||||
|
|
||||||
@@ -244,9 +239,12 @@ class FrameCommand(gdb.Command):
|
|||||||
break
|
break
|
||||||
|
|
||||||
block = block.superblock
|
block = block.superblock
|
||||||
|
#warn("BLOCK %s: " % block)
|
||||||
|
|
||||||
d.pushOutput()
|
d.pushOutput()
|
||||||
return d.safeoutput
|
|
||||||
|
print('locals={iname="local",name="Locals",value=" ",type=" ",'
|
||||||
|
+ 'children=[%s]}' % d.safeoutput)
|
||||||
|
|
||||||
FrameCommand()
|
FrameCommand()
|
||||||
|
|
||||||
|
@@ -2029,10 +2029,32 @@ def qqDumpStdVector(d, item):
|
|||||||
d.endChildren()
|
d.endChildren()
|
||||||
|
|
||||||
|
|
||||||
# needed
|
def qqDumpstd__deque(d, item):
|
||||||
#gdb.pretty_printers.append(QStringPrinter)
|
qqDumpStdDeque(d, item)
|
||||||
|
|
||||||
#gdb.pretty_printers["^QStringList$"] = QStringPrinter
|
def qqDumpstd__list(d, item):
|
||||||
#gdb.pretty_printers["^myns::QList<myns::QString>$"] = QStringPrinter
|
qqDumpStdList(d, item)
|
||||||
#gdb.pretty_printers["^myns::QCoreApplication$"] = QStringPrinter
|
|
||||||
|
|
||||||
|
def qqDumpstd__map(d, item):
|
||||||
|
qqDumpStdMap(d, item)
|
||||||
|
|
||||||
|
def qqDumpstd__set(d, item):
|
||||||
|
qqDumpStdSet(d, item)
|
||||||
|
|
||||||
|
def qqDumpstd__vector(d, item):
|
||||||
|
qqDumpStdVector(d, item)
|
||||||
|
|
||||||
|
def qqDumpstring(d, item):
|
||||||
|
qqDumpStdString(d, item)
|
||||||
|
|
||||||
|
def qqDumpstd__string(d, item):
|
||||||
|
qqDumpStdString(d, item)
|
||||||
|
|
||||||
|
def qqDumpstd__wstring(d, item):
|
||||||
|
qqDumpStdString(d, item)
|
||||||
|
|
||||||
|
def qqDumpstd__basic_string(d, item):
|
||||||
|
qqDumpStdString(d, item)
|
||||||
|
|
||||||
|
def qqDumpwstring(d, item):
|
||||||
|
qqDumpStdString(d, item)
|
||||||
|
@@ -605,10 +605,10 @@ static QString niceTypeHelper(const QString typeIn)
|
|||||||
QString WatchModel::niceType(const QString &typeIn) const
|
QString WatchModel::niceType(const QString &typeIn) const
|
||||||
{
|
{
|
||||||
QString type = niceTypeHelper(typeIn);
|
QString type = niceTypeHelper(typeIn);
|
||||||
if (theDebuggerBoolSetting(ShowStdNamespace))
|
if (!theDebuggerBoolSetting(ShowStdNamespace))
|
||||||
type = type.remove("std::");
|
type = type.remove("std::");
|
||||||
IDebuggerEngine *engine = m_handler->m_manager->currentEngine();
|
IDebuggerEngine *engine = m_handler->m_manager->currentEngine();
|
||||||
if (engine && theDebuggerBoolSetting(ShowQtNamespace))
|
if (engine && !theDebuggerBoolSetting(ShowQtNamespace))
|
||||||
type = type.remove(engine->qtNamespace());
|
type = type.remove(engine->qtNamespace());
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user