summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/debugging.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/debugging.nim b/examples/debugging.nim
new file mode 100644
index 000000000..89cdd3b2a
--- /dev/null
+++ b/examples/debugging.nim
@@ -0,0 +1,17 @@
+# Simple program to test the debugger
+# compile with --debugger:on
+
+proc someComp(x, y: int): int =
+  let a = x+y
+  if a > 7:
+    let b = a*90
+    {.breakpoint.}
+    result = b
+  {.breakpoint.}
+
+proc pp() =
+  var aa = 45
+  var bb = "abcdef"
+  echo someComp(23, 45)
+
+pp()