summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal
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/packages/Python/lldbsuite/test/tools/lldb-mi/signal
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadbcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
*** 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/packages/Python/lldbsuite/test/tools/lldb-mi/signal')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py100
1 files changed, 61 insertions, 39 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
index 197bfa80b3a..e4cd98b2292 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
@@ -5,22 +5,22 @@ Test that the lldb-mi handles signals properly.
from __future__ import print_function
-
import lldbmi_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Fails on FreeBSD apparently due to thread race conditions
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfFreeBSD # llvm.org/pr22411: Fails on FreeBSD apparently due to thread race conditions
def test_lldbmi_stopped_when_interrupt(self):
"""Test that 'lldb-mi --interpreter' interrupt and resume a looping app."""
- self.spawnLldbMi(args = None)
+ self.spawnLldbMi(args=None)
# Load executable
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
@@ -41,23 +41,25 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that -exec-interrupt can interrupt an execution
self.runCmd("-exec-interrupt")
- self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.+?thread-id=\"1\",stopped-threads=\"all\"")
+ self.expect(
+ "\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.+?thread-id=\"1\",stopped-threads=\"all\"")
# Continue (to loop forever)
self.runCmd("-exec-continue")
self.expect("\^running")
# Test that Ctrl+C can interrupt an execution
- self.child.sendintr() #FIXME: here uses self.child directly
- self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.*thread-id=\"1\",stopped-threads=\"all\"")
+ self.child.sendintr() # FIXME: here uses self.child directly
+ self.expect(
+ "\*stopped,reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\",.*thread-id=\"1\",stopped-threads=\"all\"")
- @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Fails on FreeBSD apparently due to thread race conditions
- @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfFreeBSD # llvm.org/pr22411: Fails on FreeBSD apparently due to thread race conditions
+ @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
def test_lldbmi_stopped_when_stopatentry_local(self):
"""Test that 'lldb-mi --interpreter' notifies after it was stopped on entry (local)."""
- self.spawnLldbMi(args = None)
+ self.spawnLldbMi(args=None)
# Load executable
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
@@ -70,9 +72,12 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that *stopped is printed
# Note that message is different in Darwin and Linux:
# Darwin: "*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",frame={level=\"0\",addr=\"0x[0-9a-f]+\",func=\"_dyld_start\",file=\"??\",fullname=\"??\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\"
- # Linux: "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"??\",args=[],file=\"??\",fullname=\"??\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\"
- self.expect([ "\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"_dyld_start\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"\},thread-id=\"1\",stopped-threads=\"all\"",
- "\*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"\?\?\",args=\[\],file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\"" ])
+ # Linux:
+ # "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"??\",args=[],file=\"??\",fullname=\"??\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\"
+ self.expect(
+ [
+ "\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",frame=\{level=\"0\",addr=\"0x[0-9a-f]+\",func=\"_dyld_start\",file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"\},thread-id=\"1\",stopped-threads=\"all\"",
+ "\*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"\?\?\",args=\[\],file=\"\?\?\",fullname=\"\?\?\",line=\"-1\"},thread-id=\"1\",stopped-threads=\"all\""])
# Run to main to make sure we have not exited the application
self.runCmd("-break-insert -f main")
@@ -81,7 +86,7 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")
- @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipUnlessDarwin
def test_lldbmi_stopped_when_stopatentry_remote(self):
"""Test that 'lldb-mi --interpreter' notifies after it was stopped on entry (remote)."""
@@ -93,19 +98,25 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.skipTest("debugserver exe not found")
hostname = "localhost"
import random
- port = 12000 + random.randint(0,3999) # the same as GdbRemoteTestCaseBase.get_next_port
+ # the same as GdbRemoteTestCaseBase.get_next_port
+ port = 12000 + random.randint(0, 3999)
import pexpect
- debugserver_child = pexpect.spawn("%s %s:%d" % (debugserver_exe, hostname, port))
- self.addTearDownHook(lambda: debugserver_child.terminate(force = True))
+ debugserver_child = pexpect.spawn(
+ "%s %s:%d" %
+ (debugserver_exe, hostname, port))
+ self.addTearDownHook(lambda: debugserver_child.terminate(force=True))
- self.spawnLldbMi(args = None)
+ self.spawnLldbMi(args=None)
# Connect to debugserver
- self.runCmd("-interpreter-exec command \"platform select remote-macosx --sysroot /\"")
+ self.runCmd(
+ "-interpreter-exec command \"platform select remote-macosx --sysroot /\"")
self.expect("\^done")
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
self.expect("\^done")
- self.runCmd("-interpreter-exec command \"process connect connect://%s:%d\"" % (hostname, port))
+ self.runCmd(
+ "-interpreter-exec command \"process connect connect://%s:%d\"" %
+ (hostname, port))
self.expect("\^done")
# Run with stop-at-entry flag
@@ -113,19 +124,20 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\^done")
# Test that *stopped is printed
- self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.+?thread-id=\"1\",stopped-threads=\"all\"")
+ self.expect(
+ "\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.+?thread-id=\"1\",stopped-threads=\"all\"")
# Exit
self.runCmd("-gdb-exit")
self.expect("\^exit")
- @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
def test_lldbmi_stopped_when_segfault_local(self):
"""Test that 'lldb-mi --interpreter' notifies after it was stopped when segfault occurred (local)."""
- self.spawnLldbMi(args = None)
+ self.spawnLldbMi(args=None)
# Load executable
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
@@ -147,9 +159,11 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that *stopped is printed
# Note that message is different in Darwin and Linux:
# Darwin: "*stopped,reason=\"exception-received\",exception=\"EXC_BAD_ACCESS (code=1, address=0x0)\",thread-id=\"1\",stopped-threads=\"all\""
- # Linux: "*stopped,reason=\"exception-received\",exception=\"invalid address (fault address: 0x0)\",thread-id=\"1\",stopped-threads=\"all\""
- self.expect([ "\*stopped,reason=\"exception-received\",exception=\"EXC_BAD_ACCESS \(code=1, address=0x0\)\",thread-id=\"1\",stopped-threads=\"all\"",
- "\*stopped,reason=\"exception-received\",exception=\"invalid address \(fault address: 0x0\)\",thread-id=\"1\",stopped-threads=\"all\"" ])
+ # Linux: "*stopped,reason=\"exception-received\",exception=\"invalid
+ # address (fault address:
+ # 0x0)\",thread-id=\"1\",stopped-threads=\"all\""
+ self.expect(["\*stopped,reason=\"exception-received\",exception=\"EXC_BAD_ACCESS \(code=1, address=0x0\)\",thread-id=\"1\",stopped-threads=\"all\"",
+ "\*stopped,reason=\"exception-received\",exception=\"invalid address \(fault address: 0x0\)\",thread-id=\"1\",stopped-threads=\"all\""])
@skipUnlessDarwin
def test_lldbmi_stopped_when_segfault_remote(self):
@@ -162,27 +176,34 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.skipTest("debugserver exe not found")
hostname = "localhost"
import random
- port = 12000 + random.randint(0,3999) # the same as GdbRemoteTestCaseBase.get_next_port
+ # the same as GdbRemoteTestCaseBase.get_next_port
+ port = 12000 + random.randint(0, 3999)
import pexpect
- debugserver_child = pexpect.spawn("%s %s:%d" % (debugserver_exe, hostname, port))
- self.addTearDownHook(lambda: debugserver_child.terminate(force = True))
+ debugserver_child = pexpect.spawn(
+ "%s %s:%d" %
+ (debugserver_exe, hostname, port))
+ self.addTearDownHook(lambda: debugserver_child.terminate(force=True))
- self.spawnLldbMi(args = None)
+ self.spawnLldbMi(args=None)
# Connect to debugserver
- self.runCmd("-interpreter-exec command \"platform select remote-macosx --sysroot /\"")
+ self.runCmd(
+ "-interpreter-exec command \"platform select remote-macosx --sysroot /\"")
self.expect("\^done")
self.runCmd("-file-exec-and-symbols %s" % self.myexe)
self.expect("\^done")
- self.runCmd("-interpreter-exec command \"process connect connect://%s:%d\"" % (hostname, port))
+ self.runCmd(
+ "-interpreter-exec command \"process connect connect://%s:%d\"" %
+ (hostname, port))
self.expect("\^done")
# Run to main
self.runCmd("-break-insert -f main")
self.expect("\^done,bkpt={number=\"1\"")
- #FIXME -exec-run doesn't work
- self.runCmd("-interpreter-exec command \"process launch\"") #FIXME: self.runCmd("-exec-run")
- self.expect("\^done") #FIXME: self.expect("\^running")
+ # FIXME -exec-run doesn't work
+ # FIXME: self.runCmd("-exec-run")
+ self.runCmd("-interpreter-exec command \"process launch\"")
+ self.expect("\^done") # FIXME: self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")
# Set do_segfault=1 and run (to cause a segfault error)
@@ -192,7 +213,8 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\^running")
# Test that *stopped is printed
- self.expect("\*stopped,reason=\"exception-received\",exception=\"EXC_BAD_ACCESS \(code=1, address=0x0\)\",thread-id=\"1\",stopped-threads=\"all\"")
+ self.expect(
+ "\*stopped,reason=\"exception-received\",exception=\"EXC_BAD_ACCESS \(code=1, address=0x0\)\",thread-id=\"1\",stopped-threads=\"all\"")
# Exit
self.runCmd("-gdb-exit")
OpenPOWER on IntegriCloud