xref: /llvm-project/lldb/test/API/python_api/value/change_values/main.c (revision 4714215efb0486682feaa3a99162e80a934be8f9)
1*4714215eSJonas Devlieghere #include <stdbool.h>
299451b44SJordan Rupprecht #include <stdint.h>
3*4714215eSJonas Devlieghere #include <stdio.h>
499451b44SJordan Rupprecht #include <stdlib.h>
599451b44SJordan Rupprecht 
699451b44SJordan Rupprecht struct foo
799451b44SJordan Rupprecht {
899451b44SJordan Rupprecht   uint8_t   first_val;
999451b44SJordan Rupprecht   uint32_t  second_val;
1099451b44SJordan Rupprecht   uint64_t  third_val;
11*4714215eSJonas Devlieghere   bool fourth_val;
1299451b44SJordan Rupprecht };
1399451b44SJordan Rupprecht 
1499451b44SJordan Rupprecht int main ()
1599451b44SJordan Rupprecht {
1699451b44SJordan Rupprecht   int val = 100;
17*4714215eSJonas Devlieghere   struct foo mine = {55, 5555, 55555555, false};
1899451b44SJordan Rupprecht   struct foo *ptr = (struct foo *) malloc (sizeof (struct foo));
1999451b44SJordan Rupprecht   ptr->first_val = 66;
2099451b44SJordan Rupprecht   ptr->second_val = 6666;
2199451b44SJordan Rupprecht   ptr->third_val = 66666666;
22*4714215eSJonas Devlieghere   ptr->fourth_val = false;
2399451b44SJordan Rupprecht 
2499451b44SJordan Rupprecht   // Stop here and set values
25*4714215eSJonas Devlieghere   printf("Val - %d Mine - %d, %d, %llu, %d. Ptr - %d, %d, %llu, %d\n", val,
26*4714215eSJonas Devlieghere          mine.first_val, mine.second_val, mine.third_val, mine.fourth_val,
27*4714215eSJonas Devlieghere          ptr->first_val, ptr->second_val, ptr->third_val, ptr->fourth_val);
2899451b44SJordan Rupprecht 
2999451b44SJordan Rupprecht   // Stop here and check values
3099451b44SJordan Rupprecht   printf ("This is just another call which we won't make it over %d.", val);
3199451b44SJordan Rupprecht   return 0; // Set a breakpoint here at the end
3299451b44SJordan Rupprecht }
33