Turn stack trace printing into hintStackTrace

So stack trace printing can be explicitly enabled by --hint[StackTrace]:on.
This commit is contained in:
Adam Strzelecki 2015-06-06 11:38:38 +02:00
commit c009aadc74

View file

@ -127,7 +127,7 @@ type
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath, hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
hintConditionAlwaysTrue, hintName, hintPattern, hintConditionAlwaysTrue, hintName, hintPattern,
hintExecuting, hintLinking, hintDependency, hintExecuting, hintLinking, hintDependency,
hintSource, hintSource, hintStackTrace,
hintUser hintUser
const const
@ -422,6 +422,7 @@ const
hintLinking: "", hintLinking: "",
hintDependency: "$1", hintDependency: "$1",
hintSource: "$1", hintSource: "$1",
hintStackTrace: "$1",
hintUser: "$1"] hintUser: "$1"]
const const
@ -437,11 +438,11 @@ const
"ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit", "ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
"GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"] "GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
HintsToStr*: array[0..20, string] = ["Success", "SuccessX", "LineTooLong", HintsToStr*: array[0..21, string] = ["Success", "SuccessX", "LineTooLong",
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded", "XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf", "ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency", "Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
"Source", "Source", "StackTrace",
"User"] "User"]
const const
@ -502,15 +503,15 @@ const
hintDependency, hintDependency,
hintExecuting, hintLinking, hintExecuting, hintLinking,
hintCodeBegin, hintCodeEnd, hintCodeBegin, hintCodeEnd,
hintSource}, hintSource, hintStackTrace},
{low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit, {low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
warnProveField, warnProveIndex, warnProveField, warnProveIndex,
warnGcUnsafe, warnGcUnsafe,
hintDependency, hintDependency,
hintExecuting, hintExecuting,
hintCodeBegin, hintCodeEnd, hintCodeBegin, hintCodeEnd,
hintSource}, hintSource, hintStackTrace},
{low(TNoteKind)..high(TNoteKind)}, {low(TNoteKind)..high(TNoteKind)} - {hintStackTrace},
{low(TNoteKind)..high(TNoteKind)}] {low(TNoteKind)..high(TNoteKind)}]
const const
@ -787,7 +788,7 @@ type
proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) = proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) =
template quit = template quit =
if defined(debug) or gVerbosity >= 3 or msg == errInternal: if defined(debug) or msg == errInternal or hintStackTrace in gNotes:
if stackTraceAvailable() and isNil(writelnHook): if stackTraceAvailable() and isNil(writelnHook):
writeStackTrace() writeStackTrace()
else: else: