1
lorentz
31d

Is there a debug tool in Visual Studio that acts like a global HashMap<String, object> that you can add random objects to so that you can verify which objects are the same instance between breakpoints and view the state of an object that you had access to but is not in scope at a given breakpoint? I'm debugging a GUI app right now and it's an enormous pain in the ass to track identities, I resorted to adding random properties and statics to classes just so I can express this basic ass persistent debugger state

Comments
  • 0
    Haven't used Visual Studio in a while. Is there a monitor memory window? Or am I being too simplistic? What language?
  • 1
    @Demolishun there is, but it only allows me to inspect memory through snapshots which take forever to create so even if it offered this functionality I couldn't use it to quickly find connections or unexpected reinstantiations
  • 0
    @Demolishun It's C# by the way, so the runtime definitely allows for this type of debugging strategy.
  • 1
    @Demolishun <subrant>

    I took a snapshot just now to see if I could use the memory profiler, so I also noticed that every instance of this particular class is added to a static IEnumerable with IEnumerable.Append thus creating not only a memory leak in a GC'd language but also the slowest sequence in C#. It's a linked list, the cursor starts at the deep end, and every step is a virtual call.

    </subrant>
  • 0
    It also doesn't actually meet my debugging needs because the objects "pushed" on this vile construction log aren't nameable so I can't mark a particular object to ref-compare at a later breakpoint
  • 0
    @lorentz why don’t you just make a global (singleton) hashmap in your code?
Add Comment