Quantcast
Channel: Is it possible to set a gdb watchpoint programmatically? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Is it possible to set a gdb watchpoint programmatically?

$
0
0

I want to set a watchpoint (break on hardware write) temporarily in my C++ program to find memory corruption.

I've seen all the ways to do it manually through gdb, but I would like to actually set the watchpoint via some method in my code so I don't have to break into gdb, find out the address, set the watchpoint and then continue.

Something like:

#define SET_WATCHPOINT(addr) asm ("set break on hardware write %addr")

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images