From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ED5uLwRnT2co8QIAWB0awg (envelope-from ) for ; Tue, 03 Dec 2024 15:16:04 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Ps3Q6rB3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BED5B1E110; Tue, 3 Dec 2024 15:16:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5F2C81E05C for ; Tue, 3 Dec 2024 15:16:04 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E91A53858C53 for ; Tue, 3 Dec 2024 20:16:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E91A53858C53 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=Ps3Q6rB3 Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id C6DBA3858D26 for ; Tue, 3 Dec 2024 20:15:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6DBA3858D26 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6DBA3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733256931; cv=none; b=bQ0h7voYplJqV0YuuHgKFplegini7871EFCfOF4UangRbYixAoDf3a+PygsmRsxg1CwhguyAGSOB0lvtJ9QzLHgly3JaUwKcv+AAntjpomnWJxDga4X91MC4rAR2xrsuMrHx4i8Hg7+NRxS1u8N8EGOXGfWu9U6uk+yXS+OMTwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733256931; c=relaxed/simple; bh=ltwvTFKyehn+COFlPouR+XauG3sCdFxa0l4DNSO8ZZc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=p5reFTXyUi0ZxpMYEAzvOCUa1BC8yHGNlgnL9mrW74ebjdv8D1IQhyMGI0CT8fbqUSGFwtwmfVUpVyIg7VTsm0K/bve0GvXMftod8mMuOtpB+ZTW2sR0Ev3t7l54VK0+/x09U+R7Ld3S40iwZrNf9asYrLZgYht/obKtBpiKNI4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6DBA3858D26 Received: from eig-obgw-5010a.ext.cloudfilter.net ([10.0.29.199]) by cmsmtp with ESMTPS id IWKwtgd2WrKrbIZIxtyd1h; Tue, 03 Dec 2024 20:15:31 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id IZIwtzIKUJgZJIZIwt60zI; Tue, 03 Dec 2024 20:15:31 +0000 X-Authority-Analysis: v=2.4 cv=DfMRqOtW c=1 sm=1 tr=0 ts=674f66e3 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=RZcAm9yDv7YA:10 a=ItBw4LHWJt0A:10 a=dzWzf_mpAAAA:8 a=DXu4-fAW2lAUlEcsooQA:9 a=b4DR9a7p2ZdsqdHBznES:22 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=fAAUnehF4STtgcU7LNJqYR3tdBuJDQLOEz5ZWM5kh44=; b=Ps3Q6rB38gYgpTF2FINcN7PpCf L2Tu67h44nombTVtlptVN7iOiyamC40+m45/KFPRs2aXY6VlD6fS4ugpNEHySY2bhCpGcDrJdxewI wwwfBeb/yr67kW4Hz8GekjFCg; Received: from 97-122-113-155.hlrn.qwest.net ([97.122.113.155]:59372 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1tIZIv-002rXQ-39; Tue, 03 Dec 2024 13:15:30 -0700 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: restore nullptr check in compunit_symtab::find_call_site In-Reply-To: (Simon Marchi's message of "Tue, 3 Dec 2024 15:05:23 -0500") References: <20241203155223.10203-1-simon.marchi@efficios.com> <87ser4mzbr.fsf@tromey.com> <8cf13692-d876-43d1-bdf1-08cf4429d177@simark.ca> <875xo0mu1m.fsf@tromey.com> X-Attribution: Tom Date: Tue, 03 Dec 2024 13:15:28 -0700 Message-ID: <871pyomskf.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.113.155 X-Source-L: No X-Exim-ID: 1tIZIv-002rXQ-39 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-113-155.hlrn.qwest.net (murgatroyd) [97.122.113.155]:59372 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfMrl31EFDqIIhFAqzXWpuP7fzA59H834SFZP3bMJ641eCA5Qn+8nLR+K7TITSOJPUUrl8RseiLEaVTUPUYCiXYPxxu0DFQysoRo2yWp0k5WCbQdwwmWs YJyDiVUMhKvfPSxU8Ef2mKxlNbD3C+ZZRg3Di1C0xoLx9zI6X1MV14GpjyXxlGzAbAJxbgQeolhs60fb9kTM+2I+LmQd5CAS6JQ= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Simon" == Simon Marchi writes: >> Yeah, that just doesn't seem significantly better to me. It is more >> like a spelling change. Simon> I don't think it's just a spelling change, because a destructor would Simon> invoke the destructor of fields. So I think that if we started invoking Simon> ~compunit_symtab() manually (instead of compunit_symtab::finalize()), Simon> we could start using non-trivially-destructible stuff directly as fields Simon> of compunit_symtab. In other words, m_call_site_htab wouldn't have to Simon> be a pointer anymore. I thought you meant something like 'symtab->m_mumble.~unique_ptr()', as opposed to 'delete symtab->m_mumble'. So I see what you mean, but this also seems less good to me. Currently the obstack allocator prohibits non-trivial destructors, and this is a good thing, because it means it is harder to make a mistake here -- adding a field that requires destruction will cause a compile-time error. I'd be reluctant to lift that restriction. Another way forward is a slab allocator that is type-specific so it knows how to run the destructors. Inheriting from an interface class and keeping objects on a list would also work for this purpose. I somewhat doubt we'll need this kind of thing but it's fine by me if we do. Tom