-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler source info into DebugInfo
#1235
base: master
Are you sure you want to change the base?
Conversation
DebugInfo
src/Neo.Compiler.CSharp/CompilationEngine/CompilationContext.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need to modify sequence v2 in my optimizer, inneo-devpack-dotnet/src/Neo.Compiler.CSharp/Optimizer/AssetBuilder/DebugInfoBuilder.cs
And there is a problem that, after optimization, a single Instruction may come from multiple different lines of contract source codes, and seq v2 using key-value is unable to represent them. Yet this will not be a problem for my debuggers or optimizers. |
I will change it to an array |
Hey, how about NEP-19? We have a number of compilers and we can't do these changes that easy. And I'm still not sure what's the real problem we're trying to solve, looks like this data is purely an internal compiler thing. I'd not expect it to be a part of the debug info since the details of codegenerator are not really relevant there and compiler should be debugged in some other way. It can be a separate info file if really needed, but debug info is expected to be NEP-19-compliant unless we have any real reasons to change that standard. |
Is full compatible with previous version, just more information inside the json for easily trace the compiler |
Yeah, it's an extension, but every tool that expects a proper NEP-19 document can fail with it. Every developer that see it has to guess what this all is about (NEP-19 things are documented). To me it's either we have and follow some standards or not. |
If you strictly follow NEP 17, couldn't you add other methods beyond the standard? |
src/Neo.Compiler.CSharp/CompilationEngine/CompilationContext.cs
Outdated
Show resolved
Hide resolved
/// Script: DAtUb2tlblN5bWJvbEA= | ||
/// 00 : OpCode.PUSHDATA1 546F6B656E53796D626F6C [8 datoshi] | ||
/// 0D : OpCode.RET [0 datoshi] | ||
/// </remarks> | ||
[DisplayName("symbol")] | ||
public abstract string? Symbol(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed with the Abi
export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't relate the DebugInfo to the ABI, so, this information will only work with others compilers if they attach the abi information to the NEP19 file
// Create sequence-points-v2 | ||
|
||
var v2 = new JObject(); | ||
v2["optimization"] = CompilationOptions.OptimizationType.None.ToString().ToLowerInvariant(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: it will require a change in the optimization later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Value of ["optimization"] is not changed in optimization.
...ate.UnitTests/templates/neocontractnep17/TestingArtifacts/Nep17ContractTemplate.artifacts.cs
Show resolved
Hide resolved
#1237 ready for merge |
Alternative to #1229
Related to neo-project/proposals#184
Require #1240
This introduce a new property,
sequence-points-v2
, inside the method in debugInfo:sequence-points remains as before, not changed:
sequence-points-v2
was included in json format, with more information:Note: My bad, it was pushed to main and already reverted...