hintMsgOrigin now works in VM code (#14678)
* `hintMsgOrigin` now works in VM code * remove a simplification for now
This commit is contained in:
parent
faedb14a16
commit
de5cde473a
2 changed files with 11 additions and 13 deletions
|
|
@ -72,20 +72,18 @@ proc stackTraceAux(c: PCtx; x: PStackFrame; pc: int; recursionLimit=100) =
|
|||
msgWriteln(c.config, s)
|
||||
|
||||
proc stackTraceImpl(c: PCtx, tos: PStackFrame, pc: int,
|
||||
msg: string, lineInfo: TLineInfo) =
|
||||
msg: string, lineInfo: TLineInfo, infoOrigin: InstantiationInfo) {.noinline.} =
|
||||
# noinline to avoid code bloat
|
||||
msgWriteln(c.config, "stack trace: (most recent call last)")
|
||||
stackTraceAux(c, tos, pc)
|
||||
# XXX test if we want 'globalError' for every mode
|
||||
if c.mode == emRepl: globalError(c.config, lineInfo, msg)
|
||||
else: localError(c.config, lineInfo, msg)
|
||||
let action = if c.mode == emRepl: doRaise else: doNothing
|
||||
# XXX test if we want 'globalError' for every mode
|
||||
let lineInfo = if lineInfo == TLineInfo.default: c.debug[pc] else: lineInfo
|
||||
liMessage(c.config, lineInfo, errGenerated, msg, action, infoOrigin)
|
||||
|
||||
template stackTrace(c: PCtx, tos: PStackFrame, pc: int,
|
||||
msg: string, lineInfo: TLineInfo) =
|
||||
stackTraceImpl(c, tos, pc, msg, lineInfo)
|
||||
return
|
||||
|
||||
template stackTrace(c: PCtx, tos: PStackFrame, pc: int, msg: string) =
|
||||
stackTraceImpl(c, tos, pc, msg, c.debug[pc])
|
||||
msg: string, lineInfo: TLineInfo = TLineInfo.default) =
|
||||
stackTraceImpl(c, tos, pc, msg, lineInfo, instantiationInfo(-2, fullPaths = true))
|
||||
return
|
||||
|
||||
proc bailOut(c: PCtx; tos: PStackFrame) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue