1#include "foo.h"
2
3#include <cstdint>
4#include <map>
5#include <vector>
6
7static int static_int = 42;
8
9int non_static_int = 43;
10
11int a_function(int list) {
12 return list; // breakpoint 3
13}
14
15struct my_struct {
16 int foo;
17};
18
19int main(int argc, char const *argv[]) {
20 my_struct struct1 = {.foo: 15};
21 my_struct *struct2 = new my_struct{.foo: 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(list: var3);
32 foo_func();
33
34 std::vector<int> my_vec;
35 my_vec.push_back(x: 1);
36 my_vec.push_back(x: 2);
37 my_vec.push_back(x: 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(x: true);
46 my_bool_vec.push_back(x: false); // breakpoint 6
47 my_bool_vec.push_back(x: true); // breakpoint 7
48
49 uint8_t my_ints[] = {5, 10, 15, 20, 25, 30};
50 return 0; // breakpoint 8
51}
52

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of lldb/test/API/tools/lldb-dap/evaluate/main.cpp