This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use debug registers directly in programs?


On Tue, 2007-04-03 at 15:13 +0800, Wang Yi wrote:

>     1. Is that feasible to use debug registers in the programs to
> debug themselves? I think yes, any confirm?
>     2. How to use the debug registers? The IA32 manual talks about
> these registers but doesn't tell how to use them, the gdb internals
> covers many areas but it is too complex for those who have not written
> or read a debugger before. Should I read the gdb source?

The only way I know of to set the debug registers is to use ptrace and a
program cannot ptrace itself so, you will always need a third-party
program if only to control the debug registers on your behalf.

Mathieu
-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]