diff options
-rw-r--r-- | share/qtcreator/debugger/dumper.py | 6 | ||||
-rw-r--r-- | share/qtcreator/debugger/gdbbridge.py | 6 | ||||
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerprotocol.h | 8 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 2 | ||||
-rw-r--r-- | tests/auto/debugger/tst_dumpers.cpp | 2 |
6 files changed, 11 insertions, 15 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index d363d88b1b..b6330ecc44 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1672,7 +1672,7 @@ class DumperBase: except: pass - def findDumperFunctions(self): + def setupDumper(self, _ = {}): self.qqDumpers = {} self.qqFormats = {} self.qqEditable = {} @@ -1687,7 +1687,7 @@ class DumperBase: return self.reportDumpers() - def reportDumpers(self): + def reportDumpers(self, _ = {}): result = "dumpers=[" for key, value in self.qqFormats.items(): if key in self.qqEditable: @@ -1705,7 +1705,7 @@ class DumperBase: else: reload(m) - findDumperFunctions() + setupDumper() def addDumperModule(self, args): path = args['path'] diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 6c5e0585bc..1a65ae10cd 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -135,12 +135,6 @@ class ScanStackCommand(gdb.Command): ScanStackCommand() -def bbsetup(args = ''): - print(theDumper.findDumperFunctions()) - -registerCommand("bbsetup", bbsetup) - - ####################################################################### # # Import plain gdb pretty printers diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 80c34a50c7..cd4074e9e3 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1693,7 +1693,7 @@ class Dumper(DumperBase): self.report(result + ']') def loadDumperFiles(self, _ = None): - result = self.findDumperFunctions() + result = self.setupDumper() self.report(result) def fetchMemory(self, args): diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h index 9f55b4dfaa..54c72a1531 100644 --- a/src/plugins/debugger/debuggerprotocol.h +++ b/src/plugins/debugger/debuggerprotocol.h @@ -45,8 +45,12 @@ class DebuggerResponse; class DebuggerCommand { public: + typedef std::function<void(const DebuggerResponse &)> Callback; + DebuggerCommand() : flags(0) {} - DebuggerCommand(const char *f) : function(f), flags(0) {} + DebuggerCommand(const char *f, int flags = 0, Callback cb = Callback()) + : function(f), callback(cb), flags(flags) + {} DebuggerCommand(const QByteArray &f) : function(f), flags(0) {} void arg(const char *name); @@ -64,8 +68,6 @@ public: static QByteArray toData(const QList<QByteArray> &value); static QByteArray toData(const QHash<QByteArray, QByteArray> &value); - typedef std::function<void(const DebuggerResponse &)> Callback; - QByteArray function; QByteArray args; Callback callback; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 841f9508a6..335e1839c7 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4295,7 +4295,7 @@ void GdbEngine::startGdb(const QStringList &args) if (!commands.isEmpty()) postCommand(commands.toLocal8Bit(), flags); - postCommand("bbsetup", flags, CB(handlePythonSetup)); + runCommand(DebuggerCommand("setupDumper", flags, CB(handlePythonSetup))); } void GdbEngine::handleGdbStartFailed() diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index ed0b92788f..4ac7ac6779 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1236,7 +1236,7 @@ void tst_Dumpers::dumper() cmds += "python sys.path.insert(1, '" + dumperDir + "')\n" "python sys.path.append('" + uninstalledData + "')\n" "python from gdbbridge import *\n" - "bbsetup\n" + "python theDumper.setupDumper()\n" "run " + nograb + "\n" "bb options:fancy,forcens,autoderef,dyntype,pe vars: expanded:" + expanded + " typeformats:\n"; |