Is there a way I can find out all changes to memory by a particular piece of code( a function or a line of code ) without knowing in advance where I expect the changes(I want to watch the whole program memory space)? watch in gdb requires me to know what I expect is changing…
Share
If you can run the software you wish to probe on Linux or Mac OS, I’d suggest looking into Valgrind, specifically Valgrind’s Memcheck tool.
In a nutshell, Valgrind runs your program on a “synthetic CPU”. It doesn’t directly execute the program’s code on the real hardware. As a result, it’s able to instrument everything that the program does. The Memcheck tool is able to watch all of the program’s memory accesses. It can do an amazing job of helping to find various types of memory errors.