From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44178 invoked by alias); 29 Jun 2017 11:05:27 -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 44160 invoked by uid 89); 29 Jun 2017 11:05:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1449, H*r:sk:static. X-HELO: mail-io0-f181.google.com Received: from mail-io0-f181.google.com (HELO mail-io0-f181.google.com) (209.85.223.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Jun 2017 11:05:25 +0000 Received: by mail-io0-f181.google.com with SMTP id h134so4793044iof.2 for ; Thu, 29 Jun 2017 04:05:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=yy0pOUggiD/t2T05a93Z4wIp/UObW6FoZ9ya232lzTA=; b=fTl5Amw3G7xoTVozDvKmKgXph8wgQDlCqkBAdf9ro+KluczJNlxPySIeNJvQR2sM/7 BjyaYuomRSQ0ATsZlFbsfxSNlsC0j2aT/ccdms6GLGJMCJURA31GcC/jHcs53IdepyDf m19aOw3eNc3LSXfBpheeKKGw2tiVaizM1aDH4jSZ69SP7p5Y/ROk7YLHGCFdw3utJFGA YXiDjSx7xVP3+rQYkBNz9mPN2z6knsJKxqbDB/1H1L6dS8pk4xc/AvdmKKuCGi+huz2o 1VTmJjjdoT6DRkSGNVjVdrgpTKd22jDIxyORwcrcGmc7atUqBp8QBZbLZZJNGQZz2e35 HMLw== X-Gm-Message-State: AKS2vOy2HOoY48jnyidDpArqsXulbCGqs9CpOZELwVzGEcs/x6hSTZjI UUBp5KKOmJTKCh4x X-Received: by 10.107.33.20 with SMTP id h20mr16381867ioh.74.1498734323676; Thu, 29 Jun 2017 04:05:23 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id n188sm401119itn.17.2017.06.29.04.05.22 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 29 Jun 2017 04:05:23 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 11/25] Use VEC for target_desc.reg_defs References: <1497256916-4958-1-git-send-email-yao.qi@linaro.org> <1497256916-4958-12-git-send-email-yao.qi@linaro.org> <297988f7-dffe-d922-0fcc-7b8c867c6c53@redhat.com> Date: Thu, 29 Jun 2017 11:05:00 -0000 In-Reply-To: <297988f7-dffe-d922-0fcc-7b8c867c6c53@redhat.com> (Pedro Alves's message of "Wed, 28 Jun 2017 20:01:22 +0100") Message-ID: <86zicrcavm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00785.txt.bz2 Pedro Alves writes: > Can you say more about the choice of VEC? It feels > like new uses should come with a rationale for why it'd > be preferred over std::vector. > > I'm guessing that it's because the gdb side uses VEC too? > Or is it something else? (I can guess other reasons, but > the point is that we shouldn't have to guess.) Yes, GDB target description uses VEC, so I chose VEC for GDBserver target description too. > > [Note that the IPA avoids calling the inferior's malloc during > normal operation, to avoid deadlocking the inferior. > This is initialization code, so it's not covered by the exact > same level of concern, even though one of the original goals was > to also be able to inject the IPA into a running inferior (e.g., by > calling dlopen via gdb). That does work (or at least used to), > but it's a little unsafe because the IPA initialization code > already calls malloc and other non-async-signal-safe functions. Such usage is documented, at least, https://sourceware.org/gdb/onlinedocs/gdb/Server.html > I guess std::vector would make it possible to use a custom > allocator in the IPA that would allocate memory with mmap > directly (or we'd make the IPA's xmalloc allocate with mmap, > and then the allocator would use xmalloc).] Do you suggest that we need to use std::vector plus a customized allocator which uses mmap? --=20 Yao (=E9=BD=90=E5=B0=A7)