stacktraces can now show custom runtime msgs per frame (#13351)

* stacktraces can now show custom runtime msgs
* improve tests/stdlib/tstackframes.nim
* fix test for --gc:arc
* test --stacktraceMsgs:on and --stacktraceMsgs:off
* --stacktracemsgs:off by default
This commit is contained in:
Timothee Cour 2020-03-30 04:45:32 -07:00 • committed by GitHub
commit 19cab9fa51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 171 additions and 21 deletions

View file

@ -10,6 +10,9 @@
# this module does the semantic checking for expressions
# included from sem.nim
when defined(nimCompilerStackraceHints):
import std/stackframes
const
errExprXHasNoType = "expression '$1' has no type (or is ambiguous)"
errXExpectsTypeOrValue = "'$1' expects a type or value"
@ -2557,6 +2560,8 @@ proc shouldBeBracketExpr(n: PNode): bool =
return true
proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
when defined(nimCompilerStackraceHints):
setFrameMsg c.config$n.info & " " & $n.kind
result = n
if c.config.cmd == cmdIdeTools: suggestExpr(c, n)
if nfSem in n.flags: return