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.
-------------------------------------------------------


|