1 //===-- main.c --------------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #include <stdio.h> 10 11 // This simple program is to test the lldb Python API SBValue.GetChildAtIndex(). 12 13 int g_my_int = 100; 14 15 const char *days_of_week[7] = { "Sunday", 16 "Monday", 17 "Tuesday", 18 "Wednesday", 19 "Thursday", 20 "Friday", 21 "Saturday" }; 22 23 const char *weekdays[5] = { "Monday", 24 "Tuesday", 25 "Wednesday", 26 "Thursday", 27 "Friday" }; 28 29 const char **g_table[2] = { days_of_week, weekdays }; 30 31 int main (int argc, char const *argv[]) 32 { 33 int i; 34 int *my_int_ptr = &g_my_int; 35 printf("my_int_ptr points to location %p\n", my_int_ptr); 36 const char **str_ptr = days_of_week; 37 for (i = 0; i < 7; ++i) 38 printf("%s\n", str_ptr[i]); // Break at this line 39 // and do str_ptr_val.GetChildAtIndex(5, lldb.eNoDynamicValues, True). 40 41 return 0; 42 } 43