diff options
-rw-r--r-- | compiler/astalgo.nim | 12 | ||||
-rw-r--r-- | compiler/msgs.nim | 4 | ||||
-rw-r--r-- | koch.nim | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 0afe56bb7..df0c06bcc 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -27,9 +27,9 @@ proc lineInfoToStr*(conf: ConfigRef; info: TLineInfo): Rope when declared(echo): # these are for debugging only: They are not really deprecated, but I want # the warning so that release versions do not contain debugging statements: - proc debug*(conf: ConfigRef; n: PSym) {.deprecated.} - proc debug*(conf: ConfigRef; n: PType) {.deprecated.} - proc debug*(conf: ConfigRef; n: PNode) {.deprecated.} + proc debug*(n: PSym; conf: ConfigRef = nil) {.deprecated.} + proc debug*(n: PType; conf: ConfigRef = nil) {.deprecated.} + proc debug*(n: PNode; conf: ConfigRef = nil) {.deprecated.} template mdbg*: bool {.dirty.} = when compiles(c.module): @@ -409,7 +409,7 @@ proc debugTree(conf: ConfigRef; n: PNode, indent: int, maxRecDepth: int; addf(result, "$N$1}", [rspaces(indent)]) when declared(echo): - proc debug(conf: ConfigRef; n: PSym) = + proc debug(n: PSym; conf: ConfigRef) = if n == nil: echo("null") elif n.kind == skUnknown: @@ -420,10 +420,10 @@ when declared(echo): n.name.s, $n.id, $flagsToStr(n.flags), $flagsToStr(n.loc.flags), $lineInfoToStr(conf, n.info), $n.kind]) - proc debug(conf: ConfigRef; n: PType) = + proc debug(n: PType; conf: ConfigRef) = echo($debugType(conf, n)) - proc debug(conf: ConfigRef; n: PNode) = + proc debug(n: PNode; conf: ConfigRef) = echo($debugTree(conf, n, 0, 100)) proc nextTry(h, maxHash: Hash): Hash = diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 62948e81e..be2ece911 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -155,10 +155,10 @@ proc getInfoContext*(conf: ConfigRef; index: int): TLineInfo = else: result = conf.m.msgContext[i] template toFilename*(conf: ConfigRef; fileIdx: FileIndex): string = - (if fileIdx.int32 < 0: "???" else: conf.m.fileInfos[fileIdx.int32].projPath) + (if fileIdx.int32 < 0 or conf == nil: "???" else: conf.m.fileInfos[fileIdx.int32].projPath) proc toFullPath*(conf: ConfigRef; fileIdx: FileIndex): string = - if fileIdx.int32 < 0: result = "???" + if fileIdx.int32 < 0 or conf == nil: result = "???" else: result = conf.m.fileInfos[fileIdx.int32].fullPath proc setDirtyFile*(conf: ConfigRef; fileIdx: FileIndex; filename: string) = diff --git a/koch.nim b/koch.nim index 97e1da776..dd451008c 100644 --- a/koch.nim +++ b/koch.nim @@ -470,7 +470,7 @@ proc temp(args: string) = # commit. let (bootArgs, programArgs) = splitArgs(args) let nimexec = findNim() - exec(nimexec & " c -d:debug " & bootArgs & " compiler" / "nim", 125) + exec(nimexec & " c --debugger:native " & bootArgs & " compiler" / "nim", 125) copyExe(output, finalDest) if programArgs.len > 0: exec(finalDest & " " & programArgs) |