From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14474 invoked by alias); 5 Jan 2012 16:38:59 -0000 Received: (qmail 14035 invoked by uid 22791); 5 Jan 2012 16:38:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_OC X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jan 2012 16:38:39 +0000 Received: by wgbds11 with SMTP id ds11so590169wgb.12 for ; Thu, 05 Jan 2012 08:38:38 -0800 (PST) Received: by 10.227.202.142 with SMTP id fe14mr2377005wbb.10.1325781518510; Thu, 05 Jan 2012 08:38:38 -0800 (PST) Received: from [192.168.0.103] (bl21-184-26.dsl.telepac.pt. [2.82.184.26]) by mx.google.com with ESMTPS id h13sm913017wbn.17.2012.01.05.08.38.36 (version=SSLv3 cipher=OTHER); Thu, 05 Jan 2012 08:38:37 -0800 (PST) Message-ID: <4F05D20B.8030700@gmail.com> Date: Thu, 05 Jan 2012 16:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Ulrich Weigand CC: gdb-patches@sourceware.org, jan.kratochvil@redhat.com, sergiodj@redhat.com Subject: Re: [rfc, ping] Remote "info proc" and core file generation References: <201201051517.q05FH0IE012035@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201201051517.q05FH0IE012035@d06av02.portsmouth.uk.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00195.txt.bz2 On 01/05/2012 03:17 PM, Ulrich Weigand wrote: > Hello, > > given the problems with my latest attempt to access /proc remotely via > generic file access routines documented here: > http://sourceware.org/ml/gdb-patches/2011-12/msg00782.html > > I would like to go back to my earlier approach using TARGET_INFO_PROC: > http://sourceware.org/ml/gdb-patches/2011-12/msg00007.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00008.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00009.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00010.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00011.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00014.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00015.html > http://sourceware.org/ml/gdb-patches/2011-12/msg00016.html > > In the meantime, I've got approval for the doc and bfd parts, and > Joel has regression-tested the patches on a procfs target (Irix). > > So the only thing that stops this patch series from going in as-is > is consensus that TARGET_INFO_PROC is the right abstraction level. > > Given the experiments I did in the meantime (see above), I'd now > argue that this *is* the proper level of abstraction: > > - TARGET_INFO_PROC allows the *contents* of Linux /proc files to > be passed through unchanged, so we don't have to define our own > formats (and keep updating them) -- the one drawback is that the > contents are obviously Linux-specific, but that's OK as long as > the target objects are only used in linux-tdep code. > > - At the same time, *access* to those contents is abstracted. This > means we do *not* have to know exactly where on the target the > /proc files are found: e.g. in the classic remote target, the GDB > host side does not even know the PID of the inferior process on > the target. (Another possibility might be a Linux kernel remote > target that operates via hardware debugging or in-kernel debugging > and still provides access to Linux processes: such remote stubs > could also implement TARGET_INFO_PROC, even if they may not > provide general access to the file system.) > > Pedro, you had been raising concerns about this initially. Did you > have a chance to look at the discussion refered to at the top of > this mail? I've replied now. Sorry for the delay... > Do you still feel that TARGET_INFO_PROC is inappropiate? I still do. :-( - there's the issue I raised about needing to cache the object across the whole transfer, lest the file disappears of changes behind your feet. Easy to fix, though. - I don't see the advantage over separate target objects for each proc/... subtype. We already have a mechanism to report back some object is not supports (simply don't support the qXfer:object:read packet). Why use the annex instead? An e.g., getting at the current process'es executable is something that would be useful for target_pid_to_exec_file, for attach. If we're having a specific packet for that, shouldn't it be a "top-level" packet, rather than buried in TARGET_INFO_PROC? - if GDB already needs to know what target it is talking to (for the gdbarch methods), then I don't see what gain do we have from half an abstraction -- this is what leads me to consider instead reading from the target filesystem.