Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: Debug Regis...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 4609 of 4729
Post > Topic >>

Re: Debug Registers in Linux from User Mode

by Tavis Ormandy <spamtrap@[EMAIL PROTECTED] > Apr 20, 2008 at 08:35 PM

tony  <spamtrap@[EMAIL PROTECTED]
> wrote:

> Is there any way to read the contents of Debug registers in Linux from
> user mode, as it can be done in windows through Thread Context function
> 

Yes, using ptrace(). The debug registers are accessible via the process
user
area (see linux/user.h).

You'll need to PTRACE_ATTACH to the process you're interested in, and then
PTRACE_PEEKUSR, the third parameter to PEEKUSR should be offsetof(struct
user, u_debugreg[n]), where n is the register you want to read. 

If you want to read your own debug registers, you will need to fork, then
make the child PTRACE_TRACEME.

Hope this helps.

-- 
-------------------------------------
taviso@[EMAIL PROTECTED]
 | finger me for my pgp key.
-------------------------------------------------------
 




 2 Posts in Topic:
Debug Registers in Linux from User Mode
tony <spamtrap@[EMAIL  2008-04-08 09:57:06 
Re: Debug Registers in Linux from User Mode
Tavis Ormandy <spamtr  2008-04-20 20:35:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:15:11 CDT 2008.