From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23156 invoked by alias); 20 Oct 2015 15:20:35 -0000 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 Received: (qmail 23114 invoked by uid 89); 20 Oct 2015 15:20:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 20 Oct 2015 15:20:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 4925AA0E4A; Tue, 20 Oct 2015 15:20:20 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9KFKIpU013395; Tue, 20 Oct 2015 11:20:19 -0400 Message-ID: <56265BB2.6060204@redhat.com> Date: Tue, 20 Oct 2015 15:24:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Aleksandar Ristovski , gdb-patches@sourceware.org Subject: Re: [PATCH 2/3] (patch 2/4, v2) [nto] Implement TARGET_OBJECT_AUXV. References: <56263FED.3050602@redhat.com> <1445351294-18179-1-git-send-email-aristovski@qnx.com> <1445351294-18179-3-git-send-email-aristovski@qnx.com> In-Reply-To: <1445351294-18179-3-git-send-email-aristovski@qnx.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-10/txt/msg00361.txt.bz2 Does this result in any visible improvement? I assume that at least, "info auxv" now works [1] [2]. It'd be really nice to have a blurb in the commit log mentioning what motivated this. [1] - BTW, if you enable gdb.base/auxv.exp on NTO, does it pass? On 10/20/2015 03:28 PM, Aleksandar Ristovski wrote: > gdb/ChangeLog: > > * nto-procfs.c (sys/auxv.h): Include. > (procfs_xfer_partial): Implement TARGET_OBJECT_AUXV. > * gdb/nto-tdep.c (nto_read_auxv_from_initial_stack): New function. > * gdb/nto-tdep.h (nto_read_auxv_from_initial_stack): New declaration. Drop the "gdb/" in the file paths. > @@ -885,6 +887,40 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object, > { > case TARGET_OBJECT_MEMORY: > return procfs_xfer_memory (readbuf, writebuf, offset, len, xfered_len); > + case TARGET_OBJECT_AUXV: > + if (readbuf != NULL) > + { > + int err; > + CORE_ADDR initial_stack; > + debug_process_t procinfo; > + /* For 32-bit architecture, size of auxv_t is 8 bytes. */ > + const unsigned int sizeof_auxv_t = sizeof (auxv_t); > + const unsigned int sizeof_tempbuf = 20 * sizeof_auxv_t; > + int tempread; > + gdb_byte *const tempbuf = alloca (sizeof_tempbuf); > + > + if (tempbuf == NULL) > + return TARGET_XFER_E_IO; > + > + err = devctl (ctl_fd, DCMD_PROC_INFO, &procinfo, > + sizeof procinfo, 0); > + if (err != EOK) > + return TARGET_XFER_E_IO; > + > + /* Similar as in the case of a core file, we read auxv from > + initial_stack. */ Hmm, where's this "similar" you refer to? AFAICS, for cores, BFD extracts it from the NT_AUVX note. > + initial_stack = procinfo.initial_stack; > + > + /* procfs is always 'self-hosted', no byte-order manipulation. */ Double-space after period. Otherwise looks OK. Thanks, Pedro Alves