2

I was wondering if there is a way to put a breakpoint in every method in a class automatically? I'm using Visual Studio 2015, and was interested in mainly a non-addon way to do it.

I have tried the "New Breakpoint -> Function -> MyClassName::*" and "... -> MyNameSpace.MyClassName::*" that I've found in other answers (How to set a breakpoint in every method in VS2010), but those didn't work. Possibly because the answers were VS2010 oriented? Idk.

I'm also trying to do this for an MVC controller, in case that changes anything.

Any suggestions?

Community
  • 1
  • 1
Jurijs Kastanovs
  • 685
  • 1
  • 15
  • 35
  • Since your goal is to break on any controller action. What about: Break All? `CTRL + ALT + Break`. Let the client make the call (that will block because the server is blocked) At that point you can continue debugging – Bruno Garcia May 16 '16 at 11:58
  • @BrunoGarcia Well I've managed to set the break mode. But then, how do I start debugging from there? Any step keys just act as "Continue" and the app just exits the break mode and runs further as it doesn't hit any breakpoint. – Jurijs Kastanovs May 16 '16 at 12:18
  • "was interested in mainly a non-addon way to do it." - I can't recall ever, in my experience, wanting to set a breakpoint on *every* method in a class, and I doubt many others have either. So expecting to find such a feature within the core product may be expecting a bit too much. – Damien_The_Unbeliever May 16 '16 at 12:55
  • Well, that sounds like a pretty simple feature... Thought VS had it built in somewhere, specially if it was supposedly available in VS2010. It's a helpful thing when you're not exactly sure which method is being called. Legacy architecture can be terrible and take ages to figure out what exactly is being done and called. – Jurijs Kastanovs May 16 '16 at 13:44
  • If you're referring to [this answer](http://stackoverflow.com/a/18480950/15498), it's explicitly C++ only. If not, it would be helpful to share with us *where* you're reading about this older functionality. (In fact, you really ought to edit your question to include this since you currently say "I've found in other answers", but fail to give us any clues as to which answers you're reading) – Damien_The_Unbeliever May 16 '16 at 14:23
  • Yes, I was referring to that answer. I've edited the question. Still tho, it seems weird to me that there would only be this language-specific implementation. But I guess there should be a way to write some macro or smth? – Jurijs Kastanovs May 17 '16 at 04:54

0 Answers0