lkml.org 
[lkml]   [1999]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Hardware-assisted memory-access breakpoints(watchpoints) on i386
Ilya Tsindlekht wrote:

> GDB (and, consequently, its GUI frontends), doesn't support hardware-based
> memory access breakpoints (aka watchpoints) on Intel CPUs. Doing this probably
> would require some kernel support (extending ptrace?). Is there any reason why
> it isn't done? (or is it already done somewhere?)

Linux does seem to give user-space access to at least some debug-related
ia32 features:
* ptrace PTRACE_POKEUSR lets a debugger record the information
that goes into the debug registers when the process is resumed
* the debug-related exceptions (#1 and #3) are mapped to SIGTRAP
signals, and the debugger can catch those

I do see two possible problems:
* The Intel P6 family has a couple of model-specific registers which
carry additional information about some debug exceptions.
ptrace() should perhaps be extended to allow a debugger to set up
and retrieve these MSRs
* I don't know what signal info (if any) Linux passes on to the
user-space signal handler; in particular, the signal handler
would need the PC of the faulting instruction or the address
which triggered a data read/write debug exception.


/Mikael

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.041 / U:1.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site