summaryrefslogtreecommitdiffstats
path: root/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c29
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 0000000..5f93632
--- /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;
+}
+
+
OpenPOWER on IntegriCloud