Skip to content

[wasm][debugger] Removing console.debug message helper to make debugger work. - #72812

Merged
thaystg merged 9 commits into
dotnet:mainfrom
thaystg:thays_remove_runtime_ready_message
Jan 10, 2023
Merged

[wasm][debugger] Removing console.debug message helper to make debugger work.#72812
thaystg merged 9 commits into
dotnet:mainfrom
thaystg:thays_remove_runtime_ready_message

Conversation

@thaystg

@thaystgthaystg commented Jul 25, 2022

Copy link
Copy Markdown
Member

For debugging on chrome it was already unused, if we just remove the message and don't change anything else the debugging continues working, using chrome as ide, using visual studio and also visual studio code.
On firefox it was using the message, but I changed to have the same behavior that has for chrome.
For the debugger tests I created a new message named DotnetDebugger.runTests which will be called when the page is ready to start running the tests.

also:

  • renaming wrong file name for firefox
  • fix pause in a breakpoint on firefox

Fixes#63703

@ghostghost assigned thaystgJul 25, 2022
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

For debugging on chrome it was already unused, if we just remove the message and don't change anything else the debugging continues working, using chrome as ide, using visual studio and also visual studio code.
On firefox it was using the message, but I changed to have the same behavior that has for chrome.
For the debugger tests I printed the expected message in the html files as we don't really have an IDE, to receive the equivalent messages and check if runtime is ready.

also:

  • renaming wrong file name for firefox
  • fix pause in a breakpoint on firefox
Author:thaystg
Assignees:-
Labels:

area-Debugger-mono

Milestone:-

Comment threadsrc/mono/wasm/debugger/tests/debugger-test/debugger-driver.html Outdated
Comment threadsrc/mono/wasm/runtime/debug.ts Outdated
Co-authored-by: Larry Ewing <lewing@microsoft.com>
@thaystg
thaystg marked this pull request as ready for review July 26, 2022 19:56
@thaystg
thaystg requested a review from radical as a code ownerJuly 26, 2022 19:56
ctx.GlobalName = args["target"]["actor"].Value<string>();
ctx.ThreadName = args["target"]["threadActor"].Value<string>();
ResetCmdId();
if (await IsRuntimeAlreadyReadyAlready(sessionId, token))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funny name IsRuntimeAlreadyReadyAlready :-D

@pavelsavara

Copy link
Copy Markdown
Member

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radicalradical added the arch-wasm WebAssembly architecture label Jul 28, 2022
@radicalradical added this to the 7.0.0 milestone Jul 28, 2022
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

For debugging on chrome it was already unused, if we just remove the message and don't change anything else the debugging continues working, using chrome as ide, using visual studio and also visual studio code.
On firefox it was using the message, but I changed to have the same behavior that has for chrome.
For the debugger tests I printed the expected message in the html files as we don't really have an IDE, to receive the equivalent messages and check if runtime is ready.

also:

  • renaming wrong file name for firefox
  • fix pause in a breakpoint on firefox

Fixes #63703

Author:thaystg
Assignees:thaystg
Labels:

arch-wasm, area-Debugger-mono

Milestone:-

@radical

Copy link
Copy Markdown
Member

just fyi, runtime-wasm isn't needed for debugger tests specifically. This is because the debugger tests job is triggered by any changes in src/mono/wasm/debugger. But if you have changes anywhere else for which you want to run debugger-tests, then runtime-wasm could be useful.

@thaystgthaystg removed this from the 7.0.0 milestone Aug 12, 2022
<script type='text/javascript'>
var App = {
init: function () {
console.debug ("mono_wasm_runtime_ready", "fe00e07a-5519-4dfe-b35a-f867dbaf2e28");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is something depending on this behavior? if so we should fix it?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The firefox debugger tests.
But @radical changed other things and now this PR is old, I need to merge main and also I'm planning to fix this:
#73651 in the same PR, then we can totally remove this message probably.

@lewinglewing added this to the 8.0.0 milestone Aug 15, 2022
@thaystg

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jan 5, 2023

Copy link
Copy Markdown
Member

Could you also please delete

console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28

and

mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28

@pavelsavara

Copy link
Copy Markdown
Member

If we are no longer sending that message, could we also delete

publicconststringRUNTIME_IS_READY="mono_wasm_runtime_ready";
publicconststringRUNTIME_IS_READY_ID="fe00e07a-5519-4dfe-b35a-f867dbaf2e28";

And

if(aCount>=2&&
a[0]?["value"]?.ToString()==MonoConstants.RUNTIME_IS_READY&&
a[1]?["value"]?.ToString()==MonoConstants.RUNTIME_IS_READY_ID)
{
if(aCount>2)
{
try
{
// The optional 3rd argument is the stringified assembly
// list so that we don't have to make more round trips
stringloaded=a[2]?["value"]?.ToString();
if(loaded!=null)
context.LoadedFiles=JToken.Parse(loaded).ToObject<string[]>();
}
catch(InvalidCastExceptionice)
{
Log("verbose",ice.ToString());
}
}
awaitRuntimeReady(sessionId,token);
}

I'm bit confused about if it's possible.

@thaystg

Copy link
Copy Markdown
MemberAuthor

If we are no longer sending that message, could we also delete

publicconststringRUNTIME_IS_READY="mono_wasm_runtime_ready";
publicconststringRUNTIME_IS_READY_ID="fe00e07a-5519-4dfe-b35a-f867dbaf2e28";

And

if(aCount>=2&&
a[0]?["value"]?.ToString()==MonoConstants.RUNTIME_IS_READY&&
a[1]?["value"]?.ToString()==MonoConstants.RUNTIME_IS_READY_ID)
{
if(aCount>2)
{
try
{
// The optional 3rd argument is the stringified assembly
// list so that we don't have to make more round trips
stringloaded=a[2]?["value"]?.ToString();
if(loaded!=null)
context.LoadedFiles=JToken.Parse(loaded).ToObject<string[]>();
}
catch(InvalidCastExceptionice)
{
Log("verbose",ice.ToString());
}
}
awaitRuntimeReady(sessionId,token);
}

I'm bit confused about if it's possible.

After your comment I tried another approach which is completely removing the message. :)

@thaystg

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavarapavelsavara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you tested it manually too?

@thaystg

Copy link
Copy Markdown
MemberAuthor

I guess you tested it manually too?

Yes, I did :)

@thaystg

Copy link
Copy Markdown
MemberAuthor

@ilonatommy can you double check if I didn't break anything, please? Test it on blazor using VS, using VSCode and using ctrl-shift-d from chrome?

@ilonatommy

Copy link
Copy Markdown
Member

@ilonatommy can you double check if I didn't break anything, please? Test it on blazor using VS, using VSCode and using ctrl-shift-d from chrome?

Working. Checked:

  • VS debugger
  • VS Code
  • Chrome Dev tools

Comment threadsrc/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs Outdated

@ilonatommyilonatommy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cool!

@thaystg

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm-non-libtests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@thaystg
thaystg merged commit 8a2b72e into dotnet:mainJan 10, 2023
@ghostghost locked as resolved and limited conversation to collaborators Feb 9, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-Debugger-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] Do not print mono_wasm_runtime_ready to console

5 participants

@thaystg@pavelsavara@radical@ilonatommy@lewing