Commit e0af473c authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parser] Enhance debug prints: --print-scopes --print-ast

This makes it easier to match VariableProxys against variables in
Scopes (allocation-based prints such as local[0] or context[0] are not
unique).

R=vogelheim@chromium.org

Bug:

Change-Id: I8f86504f5e1657633286561e032805a8f6cff06e
Reviewed-on: https://chromium-review.googlesource.com/467486
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarDaniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44376}
parent 396f1e24
......@@ -620,8 +620,8 @@ void AstPrinter::PrintLiteralWithModeIndented(const char* info,
PrintLiteralIndented(info, value, true);
} else {
EmbeddedVector<char, 256> buf;
int pos =
SNPrintF(buf, "%s (mode = %s", info, VariableMode2String(var->mode()));
int pos = SNPrintF(buf, "%s (%p) (mode = %s", info, var,
VariableMode2String(var->mode()));
SNPrintF(buf + pos, ")");
PrintLiteralIndented(buf.start(), value, true);
}
......
......@@ -1624,7 +1624,7 @@ void PrintVar(int indent, Variable* var) {
PrintF(".%p", reinterpret_cast<void*>(var));
else
PrintName(var->raw_name());
PrintF("; // ");
PrintF("; // (%p) ", var);
PrintLocation(var);
bool comma = !var->IsUnallocated();
if (var->has_forced_context_allocation()) {
......@@ -1697,7 +1697,7 @@ void Scope::Print(int n) {
function = AsDeclarationScope()->function_var();
}
PrintF(" { // (%d, %d)\n", start_position(), end_position());
PrintF(" { // (%p) (%d, %d)\n", this, start_position(), end_position());
if (is_hidden()) {
Indent(n1, "// is hidden\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment