summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug
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/functionalities/step-avoids-no-debug
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/functionalities/step-avoids-no-debug')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py98
1 files changed, 67 insertions, 31 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
index 8b9c91217de..b0b2e609ba6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
@@ -5,7 +5,6 @@ Test thread step-in, step-over and step-out work with the "Avoid no debug" optio
from __future__ import print_function
-
import os
import re
import sys
@@ -15,6 +14,7 @@ from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+
class ReturnValueTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -27,8 +27,15 @@ class ReturnValueTestCase(TestBase):
self.do_step_out_past_nodebug()
@add_test_categories(['pyapi'])
- @decorators.expectedFailureAll(compiler="gcc", bugnumber="llvm.org/pr28549")
- @decorators.expectedFailureAll(compiler="clang", compiler_version=[">=", "3.9"], archs=["i386"], bugnumber="llvm.org/pr28549")
+ @decorators.expectedFailureAll(
+ compiler="gcc", bugnumber="llvm.org/pr28549")
+ @decorators.expectedFailureAll(
+ compiler="clang",
+ compiler_version=[
+ ">=",
+ "3.9"],
+ archs=["i386"],
+ bugnumber="llvm.org/pr28549")
def test_step_over_with_python(self):
"""Test stepping over using avoid-no-debug with dwarf."""
self.build()
@@ -36,82 +43,111 @@ class ReturnValueTestCase(TestBase):
self.do_step_over_past_nodebug()
@add_test_categories(['pyapi'])
- @decorators.expectedFailureAll(compiler="gcc", bugnumber="llvm.org/pr28549")
- @decorators.expectedFailureAll(compiler="clang", compiler_version=[">=", "3.9"], archs=["i386"], bugnumber="llvm.org/pr28549")
+ @decorators.expectedFailureAll(
+ compiler="gcc", bugnumber="llvm.org/pr28549")
+ @decorators.expectedFailureAll(
+ compiler="clang",
+ compiler_version=[
+ ">=",
+ "3.9"],
+ archs=["i386"],
+ bugnumber="llvm.org/pr28549")
def test_step_in_with_python(self):
"""Test stepping in using avoid-no-debug with dwarf."""
self.build()
self.get_to_starting_point()
self.do_step_in_past_nodebug()
- def setUp (self):
+ def setUp(self):
TestBase.setUp(self)
self.main_source = "with-debug.c"
self.main_source_spec = lldb.SBFileSpec("with-debug.c")
- self.dbg.HandleCommand ("settings set target.process.thread.step-out-avoid-nodebug true")
+ self.dbg.HandleCommand(
+ "settings set target.process.thread.step-out-avoid-nodebug true")
- def tearDown (self):
- self.dbg.HandleCommand ("settings set target.process.thread.step-out-avoid-nodebug false")
+ def tearDown(self):
+ self.dbg.HandleCommand(
+ "settings set target.process.thread.step-out-avoid-nodebug false")
TestBase.tearDown(self)
- def hit_correct_line (self, pattern):
- target_line = line_number (self.main_source, pattern)
- self.assertTrue (target_line != 0, "Could not find source pattern " + pattern)
+ def hit_correct_line(self, pattern):
+ target_line = line_number(self.main_source, pattern)
+ self.assertTrue(
+ target_line != 0,
+ "Could not find source pattern " +
+ pattern)
cur_line = self.thread.frames[0].GetLineEntry().GetLine()
- self.assertTrue (cur_line == target_line, "Stepped to line %d instead of expected %d with pattern '%s'."%(cur_line, target_line, pattern))
-
- def hit_correct_function (self, pattern):
+ self.assertTrue(
+ cur_line == target_line,
+ "Stepped to line %d instead of expected %d with pattern '%s'." %
+ (cur_line,
+ target_line,
+ pattern))
+
+ def hit_correct_function(self, pattern):
name = self.thread.frames[0].GetFunctionName()
- self.assertTrue (pattern in name, "Got to '%s' not the expected function '%s'."%(name, pattern))
+ self.assertTrue(
+ pattern in name, "Got to '%s' not the expected function '%s'." %
+ (name, pattern))
- def get_to_starting_point (self):
+ def get_to_starting_point(self):
exe = os.path.join(os.getcwd(), "a.out")
error = lldb.SBError()
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
- inner_bkpt = self.target.BreakpointCreateBySourceRegex("Stop here and step out of me", self.main_source_spec)
+ inner_bkpt = self.target.BreakpointCreateBySourceRegex(
+ "Stop here and step out of me", self.main_source_spec)
self.assertTrue(inner_bkpt, VALID_BREAKPOINT)
# Now launch the process, and do not stop at entry point.
- self.process = self.target.LaunchSimple (None, None, self.get_process_working_directory())
+ self.process = self.target.LaunchSimple(
+ None, None, self.get_process_working_directory())
self.assertTrue(self.process, PROCESS_IS_VALID)
# Now finish, and make sure the return value is correct.
- threads = lldbutil.get_threads_stopped_at_breakpoint (self.process, inner_bkpt)
+ threads = lldbutil.get_threads_stopped_at_breakpoint(
+ self.process, inner_bkpt)
self.assertTrue(len(threads) == 1, "Stopped at inner breakpoint.")
self.thread = threads[0]
def do_step_out_past_nodebug(self):
# The first step out takes us to the called_from_nodebug frame, just to make sure setting
- # step-out-avoid-nodebug doesn't change the behavior in frames with debug info.
+ # step-out-avoid-nodebug doesn't change the behavior in frames with
+ # debug info.
self.thread.StepOut()
- self.hit_correct_line ("intermediate_return_value = called_from_nodebug_actual(some_value)")
+ self.hit_correct_line(
+ "intermediate_return_value = called_from_nodebug_actual(some_value)")
self.thread.StepOut()
- self.hit_correct_line ("int return_value = no_debug_caller(5, called_from_nodebug)")
+ self.hit_correct_line(
+ "int return_value = no_debug_caller(5, called_from_nodebug)")
- def do_step_over_past_nodebug (self):
+ def do_step_over_past_nodebug(self):
self.thread.StepOver()
- self.hit_correct_line ("intermediate_return_value = called_from_nodebug_actual(some_value)")
+ self.hit_correct_line(
+ "intermediate_return_value = called_from_nodebug_actual(some_value)")
self.thread.StepOver()
- self.hit_correct_line ("return intermediate_return_value")
+ self.hit_correct_line("return intermediate_return_value")
self.thread.StepOver()
# Note, lldb doesn't follow gdb's distinction between "step-out" and "step-over/step-in"
# when exiting a frame. In all cases we leave the pc at the point where we exited the
# frame. In gdb, step-over/step-in move to the end of the line they stepped out to.
# If we ever change this we will need to fix this test.
- self.hit_correct_line ("int return_value = no_debug_caller(5, called_from_nodebug)")
+ self.hit_correct_line(
+ "int return_value = no_debug_caller(5, called_from_nodebug)")
- def do_step_in_past_nodebug (self):
+ def do_step_in_past_nodebug(self):
self.thread.StepInto()
- self.hit_correct_line ("intermediate_return_value = called_from_nodebug_actual(some_value)")
+ self.hit_correct_line(
+ "intermediate_return_value = called_from_nodebug_actual(some_value)")
self.thread.StepInto()
- self.hit_correct_line ("return intermediate_return_value")
+ self.hit_correct_line("return intermediate_return_value")
self.thread.StepInto()
# Note, lldb doesn't follow gdb's distinction between "step-out" and "step-over/step-in"
# when exiting a frame. In all cases we leave the pc at the point where we exited the
# frame. In gdb, step-over/step-in move to the end of the line they stepped out to.
# If we ever change this we will need to fix this test.
- self.hit_correct_line ("int return_value = no_debug_caller(5, called_from_nodebug)")
+ self.hit_correct_line(
+ "int return_value = no_debug_caller(5, called_from_nodebug)")
OpenPOWER on IntegriCloud