1 #include <stdio.h> 2 #include <stdint.h> 3 4 // This simple program is to test the lldb Python API SBValue.GetChildAtIndex(). 5 6 int g_my_int = 100; 7 8 const char *days_of_week[7] = { "Sunday", 9 "Monday", 10 "Tuesday", 11 "Wednesday", 12 "Thursday", 13 "Friday", 14 "Saturday" }; 15 16 const char *weekdays[5] = { "Monday", 17 "Tuesday", 18 "Wednesday", 19 "Thursday", 20 "Friday" }; 21 22 const char **g_table[2] = { days_of_week, weekdays }; 23 24 typedef int MyInt; 25 26 struct MyStruct 27 { 28 int a; 29 int b; 30 }; 31 32 int main (int argc, char const *argv[]) 33 { 34 uint32_t uinthex = 0xE0A35F10; 35 int32_t sinthex = 0xE0A35F10; 36 37 int i; 38 MyInt a = 12345; 39 struct MyStruct s = { 11, 22 }; 40 int *my_int_ptr = &g_my_int; 41 printf("my_int_ptr points to location %p\n", my_int_ptr); 42 const char **str_ptr = days_of_week; 43 for (i = 0; i < 7; ++i) 44 printf("%s\n", str_ptr[i]); // Break at this line 45 // and do str_ptr_val.GetChildAtIndex(5, lldb.eNoDynamicValues, True). 46 47 return 0; 48 } 49