Re: linux-next: add utrace tree

From: Peter Zijlstra
Date: Wed Jan 27 2010 - 01:52:38 EST


On Tue, 2010-01-26 at 15:37 -0800, Linus Torvalds wrote:
>
> On Tue, 26 Jan 2010, Tom Tromey wrote:
> >
> > In non-stop mode (where you can stop one thread but leave the others
> > running), gdb wants to have the breakpoints always inserted. So,
> > something must emulate the displaced instruction.
>
> I'm almost totally uninterested in breakpoints that actually re-write
> instructions. It's impossible to do that efficiently and well, especially
> in threaded environments.
>
> So if you do instruction rewriting, I can only say "that's your problem".

Right, so you're going to love uprobes, which does exactly that. The
current proposal is overwriting the target instruction with an INT3 and
injecting an extra vma into the target process's address space
containing the original instruction(s) and possible jumps back to the
old code stream.

I'm all in favor of not doing that extra vma and instead use stack or
TLS space, but then people complain about having to make that executable
(which is something I don't really mind, x86 had executable everything
for very long, and also, its only so when debugging the thing anyway).



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