2

I am debugging a memory corruption issue on MIPS. I want to know who write a certain value to an address.

In x86-64, we can use mprotect+sigsegv+sigtrap to log any memory write access to a specified address.

If I use mprotect, in sigsegv handler, I have to unprotect the memory, otherwise, program will trigger signal handler constantly. Besides, in signal handler, it is not easy to know what value will be wrote to the memory.

For hardware watch point, it has similar issue. The exception will occurs before the memory is wrote instead of after.

Anyway to know the value that will be wrote to the memory? And if it is an expected value, could we protect the memory again and continue to execute?

user14944
  • 43
  • 6

0 Answers0