Commit fdbecf93 authored by hjk's avatar hjk

debugger: remove some hard coded typenames for std container dumpers to "user land"

parent f6cafecc
......@@ -116,6 +116,12 @@ def call(value, func):
#warn(" -> %s" % 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)
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(' ')
#warn("ARG: %s" % arg)
#warn("ARGS: %s" % args)
......@@ -193,15 +195,8 @@ class FrameCommand(gdb.Command):
d = Dumper()
d.dumpers = self.dumpers
d.passExceptions = passExceptions
d.ns = qtNamespace()
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("FRAME %s: " % frame)
......@@ -244,9 +239,12 @@ class FrameCommand(gdb.Command):
break
block = block.superblock
#warn("BLOCK %s: " % block)
d.pushOutput()
return d.safeoutput
print('locals={iname="local",name="Locals",value=" ",type=" ",'
+ 'children=[%s]}' % d.safeoutput)
FrameCommand()
......
......@@ -2029,10 +2029,32 @@ def qqDumpStdVector(d, item):
d.endChildren()
# needed
#gdb.pretty_printers.append(QStringPrinter)
def qqDumpstd__deque(d, item):
qqDumpStdDeque(d, item)
#gdb.pretty_printers["^QStringList$"] = QStringPrinter
#gdb.pretty_printers["^myns::QList<myns::QString>$"] = QStringPrinter
#gdb.pretty_printers["^myns::QCoreApplication$"] = QStringPrinter
def qqDumpstd__list(d, item):
qqDumpStdList(d, item)
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 type = niceTypeHelper(typeIn);
if (theDebuggerBoolSetting(ShowStdNamespace))
if (!theDebuggerBoolSetting(ShowStdNamespace))
type = type.remove("std::");
IDebuggerEngine *engine = m_handler->m_manager->currentEngine();
if (engine && theDebuggerBoolSetting(ShowQtNamespace))
if (engine && !theDebuggerBoolSetting(ShowQtNamespace))
type = type.remove(engine->qtNamespace());
return type;
}
......
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