Skip to content

[debugger] Improve debug after hot reload #55869

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

Merged
merged 9 commits into from
Jul 29, 2021

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Jul 17, 2021

  • added new tests for wasm debugger after hot reload
  • fixing stepping behavior on android because it uses mono_ppdb_lookup_location function
  • refactoring mono_ppdb_get_seq_points_internal function to bahavior like the other ones implemented for debug after hot reload.
  • get document information from enc pdb.

@ghost ghost added the area-Debugger-mono label Jul 17, 2021
@ghost
Copy link

ghost commented Jul 17, 2021

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

Issue Details
  • added new tests for wasm debugger after hot reload
  • fixing stepping behavior on android because it uses mono_ppdb_lookup_location function
  • refactoring mono_ppdb_get_seq_points_internal function to bahavior like the other ones implemented for debug after hot reload.
Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

@thaystg thaystg requested review from lambdageek and lewing July 17, 2021 18:09
@thaystg thaystg marked this pull request as ready for review July 17, 2021 18:10
@thaystg thaystg removed request for marek-safar and vargaz July 17, 2021 18:11
@lewing lewing requested a review from vargaz July 19, 2021 18:48
@marek-safar
Copy link
Contributor

@vargaz could you please review this?

Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

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

Three potential issues:

  1. The leak in get_docinfo. This is the only one that I'm really worried about for .net6. the debugger can probably call get_docinfo a lot and without caching we'll leak pretty quickly.
  2. Minor nit: it's probably less error-prone to just store the row number (1-based) instead of an index (0-based) in MonoDebugInformationEnc. It would be nice to switch.
  3. in the future, I think the row check in mono_ppdb_get_seq_points_internal will be wrong. but I don't think it's a problem right now as long as we're only doing updates, not adding new methods.

But overall I think this looks good.

Comment on lines +506 to +508
if (G_UNLIKELY (method_idx - 1 >= table_info_get_rows (methodbody_table))) {
char *method_name = mono_method_full_name (method, FALSE);
g_error ("Method idx %d is greater than number of rows (%d) in PPDB MethodDebugInformation table, for method %s in '%s'. Likely a malformed PDB file.",
Copy link
Member

Choose a reason for hiding this comment

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

I think right now this is ok since we only have hot reload method body updates - we can't add new methods. But in the future this probably won't work right.

I think this check should be moved up to the (non-EnC) caller, or dropped entirely (or dropped if we have any updates).

thaystg added 2 commits July 28, 2021 10:31
…bug_tests

* origin/main: (274 commits)
  Disable test ConnectWithCertificateForDifferentName_Throws (dotnet#56456)
  Update dependencies from https://github.com/mono/linker build 20210726.2 (dotnet#56374)
  Cleanup disabled test conditions (dotnet#56381)
  [mono] Add GC unsafe transition to mono_unhandled_exception  (dotnet#56380)
  don't fail the file extraction when we can't set last write time (dotnet#56370)
  Properly rebuild optimization data when it changes (dotnet#56397)
  Make open function calls in coreclr EINTR resilient on macOS (dotnet#56403)
  Fix dependency from EventLog to TraceSource ref (dotnet#56417)
  Fix comments in asm with JitDiffableDasm=1 (dotnet#56416)
  Catch TcpClient ctor exceptions in FtpWebRequest.CreateConnectionAsync (dotnet#56379)
  Add interop between serializer and DOMs (dotnet#56112)
  Fix type loader not recognizing overridden method (dotnet#56337)
  Prevent Segfault in EventPipe on disable (dotnet#56104)
  Update runtimeconfig.json and deps.json paths when these break past the MAX_PATH threshold  (dotnet#56224)
  Use native allocator instead of pinning when decompressing embedded PDB (dotnet#56336)
  Specify win-x64 as a valid platform in the microsoft-net-runtime-* workloads for iOS/tvOS/MacCatalyst (dotnet#56311)
  Fix FailFast message formatting race (dotnet#56388)
  Try to fix finalizer-based async tests (dotnet#56384)
  Fix MetricsEventSource tests (dotnet#56382)
  Remove invalid Castle.DynamicProxy.Internal.AbstractInvocation from ILLink descriptor files (dotnet#56392)
  ...
Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

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

:shipit:

@thaystg thaystg merged commit 3ffd963 into dotnet:main Jul 29, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants