summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-07-16 01:47:12 +0000
committerSiva Chandra <sivachandra@google.com>2015-07-16 01:47:12 +0000
commitf8877efc8ba64360179b85af9fd019aae549d1a7 (patch)
tree162796467b673f6dd152707c7c66e46229144016 /lldb/test/python_api
parent938bd6fc963af5028a31b315b982ac390786af1b (diff)
downloadbcm5719-llvm-f8877efc8ba64360179b85af9fd019aae549d1a7.tar.gz
bcm5719-llvm-f8877efc8ba64360179b85af9fd019aae549d1a7.zip
Add a class ValueObjectConstResultCast.
Summary: Other changes around the main change include: 1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl and ValueObjectConstResultChild. 2. Add an argument |live_address| of type lldb::addr_t to the constructor of ValueObjectConstResultChild. This is passed on to the backing ValueObjectConstResultImpl object constructor so that the address of the child value can be calculated properly. Reviewers: granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11203 llvm-svn: 242374
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/value/TestValueAPI.py6
-rw-r--r--lldb/test/python_api/value/main.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py
index 60239762a7f..0839c37055c 100644
--- a/lldb/test/python_api/value/TestValueAPI.py
+++ b/lldb/test/python_api/value/TestValueAPI.py
@@ -137,6 +137,12 @@ class ValueAPITestCase(TestBase):
self.DebugSBValue(val2)
self.assertTrue(child.GetValue() == val2.GetValue() and
child.GetSummary() == val2.GetSummary())
+
+ val_i = target.EvaluateExpression('i')
+ val_s = target.EvaluateExpression('s')
+ val_a = target.EvaluateExpression('a')
+ self.assertTrue(val_s.GetChildMemberWithName('a').AddressOf(), VALID_VARIABLE)
+ self.assertTrue(val_a.Cast(val_i.GetType()).AddressOf(), VALID_VARIABLE)
if __name__ == '__main__':
import atexit
diff --git a/lldb/test/python_api/value/main.c b/lldb/test/python_api/value/main.c
index afe4f0ed8bb..a00795750de 100644
--- a/lldb/test/python_api/value/main.c
+++ b/lldb/test/python_api/value/main.c
@@ -28,9 +28,19 @@ const char *weekdays[5] = { "Monday",
const char **g_table[2] = { days_of_week, weekdays };
+typedef int MyInt;
+
+struct MyStruct
+{
+ int a;
+ int b;
+};
+
int main (int argc, char const *argv[])
{
int i;
+ MyInt a = 12345;
+ struct MyStruct s = { 11, 22 };
int *my_int_ptr = &g_my_int;
printf("my_int_ptr points to location %p\n", my_int_ptr);
const char **str_ptr = days_of_week;
OpenPOWER on IntegriCloud