From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /W1jIYDr12NFayUAWB0awg (envelope-from ) for ; Mon, 30 Jan 2023 11:08:32 -0500 Received: by simark.ca (Postfix, from userid 112) id 7AB6F1E128; Mon, 30 Jan 2023 11:08:32 -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=Q2kv26q4; 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=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1E6901E112 for ; Mon, 30 Jan 2023 11:08:32 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 447A63858C2F for ; Mon, 30 Jan 2023 16:08:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 447A63858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675094911; bh=ycrI2gnUUJX7Uephlpmm+M2IguVdSMrVXINHKkDSxlU=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Q2kv26q4lxZVNKuhdSpSb0ujIbPbb6OFM+lCkhusyHQmps4oFV/3OQ4OXzaHQkgUp 7Ul/0xZ2TcEkAfhYpA9HMTtfETGe4Qg0m6c3Y5DuereEbx5WWNf6K+hvFVl5QIuwN5 idqpIRlh9mQOYN0L7H6Q6QyrlAksyn/ifG4WS+dk= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 2476A3858D28 for ; Mon, 30 Jan 2023 16:08:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2476A3858D28 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 30UG831x032092 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 11:08:07 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 30UG831x032092 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 1853C1E112; Mon, 30 Jan 2023 11:08:03 -0500 (EST) Message-ID: <44127e38-4aa2-a41e-a4c5-1641b61a8143@polymtl.ca> Date: Mon, 30 Jan 2023 11:08:02 -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: Simon Marchi , gdb-patches@sourceware.org References: <20230130160337.55890-1-simon.marchi@efficios.com> In-Reply-To: <20230130160337.55890-1-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 30 Jan 2023 16:08:03 +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/30/23 11:03, Simon Marchi wrote: > From: Simon Marchi > > New in v2: > > - move the implementation to the cooked_index_vector class > - use the gdbarch from the objfile > - add some QUIT macro calls > - add call to wait, to ensure the index is finished > > As I am investigating a crash I see with the cooked index, I thought it > would be useful to have a way to dump the index contents. For those not > too familiar with it (that includes me), it can help get a feel of what > it contains and how it is structured. > > The cooked_index_functions::dump function is called as part of the > "maintenance print objfiles" command. I tried to make the output > well structured and indented to help readability, as this prints a lot > of text. > > The dump function first dumps all cooked index entries, like this: > > [25] ((cooked_index_entry *) 0x621000121220) > name: __ioinit > canonical: __ioinit > DWARF tag: DW_TAG_variable > flags: 0x2 [IS_STATIC] > DIE offset: 0x21a4 > parent: ((cooked_index_entry *) 0x6210000f9610) [std] > > Then the information about the main symbol: > > main: ((cooked_index_entry *) 0x621000123b40) [main] > > And finally the address map contents: > > [1] ((addrmap *) 0x6210000f7910) > > [0x0] ((dwarf2_per_cu_data *) 0) > [0x118a] ((dwarf2_per_cu_data *) 0x60c000007f00) > [0x1cc7] ((dwarf2_per_cu_data *) 0) > [0x1cc8] ((dwarf2_per_cu_data *) 0x60c000007f00) > [0x1cdf] ((dwarf2_per_cu_data *) 0) > [0x1ce0] ((dwarf2_per_cu_data *) 0x60c000007f00) > > The display of address maps above could probably be improved, to show it > more as ranges, but I think this is a reasonable start. > > Note that this patch depends on Pedro Alves' patch "enum_flags > to_string" [1]. If my patch is to be merged before Pedro's series, I > will cherry-pick this patch from his series and merge it before mine. > > [1] https://inbox.sourceware.org/gdb-patches/20221212203101.1034916-8-pedro@palves.net/ I just realized, this patch also depends on the following patch: [PATCH v2] Make addrmap const-correct in cooked index https://inbox.sourceware.org/gdb-patches/20230130152936.41750-1-simon.marchi@efficios.com/T/#u Simon