1 | #ifdef _MSC_VER |
---|---|
2 | #include <intrin.h> |
3 | #define BREAKPOINT_INTRINSIC() __debugbreak() |
4 | #else |
5 | #define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3") |
6 | #endif |
7 | |
8 | int |
9 | bar(int const *foo) |
10 | { |
11 | int count = 0, i = 0; |
12 | for (; i < 10; ++i) |
13 | { |
14 | count += 1; |
15 | BREAKPOINT_INTRINSIC(); |
16 | count += 1; |
17 | } |
18 | return *foo; |
19 | } |
20 | |
21 | int |
22 | main(int argc, char **argv) |
23 | { |
24 | int foo = 42; |
25 | bar(foo: &foo); |
26 | return 0; |
27 | } |
28 | |
29 | |
30 |