From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99758 invoked by alias); 13 Dec 2019 18:51:22 -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 99747 invoked by uid 89); 13 Dec 2019 18:51:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2019 18:51:21 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id xBDIpC8t025271 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2019 13:51:17 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca xBDIpC8t025271 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1576263078; bh=m5OewGbZST7SH+xmLp5ZOHIssSCpZcjC57rp5rG9yKY=; h=Subject:From:To:References:Date:In-Reply-To:From; b=V9dwMnFtK+PXlWJ7gsye7yhLgBTmBMAc/hx6IaiWhntADlmmShY8anzvo3LBA45vh qDxBUTcRZXhwqe75jBXhS4ZXHRgEC1DODt0ys2A1zH/lf3DqCYh2R+7LM26872WG9g dMUpgt19RFwsZfVHVCNbV/nMXpWJo2BUwaW8FGrk= Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 94D7F1E573; Fri, 13 Dec 2019 13:51:12 -0500 (EST) Subject: Re: [PATCH 5/7] jit: make gdb_object::symtabs a vector of unique_ptr From: Simon Marchi To: Pedro Alves , gdb-patches@sourceware.org References: <20191213060323.1799590-1-simon.marchi@polymtl.ca> <20191213060323.1799590-6-simon.marchi@polymtl.ca> Message-ID: Date: Fri, 13 Dec 2019 18:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00606.txt.bz2 On 2019-12-13 1:45 p.m., Simon Marchi wrote: > I don't think so. We return these pointers to the JIT debug readers, which then pass > it back to the block_open and symtab_close callbacks. It's important that the objects > don't move during their lifetime. If we had a vector of objects, the pointers we return > to the user would get invalidated the moment the vector is resized. Actually, it would be good to document this, so we don't change it to a vector of objects, out of good intention. I would add this to document the gdb_object::symtabs field: /* Symtabs of this object. This is a vector of pointers, rather than a vector of objects, because the pointers are returned to the user's debug info reader, so it's important that the objects don't change location during their lifetime (which would happen with a vector of objects getting resized. */ I would add a similar comment later in the series to document gdb_symtab::blocks. Simon