xref: /llvm-project/lldb/test/API/tools/lldb-dap/evaluate/main.cpp (revision c658d07c4f8210555473c5721e1302f00f9fd25b)
1 #include "foo.h"
2 
3 #include <cstdint>
4 #include <map>
5 #include <vector>
6 
7 static int static_int = 42;
8 
9 int non_static_int = 43;
10 
11 int a_function(int list) {
12   return list; // breakpoint 3
13 }
14 
15 struct my_struct {
16   int foo;
17 };
18 
19 int main(int argc, char const *argv[]) {
20   my_struct struct1 = {15};
21   my_struct *struct2 = new my_struct{16};
22   my_struct *struct3 = nullptr;
23   int var1 = 20;
24   int var2 = 21;
25   int var3 = static_int; // breakpoint 1
26   {
27     int non_static_int = 10;
28     int var2 = 2;
29     int var3 = non_static_int; // breakpoint 2
30   }
31   a_function(var3);
32   foo_func();
33 
34   std::vector<int> my_vec;
35   my_vec.push_back(1);
36   my_vec.push_back(2);
37   my_vec.push_back(3); // breakpoint 4
38 
39   std::map<int, int> my_map;
40   my_map[1] = 2;
41   my_map[2] = 3;
42   my_map[3] = 4; // breakpoint 5
43 
44   std::vector<bool> my_bool_vec;
45   my_bool_vec.push_back(true);
46   my_bool_vec.push_back(false); // breakpoint 6
47   my_bool_vec.push_back(true);  // breakpoint 7
48 
49   uint8_t my_ints[] = {5, 10, 15, 20, 25, 30};
50   return 0; // breakpoint 8
51 }
52