Skip to content

Commit ca76281

Browse files
committed
[lldb] Fix test TestBSDArchives.py properly
The previous patch D156367 introduced a test debugging thin archive with one of the linked object file missing. It actually failed on green dragon build bots. I put up a speculative fix (llvm@4520cc0) that only fixed the symptom of it. The actual root cause was that the timestamps were set to 0 when creating the thin archive Makefile command ``` llvm-ar -rcsDT libfoo-thin.a a.o b.o ``` Where the flag "[D] - use zero for timestamps and uids/gids (default)" according to the llvm-ar help Use "[U] - use actual timestamps and uids/gids" fixed the timestamp Now the test is actually getting error from missing object file linked to the thin archive instead of the mismatched timestamp. This means removing one of the object file a.o should only result in failure breaking at `a()`; breaking at `b()` should work just fine. Test Plan: All 4 test cases passed ``` ▶ ./bin/llvm-lit -vv ../llvm-project/lldb/test/API/functionalities/archives/TestBSDArchives.py llvm-lit: /Users/wanyi/local/llvm-project/lldb/test/API/lit.cfg.py:173: warning: Could not set a default per-test timeout. Requires the Python psutil module but it could not be found. Try installing it via pip or via your operating system's package manager. -- Testing: 1 tests, 1 workers -- PASS: lldb-api :: functionalities/archives/TestBSDArchives.py (1 of 1) Testing Time: 8.07s Passed: 1 1 warning(s) in tests ``` Differential Revision: https://reviews.llvm.org/D156564
1 parent 53f5bfd commit ca76281

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lldb/test/API/functionalities/archives/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ libbar.a: c.o
1818

1919
libfoo-thin.a: a.o b.o
2020
$(eval LLVM_AR := $(LLVM_TOOLS_DIR)/llvm-ar)
21-
$(eval LLVM_ARFLAGS := -rcsDT)
21+
$(eval LLVM_ARFLAGS := -rcsUT)
2222
$(LLVM_AR) $(LLVM_ARFLAGS) $@ $^
2323

2424
include Makefile.rules

lldb/test/API/functionalities/archives/TestBSDArchives.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ def test_frame_var_errors_when_thin_archive_malformed(self):
167167
") of the .o file doesn't match",
168168
]
169169
self.check_frame_variable_errors(thread, error_strings)
170+
171+
# Break at b() should succeed
172+
(target, process, thread, bkpt) = lldbutil.run_to_name_breakpoint(
173+
self, "b", bkpt_module=exe
174+
)
175+
self.expect(
176+
"thread list",
177+
STOPPED_DUE_TO_BREAKPOINT,
178+
substrs=["stopped", "stop reason = breakpoint"],
179+
)
180+
self.expect(
181+
"frame variable", VARIABLES_DISPLAYED_CORRECTLY, substrs=["(int) arg = 2"]
182+
)
183+
170184

171185
@skipIfRemote
172186
@skipUnlessDarwin

0 commit comments

Comments
 (0)