As Bharata mentioned this sort of a thing is exactly what we use today
in dprobes. Guess we could separate out that piece as a patch so you can
take a look. We had posted one long back on this list, but have now
cleaned
up and reorganized it a bit. In fact we've used this for a while for
preparing
consolidated patches containing both dprobes and kdb, in a way that also
interoperates with gdb (we don't want our watchpoint settings to get
overwritten
on a context switch for example).
>gdb/ptrace always uses i386 db4-7 no matter
> what kdb is doing. The kernel always uses db7, even if no tracing is
> being done. If you want to use gdb/ptrace then restrict your kdb usage
> to db0-3, without gdb/ptrace kdb can use db0-6.
>
> It would be nice to have a proper debug register function to
> automatically detect conflicts and tell one of the debuggers to go
> away. However Linus "I don't want kernel debuggers" Torvalds does not
> care about this problem and I don't want the footprint of kdb to be any
> bigger than it has to be. So kdb relies on the user to know which
> debug registers then can use.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/