Can’t you just disable linker gc in the makefile?<br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 7, 2017 at 4:18 AM Pavel Labath via Phabricator via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath created this revision.<br>
Herald added a subscriber: srhines.<br>
<br>
This test was failing in various configurations on linux in a fairly<br>
unpredictible way. The success depended on whether the c++ abi library<br>
was linked in statically or not and how well was the linker able to<br>
strip parts of it. This introduces additional code to the "dummmy" test<br>
executable, which ensures that all parts of the library needed to<br>
evaluate the expressions are always present.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D39727" rel="noreferrer" target="_blank">https://reviews.llvm.org/D39727</a><br>
<br>
Files:<br>
packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
<br>
<br>
Index: packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
===================================================================<br>
--- packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
+++ packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp<br>
@@ -1,7 +1,15 @@<br>
#include <stdio.h><br>
<br>
-int main()<br>
-{<br>
- printf("This is a dummy\n"); // Set breakpoint here<br>
- return 0;<br>
+// These are needed to make sure that the linker does not strip the parts of the<br>
+// C++ abi library that are necessary to execute the expressions in the<br>
+// debugger. It would be great if we did not need to do this, but the fact that<br>
+// LLDB cannot conjure up the abi library on demand is not relevant for testing<br>
+// top level expressions.<br>
+struct DummyA {};<br>
+struct DummyB : public virtual DummyA {};<br>
+<br>
+int main() {<br>
+ DummyB b;<br>
+ printf("This is a dummy\n"); // Set breakpoint here<br>
+ return 0;<br>
}<br>
Index: packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
===================================================================<br>
--- packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
+++ packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py<br>
@@ -57,23 +57,6 @@<br>
self.runCmd("run", RUN_SUCCEEDED)<br>
<br>
@add_test_categories(['pyapi'])<br>
- @expectedFailureAndroid(api_levels=list(range(22+1)), bugnumber="<a href="http://llvm.org/pr27787" rel="noreferrer" target="_blank">llvm.org/pr27787</a>")<br>
- @expectedFailureAll(<br>
- oslist=["linux"],<br>
- archs=[<br>
- "arm",<br>
- "aarch64"],<br>
- bugnumber="<a href="http://llvm.org/pr27787" rel="noreferrer" target="_blank">llvm.org/pr27787</a>")<br>
- @expectedFailureAll(<br>
- bugnumber="<a href="http://llvm.org/pr28353" rel="noreferrer" target="_blank">llvm.org/pr28353</a>",<br>
- oslist=["linux"],<br>
- archs=[<br>
- "i386",<br>
- "x86_64"],<br>
- compiler="gcc",<br>
- compiler_version=[<br>
- "<",<br>
- "4.9"])<br>
@skipIf(debug_info="gmodules") # not relevant<br>
@skipIf(oslist=["windows"]) # Error in record layout on Windows<br>
def test_top_level_expressions(self):<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>