I have an enum, and I am trying to figure out what code is actually creating an instance of it. I have a whole lot of code, and I am fairly certain the code that I am looking for is in one of the many obscure projects that is not in my current solution, so find usages won't work.
I know there is no such thing as a constructor on an enum, but I would really like a way to break execution and examine the call stack anytime any code creates and uses this enum. I have tried putting breakpoints on individual enum values, but they never toggle, even when I know they are being used.
Is this possible, or am I going to need to take a different route to find what I am looking for.
Well, it is technically possible, assuming you control the code of the enum itself:
Also, if what you really want to do is look at the callstacks when members of this enum are added to a particular collection (as you said in a comment), why not find usages on the collection (which hopefuly has a smaller scope?) and put breakpoints (or better yet, TracePoints with the $CALLSTACK psuedovariable) wherever items are added to it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With