summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-06-06 11:38:38 +0200
committerAdam Strzelecki <ono@java.pl>2015-07-03 14:05:00 +0200
commitc009aadc74f6ad778a15afda47a4aa635b52921a (patch)
tree4e76f7adb719ce87be14f5f89287f9ca30793e54
parentd568ac335751d9caa6dd6118a13b1ee856d402e3 (diff)
downloadNim-c009aadc74f6ad778a15afda47a4aa635b52921a.tar.gz
Turn stack trace printing into hintStackTrace
So stack trace printing can be explicitly enabled by --hint[StackTrace]:on.
-rw-r--r--compiler/msgs.nim15
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 175434c83..11351ac03 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -127,7 +127,7 @@ type
     hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
     hintConditionAlwaysTrue, hintName, hintPattern,
     hintExecuting, hintLinking, hintDependency,
-    hintSource,
+    hintSource, hintStackTrace,
     hintUser
 
 const
@@ -422,6 +422,7 @@ const
     hintLinking: "",
     hintDependency: "$1",
     hintSource: "$1",
+    hintStackTrace: "$1",
     hintUser: "$1"]
 
 const
@@ -437,11 +438,11 @@ const
     "ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
     "GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
 
-  HintsToStr*: array[0..20, string] = ["Success", "SuccessX", "LineTooLong",
+  HintsToStr*: array[0..21, string] = ["Success", "SuccessX", "LineTooLong",
     "XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
     "ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
     "Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
-    "Source",
+    "Source", "StackTrace",
     "User"]
 
 const
@@ -502,15 +503,15 @@ const
                                          hintDependency,
                                          hintExecuting, hintLinking,
                                          hintCodeBegin, hintCodeEnd,
-                                         hintSource},
+                                         hintSource, hintStackTrace},
     {low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
                                          warnProveField, warnProveIndex,
                                          warnGcUnsafe,
                                          hintDependency,
                                          hintExecuting,
                                          hintCodeBegin, hintCodeEnd,
-                                         hintSource},
-    {low(TNoteKind)..high(TNoteKind)},
+                                         hintSource, hintStackTrace},
+    {low(TNoteKind)..high(TNoteKind)} - {hintStackTrace},
     {low(TNoteKind)..high(TNoteKind)}]
 
 const
@@ -787,7 +788,7 @@ type
 
 proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) =
   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):
         writeStackTrace()
       else: