Skip to content

Commit

Permalink
Use new local symbol debug name support
Browse files Browse the repository at this point in the history
When we lower lexicals into locals, it makes them invisible to all that
uses the MoarVM debug server interface. This was already the case, but
became rather more serious of late, since we now lower many further
variables. With this change, we now record the mappings of registers
into debug names, which are on the MoarVM backend now passed along to
the VM for its use in debugging. Since we did lower some things prior to
this change, however, this not only keeps the debug experience from
getting worse with this release, but also makes it better than it was
before.
  • Loading branch information
jnthn committed Jan 29, 2019
1 parent ba78271 commit 6fe5377
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -808,8 +808,9 @@ my class BlockVarOptimizer {
}
}

# Stash the name we lowered it to.
# Stash the name we lowered it to, and add a debug mapping.
$block.symbol($name, :lowered($new_name));
$block.add_local_debug_mapping($new_name, $name);
}
}
}
Expand Down Expand Up @@ -3016,6 +3017,11 @@ class Perl6::Optimizer {
}
}

# Copy local debug name mappings.
for $block.local_debug_map {
$outer.add_local_debug_mapping($_.key, $_.value);
}

# Hand back the decls and statements that we're inlining.
return QAST::Stmts.new( |@copy_decls, $stmts );
}
Expand Down

0 comments on commit 6fe5377

Please sign in to comment.