About debugging in visual studio

OS: Windows 10 22H2 19045.5487
unity: 6000.0.32f1
visual studio: Microsoft Visual Studio Community 2022 17.12.3

I try to debug into unity.logging module in unity editor through visual studio.
I have managered to add a breakpoint and entered the debug running mode by following steps:

  1. switch “Debug mode” in unity editor
    image
  2. add breakpoint in visual studio
  3. “Debug”-> “attach unity debugger …”
  4. start in unity editor

    then it works and the program stopped at the breakpoint, I can see the stack trace and variables, then I press F11(step in) try to see the code in unity.logging module.

But there is no related code just show a blank page.

I know in java we can download the source code package by definition of pom.xml, I am not sure if C# has the same mechanism for publishing the third-party library source code.

So, my questions are:

  1. Is it feasible to debug into the unity.logging module to check the logic?
  2. If it is feasible, Is there anything I haven’t done properly?

Isn’t unity.logging package available as plain source, it should be located in \Library\packagecache or something

Stepping back, what’s going wrong with logging in the first place?

This it? GitHub - needle-mirror/com.unity.logging: The Logging package provides interfaces for creating and processing runtime events and logging output. 📦 [Mirrored from UPM, not affiliated with Unity Technologies.]

when I debugged the unity.logging, just like the following:


I pressed F11(step in), the call stack(see in the bottom right) showed two frames

the code page showed “Frame not in module” when I click “View disassembly”

the page showed “no disassembly available”

The forgoing is what happened when I tried to debug unity.logging.

Another question is: when I tried to debug unity core module, I found I cannot step in at all:


when I set breakpoint at GameObject.Find and pressed F11(step in) when the program stopped at the line, it just stepped over the line and I cannot set breakpoint at the position inside the GameObject.Find

I am not sure if unity‘s debugging is as flexible as java which is easy to jump into jdk source code to troubleshoot the problems

From my experience it fails when

  1. explicitly restricted by Unity to protect their source, esp when bridging the C# → C++ backend
  2. some source generated scenarios

#1 seems more likely here unless there’s some other issue going on