summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-02-11 16:05:55 +0100
committerhjk <hjk@theqtcompany.com>2015-02-11 16:34:51 +0000
commitf65cb6ae4df6734231bfd0a3cf4428366292d764 (patch)
treed5a5f981068406b97ec0dfa83f88f3bf8469a85f /share
parente76c4839bbba3dcd21a84fdd1ff3a513943fd695 (diff)
downloadqt-creator-f65cb6ae4df6734231bfd0a3cf4428366292d764.tar.gz
Debugger: Complete switch to Python for GDB stack generation
The iteration in Python was only used for the 'native mixed' case before. Seems reasonably fast and robust now to always enable it. Also, make the calling code use 'runCommand'. Change-Id: I10565a725dfaa9bf46c28739c69e9f2546498929 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/gdbbridge.py32
1 files changed, 8 insertions, 24 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 6df555bee2..6c5e0585bc 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -1620,14 +1620,19 @@ class Dumper(DumperBase):
self.typesToReport[typestring] = typeobj
return typeobj
- def stackListFrames(self, n, options):
+ def stackListFrames(self, args):
+ limit = int(args['limit'])
+ if limit <= 0:
+ limit = 10000
+ options = args['options']
+
self.prepare("options:" + options + ",pe")
self.output = []
frame = gdb.newest_frame()
i = 0
self.currentCallContext = None
- while i < n and frame:
+ while i < limit and frame:
with OutputSafer(self):
name = frame.name()
functionName = "??" if name is None else name
@@ -1675,8 +1680,7 @@ class Dumper(DumperBase):
frame = frame.older()
i += 1
-
- return ''.join(self.output)
+ print(''.join(self.output))
def createResolvePendingBreakpointsHookBreakpoint(self, args):
class Resolver(gdb.Breakpoint):
@@ -1866,26 +1870,6 @@ registerCommand("threadnames", threadnames)
#######################################################################
#
-# StackFrames Command
-#
-#######################################################################
-
-def stackListFrames(arg):
- try:
- args = arg.split(' ')
- limit = int(args[0]) if len(args) > 0 else 10000
- if limit <= 0:
- limit = 10000
- options = args[1] if len(args) > 1 else ""
- return theDumper.stackListFrames(limit, options)
- except:
- import traceback
- traceback.print_exc()
-
-registerCommand("stackListFrames", stackListFrames)
-
-#######################################################################
-#
# Native Mixed
#
#######################################################################