Adding message to assert

You are out of luck here. The best way is to define your own assert macro. Basically, it can look like this: This will define the ASSERT macro only if the no-debug macro NDEBUG isn’t defined. Then you’d use it like this: Which is a bit simpler than your usage since you don’t need to … Read more

Debug assertion failed

The problem is that the function list::Subset(list subset) takes its argument by value causing a copy of the list to be made. Since you did not follow the Rule of Three (as noted in Chris’ comment) a shallow copy is made. This means that two instance of list “own” the pointers. When the Subset function … Read more

General way of solving Error: Stack around the variable ‘x’ was corrupted

Is there a general way to debug this error with VS2010? No, there isn’t. What you have done is to somehow invoke undefined behavior. The reason these behaviors are undefined is that the general case is very hard to detect/diagnose. Sometimes it is provably impossible to do so. There are however, a somewhat smallish number … Read more

Is there a built-in function to print all the current properties and values of an object?

You are really mixing together two different things. Use dir(), vars() or the inspect module to get what you are interested in (I use __builtins__ as an example; you can use any object instead). Print that dictionary however fancy you like: or Pretty printing is also available in the interactive debugger as a command:

How do I remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?

Start debugging, as soon as you’ve arrived at a breakpoint or used Debug > Break All, use Debug > Windows > Modules. You’ll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You’ll get a dialog … Read more