From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UiEUJl412WPgTiYAWB0awg (envelope-from ) for ; Tue, 31 Jan 2023 10:35:58 -0500 Received: by simark.ca (Postfix, from userid 112) id 8B1151E128; Tue, 31 Jan 2023 10:35:58 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=iUiwXB0S; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 326221E0D3 for ; Tue, 31 Jan 2023 10:35:58 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80F123858C2B for ; Tue, 31 Jan 2023 15:35:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80F123858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675179356; bh=G3w+mMhbI/kJejRnQk7FyXVwEn4Jm9hyWpLj2fRjsJs=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=iUiwXB0SfkLXbSm1sEpj5+kmFyag5WOK7q35SvBFMhZekZeVyy1GojEpmQtl4GYT8 4BYgWRlisyC2MkqQqZU6GVOO7XSkXtwco0sugU91+YWQsoePqHRuB3dk4x+UnJv+0J R1B+l/KIuEFxWDCApnq9qWFA4Q5lAaJcWzPiyj+M= 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 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 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> 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-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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