aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2016-02-06 18:01:45 +0100
committerodersky <odersky@gmail.com>2016-02-06 18:01:45 +0100
commitd0056132485c10e0e408668e177a8452c5112d3b (patch)
treeba4b08f71216dd9c18166db9060bfb9ab2eda871 /src/dotty/tools/dotc/core
parentffcc27baddb02f3c92e9d22ddfb56d0d30f277d8 (diff)
parentb33babc2398e5013820e21568713fdb6c15aa6fa (diff)
downloaddotty-d0056132485c10e0e408668e177a8452c5112d3b.tar.gz
dotty-d0056132485c10e0e408668e177a8452c5112d3b.tar.bz2
dotty-d0056132485c10e0e408668e177a8452c5112d3b.zip
Merge pull request #1057 from dotty-staging/fix/hide-stacktraces
Hide stack traces behind -Ydebug
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala2
-rw-r--r--src/dotty/tools/dotc/core/Denotations.scala2
-rw-r--r--src/dotty/tools/dotc/core/Types.scala2
-rw-r--r--src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index b205a40f0..9ccb03b89 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -255,7 +255,7 @@ object Contexts {
private var creationTrace: Array[StackTraceElement] = _
private def setCreationTrace() =
- if (this.settings.debug.value)
+ if (this.settings.YtraceContextCreation.value)
creationTrace = (new Throwable).getStackTrace().take(20)
/** Print all enclosing context's creation stacktraces */
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala
index 00ad90354..2af3f463d 100644
--- a/src/dotty/tools/dotc/core/Denotations.scala
+++ b/src/dotty/tools/dotc/core/Denotations.scala
@@ -465,7 +465,7 @@ object Denotations {
try info.signature
catch { // !!! DEBUG
case scala.util.control.NonFatal(ex) =>
- println(s"cannot take signature of ${info.show}")
+ ctx.println(s"cannot take signature of ${info.show}")
throw ex
}
case _ => Signature.NotAMethod
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index d76f57ba6..12c05b578 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -3387,7 +3387,7 @@ object Types {
class MissingType(pre: Type, name: Name)(implicit ctx: Context) extends TypeError(
i"""cannot resolve reference to type $pre.$name
|the classfile defining the type might be missing from the classpath${otherReason(pre)}""".stripMargin) {
- printStackTrace()
+ if (ctx.debug) printStackTrace()
}
private def otherReason(pre: Type)(implicit ctx: Context): String = pre match {
diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
index abf31a006..b1b229768 100644
--- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
+++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
@@ -188,7 +188,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
val ex = new BadSignature(
sm"""error reading Scala signature of $classRoot from $source:
|error occurred at position $readIndex: $msg""")
- /*if (debug)*/ original.getOrElse(ex).printStackTrace() // !!! DEBUG
+ if (ctx.debug) original.getOrElse(ex).printStackTrace()
throw ex
}
@@ -425,7 +425,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
owner.info.decls.checkConsistent()
if (slowSearch(name).exists)
System.err.println(i"**** slow search found: ${slowSearch(name)}")
- new Exception().printStackTrace()
+ if (ctx.debug) Thread.dumpStack()
ctx.newStubSymbol(owner, name, source)
}
}