summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression
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/expression_command/unwind_expression
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/expression_command/unwind_expression')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py52
1 files changed, 33 insertions, 19 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py b/lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
index 6e9af641d03..09917ab3162 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
@@ -5,15 +5,16 @@ Test stopping at a breakpoint in an expression, and unwinding from there.
from __future__ import print_function
-
import unittest2
-import os, time
+import os
+import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class UnwindFromExpressionTest(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -23,7 +24,6 @@ class UnwindFromExpressionTest(TestBase):
TestBase.setUp(self)
@add_test_categories(['pyapi'])
-
def test_unwind_expression(self):
"""Test unwinding from an expression."""
self.build()
@@ -35,11 +35,13 @@ class UnwindFromExpressionTest(TestBase):
# Create the breakpoint.
main_spec = lldb.SBFileSpec("main.cpp", False)
- breakpoint = target.BreakpointCreateBySourceRegex("// Set a breakpoint here to get started", main_spec)
+ breakpoint = target.BreakpointCreateBySourceRegex(
+ "// Set a breakpoint here to get started", main_spec)
self.assertTrue(breakpoint, VALID_BREAKPOINT)
# Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple (None, None, self.get_process_working_directory())
+ process = target.LaunchSimple(
+ None, None, self.get_process_working_directory())
if not process:
self.fail("SBTarget.LaunchProcess() failed")
@@ -49,17 +51,20 @@ class UnwindFromExpressionTest(TestBase):
"instead the actual state is: '%s'" %
lldbutil.state_type_to_str(process.GetState()))
- thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint)
- self.assertIsNotNone(thread, "Expected one thread to be stopped at the breakpoint")
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(
+ process, breakpoint)
+ self.assertIsNotNone(
+ thread, "Expected one thread to be stopped at the breakpoint")
#
# Use Python API to evaluate expressions while stopped in a stack frame.
#
main_frame = thread.GetFrameAtIndex(0)
- # Next set a breakpoint in this function, set up Expression options to stop on
+ # Next set a breakpoint in this function, set up Expression options to stop on
# breakpoint hits, and call the function.
- fun_bkpt = target.BreakpointCreateBySourceRegex("// Stop inside the function here.", main_spec)
+ fun_bkpt = target.BreakpointCreateBySourceRegex(
+ "// Stop inside the function here.", main_spec)
self.assertTrue(fun_bkpt, VALID_BREAKPOINT)
options = lldb.SBExpressionOptions()
options.SetIgnoreBreakpoints(False)
@@ -67,17 +72,26 @@ class UnwindFromExpressionTest(TestBase):
val = main_frame.EvaluateExpression("a_function_to_call()", options)
- self.assertTrue(val.GetError().Fail(), "We did not complete the execution.")
+ self.assertTrue(
+ val.GetError().Fail(),
+ "We did not complete the execution.")
error_str = val.GetError().GetCString()
- self.assertTrue("Execution was interrupted, reason: breakpoint" in error_str, "And the reason was right.")
-
- thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, fun_bkpt)
- self.assertTrue(thread.IsValid(), "We are indeed stopped at our breakpoint")
-
- # Now unwind the expression, and make sure we got back to where we started.
+ self.assertTrue(
+ "Execution was interrupted, reason: breakpoint" in error_str,
+ "And the reason was right.")
+
+ thread = lldbutil.get_one_thread_stopped_at_breakpoint(
+ process, fun_bkpt)
+ self.assertTrue(
+ thread.IsValid(),
+ "We are indeed stopped at our breakpoint")
+
+ # Now unwind the expression, and make sure we got back to where we
+ # started.
error = thread.UnwindInnermostExpression()
self.assertTrue(error.Success(), "We succeeded in unwinding")
-
- cur_frame = thread.GetFrameAtIndex(0)
- self.assertTrue(cur_frame.IsEqual(main_frame), "We got back to the main frame.")
+ cur_frame = thread.GetFrameAtIndex(0)
+ self.assertTrue(
+ cur_frame.IsEqual(main_frame),
+ "We got back to the main frame.")
OpenPOWER on IntegriCloud