Restore globals scope for 5.2 and above#92
Open
tmcgilchrist wants to merge 3 commits into
Open
Conversation
Since 5.2 the SYMB section of a bytecode executable numbers globals by Symtable.Global.t (compilation units and predefined exceptions) rather than by Ident.t. Marshal is untyped, so reading the table as an int Ident.Map.t kept working silently, the names still decode, but every key looks like a local ident rather than a persistent one, so the is_structure_module filter in Value_scope rejected all of them and the Globals scope came out empty. Eval.value_path could no longer resolve globals either. Read the table with the compiler's own key type on 5.2 and later, and map compunits back to persistent idents and predefs to predef idents, which is what the table held before 5.2. A future change to the representation is now a compile error rather than a silently empty scope.
The tests spawn the real adapter, launch a bytecode program over the debug adapter protocol, stop at a breakpoint and diff a transcript of what they find against a recorded file. test_scopes covers the Globals scope regression from hackwaly#74. test_frames stops inside a function and walks the call stack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #74
Stacked on top of #91