summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-02-13 10:02:35 +0100
committerhjk <hjk@theqtcompany.com>2015-02-13 09:55:35 +0000
commita081fee8f5cc63bc49f6a62244c758d65e41c721 (patch)
treea9e68866e1f56fe13c54cb089b0f4bf543011c1e /share
parenta7fce3910378ec2f6289e1707649cffc45540817 (diff)
downloadqt-creator-a081fee8f5cc63bc49f6a62244c758d65e41c721.tar.gz
Debugger: Cleanup lldbbridge.py
Move reusable Breakpoint enum to base, use 'theDumper' uniformly across backends as name for the Dumper singleton. Signal engine setup only if the Dumper successfully initializes. Change-Id: If1b6be9d054f249d0d46061e4949cbecf4fd09cb Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/debugger/dumper.py16
-rw-r--r--share/qtcreator/debugger/lldbbridge.py29
2 files changed, 20 insertions, 25 deletions
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index 3a37c4a924..49d0b7537e 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -81,6 +81,22 @@ SeparateLatin1StringFormat, \
SeparateUtf8StringFormat \
= range(100, 112)
+# Breakpoints. Keep synchronized with BreakpointType in breakpoint.h
+UnknownType, \
+BreakpointByFileAndLine, \
+BreakpointByFunction, \
+BreakpointByAddress, \
+BreakpointAtThrow, \
+BreakpointAtCatch, \
+BreakpointAtMain, \
+BreakpointAtFork, \
+BreakpointAtExec, \
+BreakpointAtSysCall, \
+WatchpointAtAddress, \
+WatchpointAtExpression, \
+BreakpointOnQmlSignalEmit, \
+BreakpointAtJavaScriptThrow, \
+ = range(0, 14)
#
# matplot based display for array-like structures.
#
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index 47084e512c..a986707f0f 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -28,18 +28,15 @@
#
#############################################################################
-import atexit
import inspect
import os
import platform
import re
import sys
-import subprocess
import threading
import lldb
-currentDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-sys.path.insert(1, currentDir)
+sys.path.insert(1, os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
from dumper import *
@@ -51,8 +48,6 @@ from dumper import *
qqWatchpointOffset = 10000
-lldb.theDumper = None
-
def warn(message):
print('\n\nWARNING="%s",\n' % message.encode("latin1").replace('"', "'"))
@@ -66,22 +61,6 @@ def fileName(file):
return str(file) if file.IsValid() else ''
-# Breakpoints. Keep synchronized with BreakpointType in breakpoint.h
-UnknownType = 0
-BreakpointByFileAndLine = 1
-BreakpointByFunction = 2
-BreakpointByAddress = 3
-BreakpointAtThrow = 4
-BreakpointAtCatch = 5
-BreakpointAtMain = 6
-BreakpointAtFork = 7
-BreakpointAtExec = 8
-BreakpointAtSysCall = 9
-WatchpointAtAddress = 10
-WatchpointAtExpression = 11
-BreakpointOnQmlSignalEmit = 12
-BreakpointAtJavaScriptThrow = 13
-
def check(exp):
if not exp:
raise RuntimeError("Check failed")
@@ -187,8 +166,6 @@ class Dumper(DumperBase):
def __init__(self):
DumperBase.__init__(self)
- lldb.theDumper = self
-
self.outputLock = threading.Lock()
self.debugger = lldb.SBDebugger.Create()
#self.debugger.SetLoggingCallback(loggingCallback)
@@ -255,6 +232,9 @@ class Dumper(DumperBase):
self.qmlBreakpointResolvers = {}
self.qmlTriggeredBreakpoint = None
+ self.report('lldbversion=\"%s\"' % lldb.SBDebugger.GetVersionString())
+ self.reportState("enginesetupok")
+
def enterSubItem(self, item):
if isinstance(item.name, lldb.SBValue):
# Avoid $$__synth__ suffix on Mac.
@@ -1719,7 +1699,6 @@ class Dumper(DumperBase):
# Used in dumper auto test.
-# Usage: python lldbbridge.py /path/to/testbinary comma-separated-inames
class Tester(Dumper):
def __init__(self, binary, expandedINames):
Dumper.__init__(self)