Debugging quality-of-life improvements (#810)

* Debugging quality-of-life improvements

- Use std::abort for `CHECK`/`FATAL` failures, which acts as a debugger breakpoint as well as automatically printing a stack trace.
- Re-enable printing continuations in `--trace` mode.
- Log the source location of each step in `--trace` mode.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
Geoff Romer
2021-09-08 09:25:16 -07:00
committed by GitHub
co-authored by Jon Meow
parent f931a8cead
commit 33dd9a873d
5 changed files with 56 additions and 60 deletions
+9 -4
View File
@@ -9,6 +9,7 @@
#include "common/check.h"
#include "executable_semantics/common/arena.h"
#include "executable_semantics/common/error.h"
#include "executable_semantics/interpreter/frame.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
@@ -232,11 +233,15 @@ void Value::Print(llvm::raw_ostream& out) const {
case Value::Kind::VariableType:
out << cast<VariableType>(*this).Name();
break;
case Value::Kind::ContinuationValue:
out << "continuation";
// TODO: Find a way to print useful information about the continuation
// without creating a dependency cycle.
case Value::Kind::ContinuationValue: {
out << "{";
llvm::ListSeparator sep(" :: ");
for (Ptr<Frame> frame : cast<ContinuationValue>(*this).Stack()) {
out << sep << *frame;
}
out << "}";
break;
}
case Value::Kind::StringType:
out << "String";
break;