aboutsummaryrefslogtreecommitdiff
path: root/lldb/utils/lui/debuggerdriver.py
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/utils/lui/debuggerdriver.py
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/utils/lui/debuggerdriver.py')
-rw-r--r--lldb/utils/lui/debuggerdriver.py75
1 files changed, 40 insertions, 35 deletions
diff --git a/lldb/utils/lui/debuggerdriver.py b/lldb/utils/lui/debuggerdriver.py
index f7b8851..48de10d 100644
--- a/lldb/utils/lui/debuggerdriver.py
+++ b/lldb/utils/lui/debuggerdriver.py
@@ -1,9 +1,9 @@
##===-- debuggerdriver.py ------------------------------------*- Python -*-===##
##
-## The LLVM Compiler Infrastructure
+# The LLVM Compiler Infrastructure
##
-## This file is distributed under the University of Illinois Open Source
-## License. See LICENSE.TXT for details.
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
##
##===----------------------------------------------------------------------===##
@@ -13,12 +13,15 @@ import lldbutil
import sys
from threading import Thread
+
class DebuggerDriver(Thread):
""" Drives the debugger and responds to events. """
+
def __init__(self, debugger, event_queue):
Thread.__init__(self)
self.event_queue = event_queue
- # This is probably not great because it does not give liblldb a chance to clean up
+ # This is probably not great because it does not give liblldb a chance
+ # to clean up
self.daemon = True
self.initialize(debugger)
@@ -30,44 +33,45 @@ class DebuggerDriver(Thread):
raise "Invalid listener"
self.listener.StartListeningForEventClass(self.debugger,
- lldb.SBTarget.GetBroadcasterClassName(),
- lldb.SBTarget.eBroadcastBitBreakpointChanged
- #| lldb.SBTarget.eBroadcastBitModuleLoaded
- #| lldb.SBTarget.eBroadcastBitModuleUnloaded
- | lldb.SBTarget.eBroadcastBitWatchpointChanged
- #| lldb.SBTarget.eBroadcastBitSymbolLoaded
- )
+ lldb.SBTarget.GetBroadcasterClassName(),
+ lldb.SBTarget.eBroadcastBitBreakpointChanged
+ #| lldb.SBTarget.eBroadcastBitModuleLoaded
+ #| lldb.SBTarget.eBroadcastBitModuleUnloaded
+ | lldb.SBTarget.eBroadcastBitWatchpointChanged
+ #| lldb.SBTarget.eBroadcastBitSymbolLoaded
+ )
self.listener.StartListeningForEventClass(self.debugger,
- lldb.SBThread.GetBroadcasterClassName(),
- lldb.SBThread.eBroadcastBitStackChanged
- # lldb.SBThread.eBroadcastBitBreakpointChanged
- | lldb.SBThread.eBroadcastBitThreadSuspended
- | lldb.SBThread.eBroadcastBitThreadResumed
- | lldb.SBThread.eBroadcastBitSelectedFrameChanged
- | lldb.SBThread.eBroadcastBitThreadSelected
- )
+ lldb.SBThread.GetBroadcasterClassName(),
+ lldb.SBThread.eBroadcastBitStackChanged
+ # lldb.SBThread.eBroadcastBitBreakpointChanged
+ | lldb.SBThread.eBroadcastBitThreadSuspended
+ | lldb.SBThread.eBroadcastBitThreadResumed
+ | lldb.SBThread.eBroadcastBitSelectedFrameChanged
+ | lldb.SBThread.eBroadcastBitThreadSelected
+ )
self.listener.StartListeningForEventClass(self.debugger,
- lldb.SBProcess.GetBroadcasterClassName(),
- lldb.SBProcess.eBroadcastBitStateChanged
- | lldb.SBProcess.eBroadcastBitInterrupt
- | lldb.SBProcess.eBroadcastBitSTDOUT
- | lldb.SBProcess.eBroadcastBitSTDERR
- | lldb.SBProcess.eBroadcastBitProfileData
- )
+ lldb.SBProcess.GetBroadcasterClassName(),
+ lldb.SBProcess.eBroadcastBitStateChanged
+ | lldb.SBProcess.eBroadcastBitInterrupt
+ | lldb.SBProcess.eBroadcastBitSTDOUT
+ | lldb.SBProcess.eBroadcastBitSTDERR
+ | lldb.SBProcess.eBroadcastBitProfileData
+ )
self.listener.StartListeningForEventClass(self.debugger,
- lldb.SBCommandInterpreter.GetBroadcasterClass(),
- lldb.SBCommandInterpreter.eBroadcastBitThreadShouldExit
- | lldb.SBCommandInterpreter.eBroadcastBitResetPrompt
- | lldb.SBCommandInterpreter.eBroadcastBitQuitCommandReceived
- | lldb.SBCommandInterpreter.eBroadcastBitAsynchronousOutputData
- | lldb.SBCommandInterpreter.eBroadcastBitAsynchronousErrorData
- )
+ lldb.SBCommandInterpreter.GetBroadcasterClass(),
+ lldb.SBCommandInterpreter.eBroadcastBitThreadShouldExit
+ | lldb.SBCommandInterpreter.eBroadcastBitResetPrompt
+ | lldb.SBCommandInterpreter.eBroadcastBitQuitCommandReceived
+ | lldb.SBCommandInterpreter.eBroadcastBitAsynchronousOutputData
+ | lldb.SBCommandInterpreter.eBroadcastBitAsynchronousErrorData
+ )
+
def createTarget(self, target_image, args=None):
self.handleCommand("target create %s" % target_image)
if args is not None:
- self.handleCommand("settings set target.run-args %s" % args)
+ self.handleCommand("settings set target.run-args %s" % args)
def attachProcess(self, pid):
self.handleCommand("process attach -p %d" % pid)
@@ -123,9 +127,10 @@ class DebuggerDriver(Thread):
lldb.SBDebugger.Terminate()
sys.exit(0)
+
def createDriver(debugger, event_queue):
driver = DebuggerDriver(debugger, event_queue)
- #driver.start()
+ # driver.start()
# if pid specified:
# - attach to pid
# else if core file specified