Skip to content

Instantly share code, notes, and snippets.

@le4ker
Created March 21, 2012 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le4ker/2148224 to your computer and use it in GitHub Desktop.
Save le4ker/2148224 to your computer and use it in GitHub Desktop.
SET/GET debug registers MACROS
//REGISTER must be between "0" and "7" for the dr0-dr7 accordingly
#define SET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %0,%%dr" REGISTER "\n" :: "r" (VALUE));
#define GET_DEBUG_REGISTER(REGISTER, VALUE) __asm__ __volatile__ ("mov %%dr" REGISTER ",%0\n" : "=r" (VALUE));
@le4ker
Copy link
Author

le4ker commented Mar 26, 2012

Use the set_debugreg and get_debugreg instead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment