[lkml]   [2002]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] kdb/mdb hardware breakpoints broken 2.4.17/18
This is a problem that comes up when user and kernel debuggers are using
the hardware breakpoints at the sametime.

1. If more than one kernel debugger is present (for ex: DProbes and kdb),
one can ovewrite the debug register settings of the other.

2. kernel allows the gdb to override the kernel debugger's h/w bps (through
ptrace and by writing the process context dr7 during signal handling -- the
problem observed by you below).

In DProbes we have tried to address this problem by providing a centralized
global debug register allocation scheme. (See the latest DProbes code, at

In this scheme any debugger (user or kernel) wanting to use a debug register
should first get it allocated for its use. User debuggers do this transparently
using ptrace(allocations using ptrace are local to the process). Interfaces
are provided for kernel debuggers to allocate/free the debug registers on global
basis. DProbes has used this successfully and can interoperate well with gdb.
(Currently gdb is not prepared to handle failures when writing to debug
registers using ptrace, hence for now, users would get non-intuitive error


In article <>, "Jeff V. Merkey"
<> wrote:

> Please find a patch that corrects the problem with hardware breakpoints
> not working with kdb. I have noticed that gdb uses inserted int3 (0xCC)
> breakpoints (as does kdb) for soft breakpoint support, so this fix may
> not affect these programs. It is not clear why every signal handled is
> writing a 0 t the DR7 register. Patch submitted to Keith Owens and
> Linux kernel. Jeff

Bharata B Rao,
IBM Linux Technology Center, IBM Software Lab, Bangalore, India.
Ph: 91-80-5044962(5262355 X-3962), Mail:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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