Skip to content
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

[NativeAOT] No variables or object inspection when debugging class library #82802

Closed
Paril opened this issue Mar 1, 2023 · 5 comments
Closed

Comments

@Paril
Copy link

Paril commented Mar 1, 2023

It seems that if you have a native executable that loads a NativeAOT-built class library, when stepping into the C# code, there's no ability to view variables or inspect the C# side of things at all (not even parameters, etc); is this intentional, or is something set up incorrectly on my end? I did see some people say that they could view variables/inspect objects in other issues, but I'm not sure why that's not possible in this case.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 1, 2023
@ghost
Copy link

ghost commented Mar 1, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

It seems that if you have a native executable that loads a NativeAOT-built class library, when stepping into the C# code, there's no ability to view variables or introspect the C# side of things at all (not even parameters, etc); is this intentional, or is something set up incorrectly on my end? I did see some people say that they could view variables/introspect objects in other issues, but I'm not sure why that's not possible in this case.

Author: Paril
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@Paril Paril changed the title [NativeAOT] No variables or object introspection when debugging class library [NativeAOT] No variables or object inspection when debugging class library Mar 1, 2023
@jkotas
Copy link
Member

jkotas commented Mar 1, 2023

Could you please share more details about your environment:

  • .NET runtime version
  • Operating system
  • Debugger

@vitek-karas
Copy link
Member

Did the debugger find symbols for the NativeAOT-built library. The library behaves like native code, without symbols the debugger won't see pretty much anything.

/cc @LakshanF

@Paril
Copy link
Author

Paril commented Mar 1, 2023

This ended up being user error; I was using dotnet publish with -c Release, and apparently there's still the ability to step through stuff but no variable inspection. Everything looks much better with -c Debug, although some stuff can't be inspected (like ReadOnlySpans) but I assume that's just WIP.

@Paril Paril closed this as completed Mar 1, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Mar 1, 2023
@agocke
Copy link
Member

agocke commented Mar 1, 2023

This might be that DWARF information isn't as good as it could be. See #72552

I'll start looking into Release codegen specifically. We might be able to do better than we are right now.

agocke added a commit to agocke/runtime that referenced this issue Mar 1, 2023
There are some reports (dotnet#82802) that debugging might be particularly bad
in Release.
agocke added a commit that referenced this issue Mar 9, 2023
* Enable DwarfDump AOT test in Release

There are some reports (#82802) that debugging might be particularly bad
in Release.

* Update warning counts for Release
@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants