adds --excessiveStackTrace:on|off flag for nim
display absolute file path in error messages.
This commit is contained in:
parent
78b5f64166
commit
6c8b06b2a3
3 changed files with 10 additions and 1 deletions
|
|
@ -409,6 +409,7 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
|
||||||
if processOnOffSwitchOrList({optHints}, arg, pass, info): listHints()
|
if processOnOffSwitchOrList({optHints}, arg, pass, info): listHints()
|
||||||
of "threadanalysis": processOnOffSwitchG({optThreadAnalysis}, arg, pass, info)
|
of "threadanalysis": processOnOffSwitchG({optThreadAnalysis}, arg, pass, info)
|
||||||
of "stacktrace": processOnOffSwitch({optStackTrace}, arg, pass, info)
|
of "stacktrace": processOnOffSwitch({optStackTrace}, arg, pass, info)
|
||||||
|
of "excessivestacktrace": processOnOffSwitchG({optExcessiveStackTrace}, arg, pass, info)
|
||||||
of "linetrace": processOnOffSwitch({optLineTrace}, arg, pass, info)
|
of "linetrace": processOnOffSwitch({optLineTrace}, arg, pass, info)
|
||||||
of "debugger":
|
of "debugger":
|
||||||
case arg.normalize
|
case arg.normalize
|
||||||
|
|
|
||||||
|
|
@ -471,6 +471,8 @@ type
|
||||||
shortName*: string # short name of the module
|
shortName*: string # short name of the module
|
||||||
quotedName*: Rope # cached quoted short name for codegen
|
quotedName*: Rope # cached quoted short name for codegen
|
||||||
# purposes
|
# purposes
|
||||||
|
quotedFullName*: Rope # cached quoted full name for codegen
|
||||||
|
# purposes
|
||||||
|
|
||||||
lines*: seq[Rope] # the source code of the module
|
lines*: seq[Rope] # the source code of the module
|
||||||
# used for better error messages and
|
# used for better error messages and
|
||||||
|
|
@ -563,6 +565,7 @@ proc newFileInfo(fullPath, projPath: string): TFileInfo =
|
||||||
let fileName = projPath.extractFilename
|
let fileName = projPath.extractFilename
|
||||||
result.shortName = fileName.changeFileExt("")
|
result.shortName = fileName.changeFileExt("")
|
||||||
result.quotedName = fileName.makeCString
|
result.quotedName = fileName.makeCString
|
||||||
|
result.quotedFullName = fullPath.makeCString
|
||||||
if optEmbedOrigSrc in gGlobalOptions or true:
|
if optEmbedOrigSrc in gGlobalOptions or true:
|
||||||
result.lines = @[]
|
result.lines = @[]
|
||||||
|
|
||||||
|
|
@ -1024,6 +1027,9 @@ proc sourceLine*(i: TLineInfo): Rope =
|
||||||
|
|
||||||
proc quotedFilename*(i: TLineInfo): Rope =
|
proc quotedFilename*(i: TLineInfo): Rope =
|
||||||
internalAssert i.fileIndex >= 0
|
internalAssert i.fileIndex >= 0
|
||||||
|
if optExcessiveStackTrace in gGlobalOptions:
|
||||||
|
result = fileInfos[i.fileIndex].quotedFullName
|
||||||
|
else:
|
||||||
result = fileInfos[i.fileIndex].quotedName
|
result = fileInfos[i.fileIndex].quotedName
|
||||||
|
|
||||||
ropes.errorHandler = proc (err: RopesError, msg: string, useWarning: bool) =
|
ropes.errorHandler = proc (err: RopesError, msg: string, useWarning: bool) =
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ type # please make sure we have under 32 options
|
||||||
optIdeDebug # idetools: debug mode
|
optIdeDebug # idetools: debug mode
|
||||||
optIdeTerse # idetools: use terse descriptions
|
optIdeTerse # idetools: use terse descriptions
|
||||||
optNoCppExceptions # use C exception handling even with CPP
|
optNoCppExceptions # use C exception handling even with CPP
|
||||||
|
optExcessiveStackTrace # fully qualified module filenames
|
||||||
|
|
||||||
TGlobalOptions* = set[TGlobalOption]
|
TGlobalOptions* = set[TGlobalOption]
|
||||||
TCommands* = enum # Nim's commands
|
TCommands* = enum # Nim's commands
|
||||||
# **keep binary compatible**
|
# **keep binary compatible**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue