1
2#define BUFFER_SIZE 16
3struct PointType {
4 int x;
5 int y;
6 int buffer[BUFFER_SIZE];
7};
8#include <vector>
9int g_global = 123;
10static int s_global = 234;
11int test_indexedVariables();
12int main(int argc, char const *argv[]) {
13 static float s_local = 2.25;
14 PointType pt = {.x: 11, .y: 22, .buffer: {0}};
15 for (int i = 0; i < BUFFER_SIZE; ++i)
16 pt.buffer[i] = i;
17 int x = s_global - g_global - pt.y; // breakpoint 1
18 {
19 int x = 42;
20 {
21 int x = 72;
22 s_global = x; // breakpoint 2
23 }
24 }
25 return test_indexedVariables(); // breakpoint 3
26}
27
28int test_indexedVariables() {
29 int small_array[5] = {1, 2, 3, 4, 5};
30 int large_array[200];
31 std::vector<int> small_vector;
32 std::vector<int> large_vector;
33 small_vector.assign(n: 5, val: 0);
34 large_vector.assign(n: 200, val: 0);
35 return 0; // breakpoint 4
36}
37

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