Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697Ab0AZSrN (ORCPT ); Tue, 26 Jan 2010 13:47:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753713Ab0AZSrK (ORCPT ); Tue, 26 Jan 2010 13:47:10 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:36729 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513Ab0AZSrI (ORCPT ); Tue, 26 Jan 2010 13:47:08 -0500 Date: Tue, 26 Jan 2010 10:46:00 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Andi Kleen cc: tromey@redhat.com, Stephen Rothwell , Kyle Moffett , Peter Zijlstra , Peter Zijlstra , Fr??d??ric Weisbecker , Oleg Nesterov , Steven Rostedt , LKML , Arnaldo Carvalho de Melo , "Frank Ch. Eigler" , linux-next@vger.kernel.org, "H. Peter Anvin" , utrace-devel@redhat.com, Thomas Gleixner Subject: Re: linux-next: add utrace tree In-Reply-To: <877hr4g49l.fsf@basil.nowhere.org> Message-ID: References: <20100121013822.28781960.sfr@canb.auug.org.au> <20100122005147.GD22003@redhat.com> <20100121170541.7425ff10.akpm@linux-foundation.org> <20100122182827.GA13185@redhat.com> <20100122200129.GG22003@redhat.com> <20100122221348.GA4263@redhat.com> <877hr4g49l.fsf@basil.nowhere.org> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2085 Lines: 50 On Tue, 26 Jan 2010, Andi Kleen wrote: > Tom Tromey writes: > > > * Use an fd, not SIGCHLD+wait, to report inferior state changes to gdb. > > Internally we're already using a self-pipe to integrate this into > > gdb's main loop. Relatedly, don't mess with the inferior's parentage. > > How would having a kernel based solution be better over your > user space simulation? Oh, the reason we should do something in the kernel is that you really can't do certain things with the ptrace() interface. For example, think about how Wine and UML use ptrace - and then realize that that makes it impossible to attach a debugger from the outside. That's a real deficiency in ptrace - much more so than the fact that there are some odd details (ie the whole "read/write a word at a time" is just a quirky detail in comparison - not a fundamental problem). > BTW there's the new signalfd() system call that might do it > (haven't checked if it works for SIGCHLD) No, you miss the point. The problem isn't that you want to turn signals into a file descriptor just because you like file descriptors. The problem is that anything that is based on reparenting and signals is fundamentally a "one parent only" kind of interface. See? So the reason I think using an fd is a good idea is _not_ because gdb already uses an fd internally, but because it gives you a "connection" between the debugger and debuggee that is not fundamentally limited to a single controller. (It doesn't have to be a file descriptor, of course, but could be any kind of other model that allows multiple connections. It's just that in unix terms, using a file descriptor as the "cookie" for the connection is a very natural model. So the important part isn't the file descriptor itself, it's the model you could build). Linus -- 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/