summaryrefslogtreecommitdiffstats
path: root/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-01-13 20:06:56 +0000
committerdim <dim@FreeBSD.org>2016-01-13 20:06:56 +0000
commit8553c19974a5ab5f815b9e64f7bfe9899924726b (patch)
tree2b6dc7dcb4a6380cb331aded15f5a81c0038e194 /packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/main.c
parent78b9749c0a4ea980a8b934645da6ae98fcc665e8 (diff)
downloadFreeBSD-src-8553c19974a5ab5f815b9e64f7bfe9899924726b.zip
FreeBSD-src-8553c19974a5ab5f815b9e64f7bfe9899924726b.tar.gz
Vendor import of lldb trunk r257626:
https://llvm.org/svn/llvm-project/lldb/trunk@257626
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