mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 22:02:41 +01:00
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:
committed by
GitHub
co-authored by
Jon Meow
parent
f931a8cead
commit
33dd9a873d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user