How to set breakpoints programmatically in Visual C ++?

What I'm trying to do is track changes in memory values ​​at some specific addresses, for example, bind a callback function to the onChange event.

One idea I can come up with is to use a memory breakpoint. So how to programmatically handle breakpoints in Visual C ++?

+6
source share
4 answers

If you need to break into the debugger, use DebugBreak if necessary in the #ifdef _DEBUG #endif block

+4
source

You can also put in your code:

__ asm {int 3}

If you are working under the VS debugger, this will call the breakpoint handler.

UPDATE: This is actually the same as using instrinsic __debugbreak MSVC ( http://msdn.microsoft.com/en-us/library/f408b4et.aspx )

0
source

I had great success with the hwbrk project .

0
source

All Articles