Skip to content

Comments

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

Merged
thaystg merged 9 commits intodotnet: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 intodotnet:mainfrom
thaystg:thays_remove_runtime_ready_message

Conversation

@thaystg
Copy link
Member

@thaystg thaystg commented Jul 25, 2022

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

@ghost ghost added the area-Debugger-mono label Jul 25, 2022
@ghost ghost assigned thaystg Jul 25, 2022
@ghost
Copy link

ghost commented Jul 25, 2022

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: -

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 owner July 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
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
Member

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

ghost commented Jul 28, 2022

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
Member

radical commented Jul 28, 2022

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.

<script type='text/javascript'>
var App = {
init: function () {
console.debug ("mono_wasm_runtime_ready", "fe00e07a-5519-4dfe-b35a-f867dbaf2e28");
Copy link
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
Member Author

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.

@lewing lewing added this to the 8.0.0 milestone Aug 15, 2022
@thaystg
Copy link
Member Author

thaystg commented Jan 4, 2023

/azp run runtime-wasm-non-libtests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member

pavelsavara commented Jan 5, 2023

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
Member

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

public const string RUNTIME_IS_READY = "mono_wasm_runtime_ready";
public const string RUNTIME_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
string loaded = a[2]?["value"]?.ToString();
if (loaded != null)
context.LoadedFiles = JToken.Parse(loaded).ToObject<string[]>();
}
catch (InvalidCastException ice)
{
Log("verbose", ice.ToString());
}
}
await RuntimeReady(sessionId, token);
}

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

@thaystg
Copy link
Member Author

thaystg commented Jan 6, 2023

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

public const string RUNTIME_IS_READY = "mono_wasm_runtime_ready";
public const string RUNTIME_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
string loaded = a[2]?["value"]?.ToString();
if (loaded != null)
context.LoadedFiles = JToken.Parse(loaded).ToObject<string[]>();
}
catch (InvalidCastException ice)
{
Log("verbose", ice.ToString());
}
}
await RuntimeReady(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
Member Author

thaystg commented Jan 6, 2023

/azp run runtime-wasm-non-libtests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@thaystg thaystg requested review from lewing and pavelsavara January 6, 2023 18:32
Copy link
Member

@pavelsavara pavelsavara left a comment

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
Member Author

thaystg commented Jan 9, 2023

I guess you tested it manually too?

Yes, I did :)

@thaystg
Copy link
Member Author

thaystg commented Jan 9, 2023

@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
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

Copy link
Member

@ilonatommy ilonatommy left a comment

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
Member Author

thaystg commented Jan 9, 2023

/azp run runtime-wasm-non-libtests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

arch-wasm WebAssembly architecture area-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