Skip to content

Commit 04a9ad1

Browse files
committed
Ensure breakpoints are in the intended scope by tying them to a print statement.
1 parent d20d8db commit 04a9ad1

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

lldb/test/API/functionalities/data-formatter/swift/array-slice/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ func main() {
33
let someSlice = a[1...]
44
let arraySlice: ArraySlice<Int> = a[1...]
55
let arraySubSequence: Array<Int>.SubSequence = a[1...]
6-
// break here
6+
print("break here")
77
}
88

99
main()

lldb/test/API/functionalities/data-formatter/swift/string-index/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func exercise(_ string: String) {
1818
let unicodeScalarIndices = allIndices(string.unicodeScalars)
1919
let utf8Indices = allIndices(string.utf8)
2020
let utf16Indices = allIndices(string.utf16)
21-
// break here
21+
print("break here")
2222
}
2323

2424
func allIndices<T: Collection>(_ collection: T) -> [T.Index] {

lldb/test/API/functionalities/data-formatter/swift/substring/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func exerciseString() {
1313

1414
func exercise(_ string: String) {
1515
let substrings = allIndices(string).map { string[$0..<string.endIndex] }
16-
// break here
16+
print("break here")
1717
}
1818

1919
func allIndices<T: Collection>(_ collection: T) -> [T.Index] {

lldb/test/API/lang/swift/async/frame/variable/TestSwiftAsyncFrameVar.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ def test(self):
1515

1616
source_file = lldb.SBFileSpec("main.swift")
1717
target, process, _, _ = lldbutil.run_to_source_breakpoint(
18-
self, "// break one", source_file)
18+
self, "break one", source_file)
1919

2020
# At "break one", only the `a` variable should have a value.
2121
frame = process.GetSelectedThread().frames[0]
2222
a = frame.FindVariable("a")
2323
self.assertTrue(a.IsValid())
2424
self.assertGreater(a.unsigned, 0)
2525
b = frame.FindVariable("b")
26-
self.assertTrue(b.IsValid())
27-
self.assertEqual(b.unsigned, 0)
26+
self.assertFalse(b.IsValid())
2827
d = frame.FindVariable("d")
2928
lldbutil.check_variable(self, d, False, value='23')
3029

@@ -34,7 +33,7 @@ def test(self):
3433
target.DeleteAllBreakpoints()
3534

3635
# Setup, and run to, the next breakpoint.
37-
target.BreakpointCreateBySourceRegex("// break two", source_file)
36+
target.BreakpointCreateBySourceRegex("break two", source_file)
3837
self.setAsync(False)
3938
process.Continue()
4039

lldb/test/API/lang/swift/async/frame/variable/main.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ func inner<T>(_ t: T) async {
77
// is unknown.
88
let d = t
99
let a = await randInt(30)
10-
let b = await randInt(a + 11) // break one
10+
print("break one")
11+
let b = await randInt(a + 11)
1112
use(a, b)
12-
use(d) // break two
13+
use(d)
14+
print("break two")
1315
}
1416

1517
func use<T>(_ t: T...) {}

lldb/test/API/lang/swift/stepping/TestSwiftStepping.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def do_test(self):
220220
thread.StepOut()
221221
self.hit_correct_line(thread, "Second case with a where statement")
222222

223+
thread.StepOver()
223224
thread.StepOver()
224225
self.hit_correct_line(
225226
thread, "print in second case with where statement.")

lldb/test/API/lang/swift/swift_reference_counting/main.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ func lambda(_ Arg : Patatino) -> Int {
2424
}
2525

2626
func main() -> Int {
27-
var LiveObj = Patatino(37) //%self.expect('language swift refcount Blah', substrs=['cannot find \'Blah\''], error=True)
28-
var Ret : Int = lambda(LiveObj) //%self.expect('language swift refcount LiveObj', substrs=['(strong =', 'unowned =', 'weak ='])
29-
var MyStruct = Tinky() //%self.expect('language swift refcount MyStruct', substrs=['refcount only available for class types'], error=True)
27+
var LiveObj = Patatino(37)
28+
var Ret : Int = lambda(LiveObj)
29+
var MyStruct = Tinky()
30+
print("break here")
31+
//%self.expect('language swift refcount Blah', substrs=['cannot find \'Blah\''], error=True)
32+
//%self.expect('language swift refcount LiveObj', substrs=['(strong =', 'unowned =', 'weak ='])
33+
//%self.expect('language swift refcount MyStruct', substrs=['refcount only available for class types'], error=True)
3034
return Ret
3135
}
3236

0 commit comments

Comments
 (0)