This proved useful to debug a memory corruption on linux/amd64. I had to adapt it to 64bit: the USER_DR constants are 32bit specific. I found that  #including <sys/user.h> and then using offsets of the form offsetof(struct user, u_debugreg[0]) instead of USER_DR0 is all it takes.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Roland Westrelin