summaryrefslogtreecommitdiff
path: root/share/qtcreator/debugger
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-09-02 17:23:35 +0200
committerhjk <hjk@theqtcompany.com>2015-09-03 06:40:36 +0000
commit58e391fe18cab79e7b4138beb5f84b3667d58ac1 (patch)
tree89244bba174d0d41eb7da9e5dfc8d46d32452d79 /share/qtcreator/debugger
parent26d1113f4d7abf79457a43dbc8442befacc8fad4 (diff)
downloadqt-creator-58e391fe18cab79e7b4138beb5f84b3667d58ac1.tar.gz
Debugger: Remove unused bits of pdbbridge.py
Change-Id: I56f104f21dfded2e3beab7269b6e83d64c1cc211 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'share/qtcreator/debugger')
-rw-r--r--share/qtcreator/debugger/pdbbridge.py63
1 files changed, 0 insertions, 63 deletions
diff --git a/share/qtcreator/debugger/pdbbridge.py b/share/qtcreator/debugger/pdbbridge.py
index cc047013f9..d6098b1f9c 100644
--- a/share/qtcreator/debugger/pdbbridge.py
+++ b/share/qtcreator/debugger/pdbbridge.py
@@ -158,24 +158,6 @@ def find_function(funcname, filename):
return funcname, filename, lineno
return None
-def getsourcelines(obj):
- lines, lineno = inspect.findsource(obj)
- if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
- # must be a module frame: do not try to cut a block out of it
- return lines, 1
- elif inspect.ismodule(obj):
- return lines, 1
- return inspect.getblock(lines[lineno:]), lineno+1
-
-def lasti2lineno(code, lasti):
- linestarts = list(dis.findlinestarts(code))
- linestarts.reverse()
- for i, lineno in linestarts:
- if lasti >= i:
- return lineno
- return 0
-
-
class _rstr(str):
"""String that doesn't quote its repr."""
def __repr__(self):
@@ -209,7 +191,6 @@ class Dumper:
self.aliases = {}
self.mainpyfile = ''
self._wait_for_mainpyfile = False
- self.tb_lineno = {}
# Try to load readline if it exists
try:
import readline
@@ -742,18 +723,10 @@ class Dumper:
self.stack = []
self.curindex = 0
self.curframe = None
- self.tb_lineno.clear()
def setup(self, f, tb):
self.forget()
self.stack, self.curindex = self.get_stack(f, tb)
- while tb:
- # when setting up post-mortem debugging with a traceback, save all
- # the original line numbers to be displayed along the current line
- # numbers (which can be different, e.g. due to finally clauses)
- lineno = lasti2lineno(tb.tb_frame.f_code, tb.tb_lasti)
- self.tb_lineno[tb.tb_frame] = lineno
- tb = tb.tb_next
self.curframe = self.stack[self.curindex][0]
# The f_locals dictionary is updated from the actual frame
# locals whenever the .f_locals accessor is called, so we
@@ -1346,42 +1319,6 @@ class Dumper:
err = traceback.format_exception_only(*exc_info)[-1].strip()
return _rstr('** raised %s **' % err)
- def do_source(self, arg):
- """source expression
- Try to get source code for the given object and display it.
- """
- try:
- obj = self._getval(arg)
- except:
- return
- try:
- lines, lineno = getsourcelines(obj)
- except (OSError, TypeError) as err:
- self.error(err)
- return
- self._print_lines(lines, lineno)
-
- def _print_lines(self, lines, start, breaks=(), frame=None):
- """Print a range of lines."""
- if frame:
- current_lineno = frame.f_lineno
- exc_lineno = self.tb_lineno.get(frame, -1)
- else:
- current_lineno = exc_lineno = -1
- for lineno, line in enumerate(lines, start):
- s = str(lineno).rjust(3)
- if len(s) < 4:
- s += ' '
- if lineno in breaks:
- s += 'B'
- else:
- s += ' '
- if lineno == current_lineno:
- s += '->'
- elif lineno == exc_lineno:
- s += '>>'
- self.message(s + '\t' + line.rstrip())
-
def do_whatis(self, arg):
"""whatis arg
Print the type of the argument.