mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-11 18:06:07 +00:00

*** 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
69 lines
2.4 KiB
Python
69 lines
2.4 KiB
Python
"""
|
|
Test that breakpoint works correctly in the presence of dead-code stripping.
|
|
"""
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
import os
|
|
import time
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class DeadStripTestCase(TestBase):
|
|
|
|
mydir = TestBase.compute_mydir(__file__)
|
|
|
|
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
|
|
@expectedFailureAll(debug_info="dwo", bugnumber="llvm.org/pr25087")
|
|
@expectedFailureAll(
|
|
oslist=["linux"],
|
|
debug_info="gmodules",
|
|
bugnumber="llvm.org/pr27865")
|
|
# The -dead_strip linker option isn't supported on FreeBSD versions of ld.
|
|
@skipIfFreeBSD
|
|
def test(self):
|
|
"""Test breakpoint works correctly with dead-code stripping."""
|
|
self.build()
|
|
exe = os.path.join(os.getcwd(), "a.out")
|
|
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
|
|
|
|
# Break by function name f1 (live code).
|
|
lldbutil.run_break_set_by_symbol(
|
|
self, "f1", num_expected_locations=1, module_name="a.out")
|
|
|
|
# Break by function name f2 (dead code).
|
|
lldbutil.run_break_set_by_symbol(
|
|
self, "f2", num_expected_locations=0, module_name="a.out")
|
|
|
|
# Break by function name f3 (live code).
|
|
lldbutil.run_break_set_by_symbol(
|
|
self, "f3", num_expected_locations=1, module_name="a.out")
|
|
|
|
self.runCmd("run", RUN_SUCCEEDED)
|
|
|
|
# The stop reason of the thread should be breakpoint (breakpoint #1).
|
|
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
|
|
substrs=['stopped',
|
|
'a.out`f1',
|
|
'stop reason = breakpoint'])
|
|
|
|
# The breakpoint should have a hit count of 1.
|
|
self.expect("breakpoint list -f 1", BREAKPOINT_HIT_ONCE,
|
|
substrs=[' resolved, hit count = 1'])
|
|
|
|
self.runCmd("continue")
|
|
|
|
# The stop reason of the thread should be breakpoint (breakpoint #3).
|
|
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
|
|
substrs=['stopped',
|
|
'a.out`f3',
|
|
'stop reason = breakpoint'])
|
|
|
|
# The breakpoint should have a hit count of 1.
|
|
self.expect("breakpoint list -f 3", BREAKPOINT_HIT_ONCE,
|
|
substrs=[' resolved, hit count = 1'])
|