From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 330B43858D28 for ; Tue, 31 Jan 2023 15:35:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 330B43858D28 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca 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 30VFZTRZ009253 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 10:35:34 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 30VFZTRZ009253 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1675179334; bh=G3w+mMhbI/kJejRnQk7FyXVwEn4Jm9hyWpLj2fRjsJs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=G0QhyDQZxxQm/jwmy91nnJJXhLG+VhbOzvbJ8cNwfBx0EcYQGguqrP6vjlmIAkZ2M fT4l1bf9k7Vr0AbrCb9B5Wp2OUYEgMVvp/WY1ZZPQ6th57AxxQOEuvEGqm3B95sT/p zQdo5NDewiMt+VvhajIDKETwXeKgC2HbIZTJf72U= Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0657C1E0D3; Tue, 31 Jan 2023 10:35:28 -0500 (EST) Message-ID: <4d2c3ae1-d07e-2545-d72b-66d2f3cdfe23@polymtl.ca> Date: Tue, 31 Jan 2023 10:35:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2] gdb/dwarf: dump cooked index contents in cooked_index_functions::dump Content-Language: fr To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Andrew Burgess , Simon Marchi References: <20230130160337.55890-1-simon.marchi@efficios.com> <87a61zvh7a.fsf@redhat.com> <03ff1644-df3d-2e6b-f2aa-49767abc580b@polymtl.ca> <87ilgmn5w7.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87ilgmn5w7.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 31 Jan 2023 15:35:29 +0000 X-Spam-Status: No, score=-3031.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/31/23 09:19, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> See the patch below for a quick prototype. > Simon> quick_symbol_functions::read_partial_symbols now returns a bool, and if > Simon> it returns false (failure), objfile::require_partial_symbols removes > Simon> that quick symbol instance from the qf list. > > I'm working to get rid of this lazy symbol stuff. So I'd rather not add > another meaning to it. You can see the WIP on t/bg-dwarf-reading, but > the basic idea is that instead of delaying the reading of DWARF, start > the reading early and just delay the completion of it. I haven't sent > this yet because it currently crashes, I think it will benefit from > being rebased on the write-index-in-background patch. > > All the other methods in cooked_index_functions already do: > > dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile); > if (per_objfile->per_bfd->index_table == nullptr) > return; Ah ok, I had not seen that. Then it makes sense to follow that paradigm in dump too. > So maybe this would be an ok choice for dump. > > As an aside the code is doing: > > if (per_bfd->index_table == nullptr) > return nullptr; > cooked_index_vector *table > = (gdb::checked_static_cast > (per_bfd->index_table.get ())); > > It seems to me that it would be fine if checked_static_cast passed > through null in this case -- that is, do not assert when the result is > null if the parameter is also null. I think that would make sense. Both static_cast and dynamic_cast return nullptr if passed nullptr, so checked_static_cast should too. However, in my case it would have crashed anyway on the following line dereferencing the table variable. Simon