Skip to content

Commit c36e679

Browse files
committed
Fix the test so that the linker can't overlap the padding and branch island symbols.
1 parent 571518e commit c36e679

File tree

5 files changed

+8
-30
lines changed

5 files changed

+8
-30
lines changed

lldb/test/API/macosx/branch-islands/TestBranchIslands.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,8 @@ def do_test(self):
2828
syms = target.FindSymbols("foo.island", lldb.eSymbolTypeCode)
2929
self.assertEqual(len(syms), 1, "We did generate an island for foo")
3030

31-
# Gathering some info to dump in case of failure:
32-
trace_before = lldbutil.print_stacktrace(thread, True)
33-
func_before = thread.frames[0].function
34-
3531
thread.StepInto()
3632
stop_frame = thread.frames[0]
37-
# This is failing on the bot, but I can't reproduce the failure
38-
# locally. Let's see if we can dump some more info here to help
39-
# figure out what went wrong...
40-
if stop_frame.name.find("foo") == -1:
41-
stream = lldb.SBStream()
42-
print("Branch island symbols: ")
43-
syms[0].GetDescription(stream)
44-
for i in range(0, 6):
45-
for sep in ["", "."]:
46-
syms = target.FindSymbols(
47-
f"foo.island{sep}{i}", lldb.eSymbolTypeCode
48-
)
49-
if len(syms) > 0:
50-
stream.Print("\n")
51-
syms[0].GetDescription(stream)
52-
53-
print(stream.GetData())
54-
print(f"Start backtrace:")
55-
print(trace_before)
56-
print(f"\n'main' disassembly:\n{lldbutil.disassemble(target, func_before)}")
57-
print("\nEnd backtrace:\n")
58-
lldbutil.print_stacktrace(thread)
59-
print(
60-
f"\nStop disassembly:\n {lldbutil.disassemble(target, stop_frame.function)}"
61-
)
62-
6333
self.assertIn("foo", stop_frame.name, "Stepped into foo")
6434
var = stop_frame.FindVariable("a_variable_in_foo")
6535
self.assertTrue(var.IsValid(), "Found the variable in foo")
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.text
22
_padding1:
3+
.p2align 2
4+
.byte 0x10
35
.space 120*1024*1024
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.text
22
_padding2:
3+
.p2align 2
4+
.byte 0x10
35
.space 120*1024*1024
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.text
22
_padding3:
3+
.p2align 2
4+
.byte 0x10
35
.space 120*1024*1024
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.text
22
_padding4:
3+
.p2align 2
4+
.byte 0x10
35
.space 120*1024*1024

0 commit comments

Comments
 (0)