This is the mail archive of the
mailing list for the GDB project.
Re: Use debug registers directly in programs?
- From: Mathieu Lacage <Mathieu dot Lacage at sophia dot inria dot fr>
- To: Wang Yi <leonidwang at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 03 Apr 2007 09:30:50 +0200
- Subject: Re: Use debug registers directly in programs?
- References: <email@example.com>
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.