From eb72c7c0a0fb99d13b049de5aacb05673acc0754 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 13 Sep 2012 00:12:14 +0200 Subject: [PATCH] debugger compiles again --- lib/system/debugger.nim | 7 +++++-- tests/patterns/tor.nim | 3 ++- tests/run/utemplates.nim | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/system/debugger.nim b/lib/system/debugger.nim index ca60b04057..37995d919b 100755 --- a/lib/system/debugger.nim +++ b/lib/system/debugger.nim @@ -99,10 +99,13 @@ proc findBreakpoint(name: TStaticStr): int = if name == dbgBP[i].name: return i return -1 +proc write(f: TFile, s: TStaticStr) = + write(f, cstring(s.data)) + proc ListBreakPoints() = write(stdout, "*** endb| Breakpoints:\n") for i in 0 .. dbgBPlen-1: - write(stdout, dbgBP[i].name.data) + write(stdout, dbgBP[i].name) write(stdout, ": ") write(stdout, abs(dbgBP[i].low)) write(stdout, "..") @@ -508,7 +511,7 @@ proc checkForBreakpoint() = let i = dbgBreakpointReached(framePtr.line) if i >= 0: write(stdout, "*** endb| reached ") - write(stdout, dbgBP[i].name.data) + write(stdout, dbgBP[i].name) write(stdout, " in ") write(stdout, framePtr.filename) write(stdout, "(") diff --git a/tests/patterns/tor.nim b/tests/patterns/tor.nim index 92ef969254..7de1a7fa16 100644 --- a/tests/patterns/tor.nim +++ b/tests/patterns/tor.nim @@ -1,5 +1,6 @@ discard """ - output: "110" + output: '''110 +true''' """ template arithOps: expr = (`+` | `-` | `*`) diff --git a/tests/run/utemplates.nim b/tests/run/utemplates.nim index 8fd3d242a6..68fbb23a64 100644 --- a/tests/run/utemplates.nim +++ b/tests/run/utemplates.nim @@ -21,7 +21,7 @@ test "templates can be redefined multiple times": template customAssert(cond: bool, msg: string): stmt = if not cond: fail(msg) - template assertion_failed(body: stmt) = + template assertion_failed(body: stmt) {.immediate.} = template fail(msg: string): stmt = body assertion_failed: check msg == "first fail path"