From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15259 invoked by alias); 31 Dec 2017 10:12:26 -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 15246 invoked by uid 89); 31 Dec 2017 10:12:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-17.9 required=5.0 tests=BAYES_00,BODY_8BITS,GARBLED_BODY,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=D*ru, H*c:alternative, HX-Received:10.107.136.217 X-HELO: mail-io0-f175.google.com Received: from mail-io0-f175.google.com (HELO mail-io0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 31 Dec 2017 10:12:22 +0000 Received: by mail-io0-f175.google.com with SMTP id 14so38354826iou.2 for ; Sun, 31 Dec 2017 02:12:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/Zc6Ku+GQrFr58UxcPtgsN9P5RxK2VSlun6V5xhCId8=; b=J9Nv0IPb07zxCUIlpgR3ZTcegindzSXuExtBex4N3EJnQHSoAjN1grr5K5AfTLWO9+ am4GBcq7oHbeWnOn8PYg7m/SmQVnuTxABO6g6OZAW/3z3BXngBDeOLPnZcnAUFEhTbSs ioTzlKWYY52rxajR9Ym6iZGkWE1aH+jIbXDMEvh9k9yH8HqvTVwcBzPy/I1xETEl4FnT s3kKZYdjU9L60j0VeFyuhPhzDEkFmBe9gpHcMCSImIg/WKpPppL2wqLQmiZ8+xDUbdxR k8sF2oyI8oSnAZ9unr9tfqmdLe2MEGOzm67VqUtGj1ZupwcIKhAAqbzlD5GUe/atrePn wCpA== X-Gm-Message-State: AKGB3mKdS3Gbz/7XSDx/BeoecHr/EfE0s3uhJlVSj0mfyOAuTsxjLaWr TNUnZB9LIE8xsHgcSCg+btwIFcwuuRS0lY6EaNtixA== X-Google-Smtp-Source: ACJfBothbCG8/kJOuqd339bH05wXmfzRYEcPpSItf7CnPRCckikzwSZDlM2uIn1sRGI4TDCDaxstIBDxDkldN5XhS4w= X-Received: by 10.107.136.217 with SMTP id s86mr54076561ioi.294.1514715140609; Sun, 31 Dec 2017 02:12:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.1.193 with HTTP; Sun, 31 Dec 2017 02:12:20 -0800 (PST) In-Reply-To: References: From: =?UTF-8?B?0J/QsNCy0LXQuyDQmtGA0Y7QutC+0LI=?= Date: Sun, 31 Dec 2017 10:12:00 -0000 Message-ID: Subject: Re: [PATCH] Make dtor of mapped_index_base virtual To: Simon Marchi Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2017-12/txt/msg00537.txt.bz2 Hi Simon > Do you get a build error or something? Yes, I get a build error with Clang: dwarf2read.c:25409:5: error: destructor called on non-final 'mapped_index' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] data->index_table->~mapped_index (); > Since the goal is that we don't delete through a pointer of this class, d= oes the destructor need to be virtual (not that it would hurt anything)? Just to handle the case if someone would delete through a pointer to "mapped_index_base" class. Thanks, -- Pavel 2017-12-31 4:28 GMT+03:00 Simon Marchi : > On 2017-12-30 13:21, =D0=9F=D0=B0=D0=B2=D0=B5=D0=BB =D0=9A=D1=80=D1=8E=D0= =BA=D0=BE=D0=B2 wrote: > >> gdb/Changelog: >> 2017-12-30 Pavel I. Kryukov >> >> * dwarf2read.c (mapped_index_base): Make dtor virtual >> >> diff --git a/gdb/ChangeLog b/gdb/ChangeLog >> index 8555b55..fc4c1b3 100644 >> --- a/gdb/ChangeLog >> +++ b/gdb/ChangeLog >> @@ -1,3 +1,7 @@ >> +2017-12-30 Pavel I. Kryukov >> + >> + * dwarf2read.c (mapped_index_base): Make dtor virtual >> + >> 2017-12-28 Simon Marchi >> >> * target.h (enum target_object) > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c >> index 484cbce..3ac4380 100644 >> --- a/gdb/dwarf2read.c >> +++ b/gdb/dwarf2read.c >> @@ -272,7 +272,7 @@ struct mapped_index_base >> >> /* Prevent deleting/destroying via a base class pointer. */ >> protected: >> - ~mapped_index_base() =3D default; >> + virtual ~mapped_index_base() =3D default; >> }; >> >> /* A description of the mapped index. The file format is described in >> -- >> 2.7.4 >> > > Hi Pavel, > > Can you clarify what you are trying to fix/improve with this patch? Since > the goal is that we don't delete through a pointer of this class, does the > destructor need to be virtual (not that it would hurt anything)? Do you > get a build error or something? > > Simon >