-
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
DebugInfoBuilder for sequence point v2 #1237
Conversation
18a6f6a
to
70d0c0d
Compare
If seq v2 uses array instead of object, NEED CHANGES |
I think we can use object, if optimized: false, and if optimized:true it can be an array |
OK I can handle it |
70d0c0d
to
0da50fd
Compare
6edaed7
to
03be87e
Compare
03be87e
to
958ea18
Compare
@@ -304,7 +304,7 @@ public JObject CreateDebugInformation(string folder = "") | |||
// Create sequence-points-v2 | |||
|
|||
var v2 = new JObject(); | |||
v2["optimization"] = CompilationOptions.OptimizationType.None.ToString().ToLowerInvariant(); | |||
v2["optimization"] = this.Options.Optimize.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.
If the method was not optimized, it will be good to avoid the change, maybe some methods are not optimized
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.
Generally it can be expensive to check whether a method is optimized or not. I need to visit all the Instructions that may be covered by the method.
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.
If we check the previous sequencePoints with the current one and are different, it was optimized, isn't it?
parsedMethod.Offset = abiMethod.Offset; // It can be optimized, we avoid to check the offset | ||
if (!parsedMethod.Equals(abiMethod)) continue; | ||
|
||
if (method["abi"] is JObject && int.Parse(method["abi"]!["offset"]!.AsString()) == abiMethod.Offset) |
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 prefer to use the parsed version, with offset
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.
Shall I revert this? I do not really understand what to do here.
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.
Yes, only removing the offset = line should work
else | ||
newSequencePointsV2[writeAddr] = ((JArray)newSequencePointsV2[writeAddr]!).Concat(oldContentArray).ToArray(); | ||
} | ||
method["sequence-points-v2"] = newSequencePointsV2; |
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.
if there is only one entry it should be good to preserve the object, also, in what cases will be more (inline methods?)? it was checked that if it's the same information, don't duplicate it?
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.
if there is only one entry it should be good to preserve the object, also, in what cases will be more (inline methods?)? it was checked that if it's the same information, don't duplicate it?
For example, mutiple RET instructions may be compressed to 1 RET.
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.
if there is only one entry it should be good to preserve the object, also, in what cases will be more (inline methods?)? it was checked that if it's the same information, don't duplicate it?
Something like JToken.DeepEquals
comparer is needed for a HashSet, if we need to eliminate the duplicates. Not easy.
5d3cc60
to
d21e07f
Compare
d21e07f
to
ffadde2
Compare
* Compiler info * don't change logic * use sequence-points-v2 * Optimization * Fix dissasembler * Use abi * clean * Optimization type * Use debug type * Remove V1 method detection, doesn't work without abi * rename * use TryParse * Fix artifact * Fix artifacts with Abi identification * DebugInfoBuilder for sequence point v2 (#1237) * DebugInfoBuilder for sequence point v2 * v2["optimization"] * handle method["abi"]["offset"] in debugInfo * apply code review * Fix merge * Fix merge --------- Co-authored-by: Hecate2 <[email protected]>
For #1235 (review) . Not used for master, but for PR 1235.
(But works for master as well)