[Lldb-commits] [lldb] 5d7c1d8 - [lldb] Readd deleted variable in the sample test
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Mon May 24 07:29:42 PDT 2021
Author: Raphael Isemann
Date: 2021-05-24T16:29:25+02:00
New Revision: 5d7c1d8f33c305b5113cd1429344524ddc2316d9
URL: https://github.com/llvm/llvm-project/commit/5d7c1d8f33c305b5113cd1429344524ddc2316d9
DIFF: https://github.com/llvm/llvm-project/commit/5d7c1d8f33c305b5113cd1429344524ddc2316d9.diff
LOG: [lldb] Readd deleted variable in the sample test
In D102771 wanted to make `test_var` global to demonstrate the a no-launch test,
but the old variable is still needed for another test. This just creates the
global var with a different name to demonstrate the no-launch functionality.
Added:
Modified:
lldb/test/API/sample_test/TestSampleTest.py
lldb/test/API/sample_test/main.c
Removed:
################################################################################
diff --git a/lldb/test/API/sample_test/TestSampleTest.py b/lldb/test/API/sample_test/TestSampleTest.py
index a2d56e2fda3d..446f4b9f4d3e 100644
--- a/lldb/test/API/sample_test/TestSampleTest.py
+++ b/lldb/test/API/sample_test/TestSampleTest.py
@@ -50,4 +50,4 @@ def sample_test_no_launch(self):
""" Same as above but doesn't launch a process."""
target = self.createTestTarget()
- self.expect_expr("test_var", result_value="10")
+ self.expect_expr("global_test_var", result_value="10")
diff --git a/lldb/test/API/sample_test/main.c b/lldb/test/API/sample_test/main.c
index ac1611b53440..7f53fd41dc7d 100644
--- a/lldb/test/API/sample_test/main.c
+++ b/lldb/test/API/sample_test/main.c
@@ -1,14 +1,15 @@
#include <stdio.h>
-int test_var = 10;
+int global_test_var = 10;
int
main()
{
+ int test_var = 10;
printf ("Set a breakpoint here: %d.\n", test_var);
//% test_var = self.frame().FindVariable("test_var")
//% test_value = test_var.GetValueAsUnsigned()
//% self.assertTrue(test_var.GetError().Success(), "Failed to fetch test_var")
//% self.assertEqual(test_value, 10, "Failed to get the right value for test_var")
- return 0;
+ return global_test_var;
}
More information about the lldb-commits
mailing list