Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
12 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |