From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7019 invoked by alias); 20 Dec 2011 22:16:07 -0000 Received: (qmail 7011 invoked by uid 22791); 20 Dec 2011 22:16:06 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Dec 2011 22:15:53 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Dec 2011 22:15:51 -0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com ([9.149.39.193]) by e06smtp16.uk.ibm.com ([192.168.101.146]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 20 Dec 2011 22:15:48 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBKMFm4F2425056 for ; Tue, 20 Dec 2011 22:15:48 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBKMFlRR002636 for ; Tue, 20 Dec 2011 15:15:47 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id pBKMFkrG002624; Tue, 20 Dec 2011 15:15:46 -0700 Message-Id: <201112202215.pBKMFkrG002624@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 20 Dec 2011 23:15:46 +0100 Subject: Re: [rfc] Options for "info mappings" etc. (Re: [PATCH] Implement new `info core mappings' command) To: alves.ped@gmail.com Date: Tue, 20 Dec 2011 23:08:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com, sergiodj@redhat.com In-Reply-To: <201112071755.pB7HtTK3024601@d06av02.portsmouth.uk.ibm.com> from "Ulrich Weigand" at Dec 07, 2011 06:55:29 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 11122022-3548-0000-0000-000000774115 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: 2011-12/txt/msg00704.txt.bz2 I wrote: > Pros of this method would be: > > - New target objects are quite generic and well-defined. > > - "info proc" now can go back to display info about arbitrary processes. > > - No new remote protocol packets for TARGET_OBJECT_FILE. > > > Cons of the method: > > - Need new remote protocol packet for TARGET_OBJECT_SYMLINK after all. > > - Synthesizing file contents for core files is a bit more awkward, since > you have to recognize particular /proc/PID/... file names. > > > The alternative to TARGET_OBJECT_FILE/SYMLINK would be to provide a set > of target_file_... accessor routines that map to native IO for native > targets and hostio for remote targets, again with a gdbarch option to > synthesize file contents from core files. I actually completed an implementation of this (second) method, before I noticed that it fundamentally does not work with the current remote protocol, for one simple reason: I cannot open /proc/PID/... because I do not even know the PID to use. With the remote target, the "PID" used within GDB may have no relationship whatsoever to the actual PID on a Linux remote target; in fact, it usually is the "magic" 42000 ... While in some cases, the (a) remote PID may be encoded into the GDB TID field, I cannot use this in -tdep code either, because when used with the native target, the TID is never a PID/LWP. Any suggestions? Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com