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:
parent
8088633250
commit
19cab9fa51
14 changed files with 171 additions and 21 deletions
|
|
@ -1,3 +1,7 @@
|
|||
const NimStackTraceMsgs =
|
||||
when defined(nimHasStacktraceMsgs): compileOption("stacktraceMsgs")
|
||||
else: false
|
||||
|
||||
type
|
||||
RootEffect* {.compilerproc.} = object of RootObj ## \
|
||||
## Base effect class.
|
||||
|
|
@ -16,6 +20,11 @@ type
|
|||
procname*: cstring ## Name of the proc that is currently executing.
|
||||
line*: int ## Line number of the proc that is currently executing.
|
||||
filename*: cstring ## Filename of the proc that is currently executing.
|
||||
when NimStackTraceMsgs:
|
||||
frameMsg*: string ## When a stacktrace is generated in a given frame and
|
||||
## rendered at a later time, we should ensure the stacktrace
|
||||
## data isn't invalidated; any pointer into PFrame is
|
||||
## subject to being invalidated so shouldn't be stored.
|
||||
|
||||
Exception* {.compilerproc, magic: "Exception".} = object of RootObj ## \
|
||||
## Base exception class.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue