From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113559 invoked by alias); 27 Jun 2017 12:00:57 -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 109898 invoked by uid 89); 27 Jun 2017 12:00:46 -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=H*r:sk:static. X-HELO: mail-it0-f41.google.com Received: from mail-it0-f41.google.com (HELO mail-it0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 12:00:44 +0000 Received: by mail-it0-f41.google.com with SMTP id b205so13927246itg.1 for ; Tue, 27 Jun 2017 05:00:39 -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=iKQUMqlKQr1F6vOF4cTKV/+UpH8rE0k2ypGL+YJD3q8=; b=BnB6DmBVzRDaY4KO6mKttCgiZZapEG45D/K/JmT+yZy5kKZKaUDuCJC9N0Q3K8QJ57 V7OErWUbGBnOC2Xdk1HJojrPwEWhCjMxtfWwr9OG/RjQmo/mKM13p4x3vHoHHuc6T9e/ ux57Vbcp/wQbnO8HurmGUqxck2eb7klDY/O7HnGsfNrruGdkTzdylZiFOkwzr6qmDdvV 163MAtvx4lCQXadB6aRM09h5SFgtidtaiHzPlmYP/WIonBhHhZKKMt303iLxnK7zPVoo 6oU8Oitqd6fR7eLzxe46ON2tfpJRuG3yY8MBnQinPYITEhf9KqvJSBe7/UIR2ycvomYd 13/w== X-Gm-Message-State: AKS2vOwQEYgtF1UoL/G2U90HWYuoAQpqBWMpF0SF3U3pu6dyW7ivhBb7 3ukyyJ3b8E0Y0kjC X-Received: by 10.36.65.18 with SMTP id x18mr2168923ita.88.1498564838395; Tue, 27 Jun 2017 05:00:38 -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 65sm1245332itm.1.2017.06.27.05.00.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 27 Jun 2017 05:00:38 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 07/40] objfile_per_bfd_storage non-POD References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-8-git-send-email-palves@redhat.com> Date: Tue, 27 Jun 2017 12:00:00 -0000 In-Reply-To: <1496406158-12663-8-git-send-email-palves@redhat.com> (Pedro Alves's message of "Fri, 2 Jun 2017 13:22:05 +0100") Message-ID: <867ezxfxng.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/msg00723.txt.bz2 Pedro Alves writes: > A following patch will want to add a std::vector to > objfile_per_bfd_storage. That makes it non-trivially > constructible/destructible. Since objfile_per_bfd_storage objects are > allocated on an obstack, we need to call their ctors/dtors manually. > This is what this patch does. And then since we can now rely on > ctors/dtors being run, make objfile_per_bfd_storage::storage_obstack > be an auto_obstack. It is good trick to class-fy some structures which are allocated on obstack. > > gdb/ChangeLog: > yyyy-mm-dd Pedro Alves > > * objfiles.c (get_objfile_bfd_data): Call bfd_alloc instead of > bfd_zalloc. Call objfile_per_bfd_storage's ctor. > (free_objfile_per_bfd_storage): Call objfile_per_bfd_storage's > dtor. > * objfiles.h (objfile_per_bfd_storage): Add ctor. Make > 'storage_obstack' field an auto_obstack. In-class initialize all > non-bitfield fields. Make minsyms_read bool. > * symfile.c (read_symbols): Adjust. Patch is good to me. --=20 Yao (=E9=BD=90=E5=B0=A7)