1 //===-- main.c --------------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #include <stdio.h>
9 #include <stdint.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 typedef int MyInt;
32 
33 struct MyStruct
34 {
35   int a;
36   int b;
37 };
38 
39 int main (int argc, char const *argv[])
40 {
41     uint32_t uinthex = 0xE0A35F10;
42     int32_t  sinthex = 0xE0A35F10;
43 
44     int i;
45     MyInt a = 12345;
46     struct MyStruct s = { 11, 22 };
47     int *my_int_ptr = &g_my_int;
48     printf("my_int_ptr points to location %p\n", my_int_ptr);
49     const char **str_ptr = days_of_week;
50     for (i = 0; i < 7; ++i)
51         printf("%s\n", str_ptr[i]); // Break at this line
52                                     // and do str_ptr_val.GetChildAtIndex(5, lldb.eNoDynamicValues, True).
53 
54     return 0;
55 }
56