diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-13 20:06:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-13 20:06:56 +0000 |
commit | 7fed546d1996271dabc7cf71d4d033125c4da4ee (patch) | |
tree | 2b6dc7dcb4a6380cb331aded15f5a81c0038e194 /packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c | |
parent | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c')
-rw-r--r-- | packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c new file mode 100644 index 000000000000..5f936327e4ea --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c @@ -0,0 +1,29 @@ +#ifdef _MSC_VER +#include <intrin.h> +#define BREAKPOINT_INTRINSIC() __debugbreak() +#else +#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3") +#endif + +int +bar(int const *foo) +{ + int count = 0, i = 0; + for (; i < 10; ++i) + { + count += 1; + BREAKPOINT_INTRINSIC(); + count += 1; + } + return *foo; +} + +int +main(int argc, char **argv) +{ + int foo = 42; + bar(&foo); + return 0; +} + + |