summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-11-08 10:48:50 +0000
committerPavel Labath <labath@google.com>2017-11-08 10:48:50 +0000
commit042c7526917a275cb7241a67b8b54fdef096b343 (patch)
tree9e5e0841ab7848a7266e91024538bd07f7ed28ee /lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
parentb5da91c875c53918a9bafc9afbd54390b0819422 (diff)
downloadbcm5719-llvm-042c7526917a275cb7241a67b8b54fdef096b343.tar.gz
bcm5719-llvm-042c7526917a275cb7241a67b8b54fdef096b343.zip
Make TestTopLevelExprs more robust in face of linker GC
Summary: This test was failing in various configurations on linux in a fairly unpredictible way. The success depended on whether the c++ abi library was linked in statically or not and how well was the linker able to strip parts of it. This introduces additional code to the "dummmy" test executable, which ensures that all parts of the library needed to evaluate the expressions are always present. Reviewers: clayborg Subscribers: srhines, tatyana-krasnukha, davide, lldb-commits Differential Revision: https://reviews.llvm.org/D39727 llvm-svn: 317678
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp b/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
index 31204b21d97..fa49bd4bda7 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
@@ -1,7 +1,15 @@
#include <stdio.h>
-int main()
-{
- printf("This is a dummy\n"); // Set breakpoint here
- return 0;
+// These are needed to make sure that the linker does not strip the parts of the
+// C++ abi library that are necessary to execute the expressions in the
+// debugger. It would be great if we did not need to do this, but the fact that
+// LLDB cannot conjure up the abi library on demand is not relevant for testing
+// top level expressions.
+struct DummyA {};
+struct DummyB : public virtual DummyA {};
+
+int main() {
+ DummyB b;
+ printf("This is a dummy\n"); // Set breakpoint here
+ return 0;
}
OpenPOWER on IntegriCloud