[Lldb-commits] [lldb] r144697 - in /lldb/trunk/test/python_api/value: TestValueAPI.py main.c
Johnny Chen
johnny.chen at apple.com
Tue Nov 15 13:13:13 PST 2011
Author: johnny
Date: Tue Nov 15 15:13:13 2011
New Revision: 144697
URL: http://llvm.org/viewvc/llvm-project?rev=144697&view=rev
Log:
Add test scenario for value.GetChildAtIndex(0) where value is a pointer to a simple type.
Modified:
lldb/trunk/test/python_api/value/TestValueAPI.py
lldb/trunk/test/python_api/value/main.c
Modified: lldb/trunk/test/python_api/value/TestValueAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/value/TestValueAPI.py?rev=144697&r1=144696&r2=144697&view=diff
==============================================================================
--- lldb/trunk/test/python_api/value/TestValueAPI.py (original)
+++ lldb/trunk/test/python_api/value/TestValueAPI.py Tue Nov 15 15:13:13 2011
@@ -89,6 +89,16 @@
print cvf.format(weekdays)
print rdf.format(g_table)
+ # Get variable 'my_int_ptr'.
+ value = frame0.FindVariable('my_int_ptr')
+ self.assertTrue(value, VALID_VARIABLE)
+ self.DebugSBValue(value)
+
+ # Get what 'my_int_ptr' points to.
+ pointed = value.GetChildAtIndex(0)
+ self.assertTrue(pointed, VALID_VARIABLE)
+ self.DebugSBValue(pointed)
+
# Get variable 'str_ptr'.
value = frame0.FindVariable('str_ptr')
self.assertTrue(value, VALID_VARIABLE)
Modified: lldb/trunk/test/python_api/value/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/value/main.c?rev=144697&r1=144696&r2=144697&view=diff
==============================================================================
--- lldb/trunk/test/python_api/value/main.c (original)
+++ lldb/trunk/test/python_api/value/main.c Tue Nov 15 15:13:13 2011
@@ -31,6 +31,8 @@
int main (int argc, char const *argv[])
{
int i;
+ 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;
for (i = 0; i < 7; ++i)
printf("%s\n", str_ptr[i]); // Break at this line
More information about the lldb-commits
mailing list