-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm][debugger] Avoiding assert on mono runtime #62601
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -530,7 +530,7 @@ internal class AssemblyInfo | |
| internal MetadataReader asmMetadataReader { get; } | ||
| internal MetadataReader pdbMetadataReader { get; set; } | ||
| internal List<MetadataReader> enCMetadataReader = new List<MetadataReader>(); | ||
| public int DebugId { get; set; } | ||
| private int debugId; | ||
| internal int PdbAge { get; } | ||
| internal System.Guid PdbGuid { get; } | ||
| internal string PdbName { get; } | ||
|
|
@@ -539,6 +539,7 @@ internal class AssemblyInfo | |
|
|
||
| public unsafe AssemblyInfo(MonoProxy monoProxy, SessionId sessionId, string url, byte[] assembly, byte[] pdb, CancellationToken token) | ||
| { | ||
| debugId = -1; | ||
| this.id = Interlocked.Increment(ref next_id); | ||
| using var asmStream = new MemoryStream(assembly); | ||
| peReader = new PEReader(asmStream); | ||
|
|
@@ -579,6 +580,19 @@ public unsafe AssemblyInfo(MonoProxy monoProxy, SessionId sessionId, string url, | |
| Populate(); | ||
| } | ||
|
|
||
| public async Task<int> DebugId(MonoSDBHelper sdbAgent, CancellationToken token) | ||
| { | ||
| if (debugId != -1) | ||
| return debugId; | ||
| debugId = await sdbAgent.GetAssemblyId(Name, token); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it make sense to throw here if
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean after
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will do it, but in my backport version of this PR I will not add the throw to avoid any side effect on net6, does it make sense?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I changed my mind, I don't think we will get any side effect on net 6, because this is called from FindStaticTypeId and this has a try catch in the caller. |
||
| return debugId; | ||
| } | ||
|
|
||
| public void SetDebugId(int id) | ||
| { | ||
| debugId = id; | ||
|
||
| } | ||
|
|
||
| public bool EnC(byte[] meta, byte[] pdb) | ||
| { | ||
| var asmStream = new MemoryStream(meta); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -855,6 +855,16 @@ await RuntimeEvaluateAndCheck( | |
| ("\"15\"", TString("15"))); | ||
| }); | ||
|
|
||
| [Fact] | ||
| public async Task EvaluateStaticAttributeInAssemblyNotRelatedButLoaded() => await CheckInspectLocalsAtBreakpointSite( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ideas: Maybe add another test that tries to test the same thing, but by enumerating members of a local, or a field? |
||
| "DebuggerTests.EvaluateTestsClass", "EvaluateLocals", 9, "EvaluateLocals", | ||
| "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", | ||
| wait_for_event_fn: async (pause_location) => | ||
| { | ||
| await RuntimeEvaluateAndCheck( | ||
| ("ClassToBreak.valueToCheck", TNumber(10))); | ||
| }); | ||
|
|
||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,5 +8,6 @@ public static int TestBreakpoint() | |
| { | ||
| return 50; | ||
| } | ||
| public static int valueToCheck = 10; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.