On Thu, Nov 20, 2008 at 9:05 AM, Wang Yi <leonidwang@xxxxxxxxx> wrote: > Hello, > > X86 has 4 hardware debug registers, which could be used to > implement watchpoints in debuggers. > I checked gdb maillist and some gdb code to find out that gdb uses > ptrace to set up hardware debug registers. I'm not familiar with > details of ptrace syscall, but I know that a process can not ptrace Not sure...but this email indicated that it is possible...and now he is introducing something to disable it....but i cannot find it in current linus git yet... http://lkml.org/lkml/2008/8/25/40 > itself. So there has to be a third-part program such as gdb to call > ptrace. > My question is: is there any approach to use debugger registers > directly without using a third-party program? > I mean to implement gdb's watchpoint in user program, so that I can > set up hardware watchpoints manually and conveniently without gdb, any > suggestions? > > thx anyway, current version of kernel does have API that interact with hardware debug reg: eg ptrace_get_debugreg()....so possibly avoid reinventing the wheel..... -- Regards, Peter Teoh -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ