Skip to content

[wasm[debugger] Support DebuggerTypeProxyAttribute(string) #77315

Closed

Description

@ilonatommy

We have support only for DebuggerTypeProxyAttribute(Type).

We are missing support for this overload:
https://github.com/microsoft/referencesource/blob/master/mscorlib/system/diagnostics/debuggerattributes.cs#L178

Where to start the fix:

// FIXME: DebuggerTypeProxyAttribute(string) - not supported

Activity

  1. self-assigned this
    on Oct 21, 2022
  2. ghost added
    untriaged
    on Oct 21, 2022
  3. added
    arch-wasm
    and removed
    untriaged
    on Oct 21, 2022
  4. added this to the 8.0.0 milestone on Oct 21, 2022
  5. ilonatommy commented on Jul 27, 2023

    @ilonatommy
    MemberAuthor

    When we enable ElementType.String

    if ((ValueTypeId)monoParamTypeId != ValueTypeId.Type && (ElementType)monoParamTypeId != ElementType.String)
    {
                        logger.LogDebug($"DebuggerTypeProxy attribute is only supported with a System.Type or System.String parameter type. Got {(ValueTypeId)monoParamTypeId}");
                        return -1;
    }
    

    We can see that for ProxyAttribute constructed with a string:

        // added this to debugger-custom-view-test.cs:
        [DebuggerTypeProxy("DebuggerTests.TheProxy")]
        class WithProxyConstructedByString
        {
            public string Val1 {
                get { return "string two"; }
            }
        }
    
        [DebuggerTypeProxy("DebuggerTests.TheProxy")]
        class WithProxyStructConstructedByString
        {
            public string Val1 {
                get { return "string two struct"; }
            }
        }
    

    We are getting, in response to CMD_TYPE_GET_CATTRS, a typeProxyTypeId

    var typeProxyTypeId = getCAttrsRetReader.ReadInt32();

    that exceeds the allowed id range in
    static GPtrArray *ids [ID_NUM];

    e.g. in

    g_assert (id > 0 && GINT_TO_UINT(id) <= ids [type]->len);

    id=76, type=2, ids [type]=27962056, GINT_TO_UINT(id)=76, ids [type]->len=55.

    Error details:

    console.error: Error: [MONO] * Assertion at /workspaces/runtime/src/mono/mono/component/debugger-agent.c:2049, condition `<disabled>' not met
    

    So far I did not find the reason for ID values out of range for strings.

  6. modified the milestones: 8.0.0, 9.0.0 on Aug 7, 2023
  7. added
    enhancement
    on Mar 4, 2024
  8. removed their assignment
    on Apr 25, 2024
  9. modified the milestones: 9.0.0, Future on Apr 25, 2024
  10. thaystg commented on Aug 6, 2024

    @thaystg
    Member

    This is fixed by the new debugger.

  11. locked and limited conversation to collaborators on Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasmarea-Debugger-monoenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions