From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 2DC863858433 for ; Thu, 18 Jan 2024 10:04:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DC863858433 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2DC863858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705572304; cv=none; b=dv2n9AHmuktxJKkJO5e/Qmi1hWYnTRDNEpF3z/2tFTOBM8WwvhU8FISEDd8dixu7oFYpBTKhYo4/V/31c5W7paZr5EXHG37/hQDTZGWXb91fcKnHb9y676GWJ50sKaFtL+ke1c877ScclVozFgiRlHHoU5559eDnxOeGaMGVyjU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705572304; c=relaxed/simple; bh=tZA3RshC8pdJ4yKE3Aw5jocKIWSo4naYO7zsXDbN+dw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=TUKXXfvCjzeavNTsyRPX7wmiKKh4kTw/K04j0jmyV7Foiz9UGuPkoLoffg/td3sMmaWtoqN4rfnkHT5d7Xkm34NzB5XZiJ+X4G8A29PkQNfA13HSUWpOg0Qy5k0qf4YQsDqvf0LOJEitrB1nDSfDrQQkNmLaKP3GUAATaMT/uFk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E83D41F76E; Thu, 18 Jan 2024 10:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705572293; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+rDUiBUfEdfKJSF7r/4dQEDZ7KdpCiNR67WPnDX+WA=; b=k7i67K3mNQmvYuNLRgbYKrHytUcCzTBsuk0jr/SZXbmYu5IKRGuOS+T0Q70nzYIYK3LQdv nERG2s4kydnuoJLwdmsmDO6lhlZDMN47lC61wTXdFFqCCB36mYUt9Qqc/Or0dn2H0z68br pPN0yD3lJjoVpuN1f9X4XWaA76jPtIU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705572293; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+rDUiBUfEdfKJSF7r/4dQEDZ7KdpCiNR67WPnDX+WA=; b=lJll55AD/07/UFGsVjRfVBc+pRYSzMdSF5TwLI8TnRynXgAEt6+9F9tZ9v49sgeEfjR3hK A/oqEplxQnD7UvCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705572292; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+rDUiBUfEdfKJSF7r/4dQEDZ7KdpCiNR67WPnDX+WA=; b=MNBIZzaaOAo9/yodT33W2RjEVbrnagdAhFjzTAXVO6AqAaNC1aQRgDkXs+pxx305N/N4LT p1jcf+TcU419k/DLYDVB++8EwVsi01Ee2QnzX05qPUKULf8NGjbtDxpB67bXfpRjU61hHd 9qOyn6YfQRMOP/WjFTaHnMEOt+XlR4Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705572292; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h+rDUiBUfEdfKJSF7r/4dQEDZ7KdpCiNR67WPnDX+WA=; b=SC5tZhK2+8/kk0thZs0YM506WZve1dE1sPQ1W/GEv0kxPAcGzMeOJ/gXe6e0kTooIA9eJE nbkCX+dsCczZCNDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CA76E136F5; Thu, 18 Jan 2024 10:04:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4Yf9L8T3qGWXRAAAD6G6ig (envelope-from ); Thu, 18 Jan 2024 10:04:52 +0000 Message-ID: Date: Thu, 18 Jan 2024 11:05:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 00/17] Rewrite .debug_names reader and writer Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org Cc: Eli Zaretskii References: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com> From: Tom de Vries In-Reply-To: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-3.00)[100.00%]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.998]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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/17/24 17:39, Tom Tromey wrote: > This series rewrites gdb's .debug_names reader and writer. > > Currently, gdb can generate a .debug_names index, but the contents are > very wrong -- they use fully-qualified names, which is not at all what > is envisioned in the DWARF spec. > > After this series, the section contents will be much closer to DWARF. > However, it's not really useful for gdb to follow DWARF exactly. > > First, the DWARF spec has a few bugs affecting the generation of the > index. GDB fixes these -- you won't see these fixes in this series, > though, as they were all handled by the new DWARF scanner. > > Second, gdb likes to have some information not readily available in > the DWARF-specified contents. You can see the new DW_IDX_* constants > patch for a list. > > I've regression tested this using the default board and the > cc-with-debug-names board on x86-64 Fedora 38. > I've applied the series and tested on x86-64 openSUSE Leap 15.4, using the default board and cc-with-debug-names. No issues found, other than: ... Running /data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp ... ERROR: tcl error sourcing /data/vries/gdb/src/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp. ERROR: can't read "binfile_stripped": no such variable ... Thanks, - Tom > It's possible that there are regressions with cc-with-debug-names at > some intermediate points in the series -- in particular I think it > would happen after the reader is rewritten but before the writer patch > is applied. I didn't test this situation, since I don't think it is > very important. It could be worked around by combining the two > patches, but I thought that would make review much more difficult. > > --- > Changes in v2: > - Updated some tests > - Reverted change to be strict about requiring .debug_aranges > - Link to v1: https://inbox.sourceware.org/gdb-patches/20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com > > --- > Tom Tromey (17): > Refactor 'maint set dwarf synchronous' handling > Refactor quick-function installation in DWARF reader > Remove IS_ENUM_CLASS from cooked_index_flag > Document GDB extensions to DWARF .debug_names > Add language to cooked_index_entry > Move cooked_index_functions to cooked-index.h > Do not write the index cache from an index > Change cooked_index_worker to abstract base class > Remove cooked_index_worker::start_reading > Empty hash table fix in .debug_names reader > Fix dw2-zero-range.exp when an index is in use > Explicitly expand CUs in dw2-inline-with-lexical-scope.exp > Remove some .debug_names tests > Allow other results in DW_TAG_entry_point test > Rewrite .debug_names reader > Export dwarf5_augmentation > Rewrite .debug_names writer > > gdb/doc/gdb.texinfo | 39 + > gdb/dwarf2/cooked-index.c | 164 +++- > gdb/dwarf2/cooked-index.h | 168 +++- > gdb/dwarf2/index-write.c | 401 ++++----- > gdb/dwarf2/mapped-index.h | 4 +- > gdb/dwarf2/read-debug-names.c | 956 ++++++++------------- > gdb/dwarf2/read-debug-names.h | 2 + > gdb/dwarf2/read.c | 341 ++------ > gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c | 22 - > gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c | 27 - > gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp | 42 - > gdb/testsuite/gdb.dwarf2/clang-debug-names.c | 25 - > gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 42 - > gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl | 121 --- > .../gdb.dwarf2/debug-names-bad-cu-index.exp | 20 +- > gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 5 +- > gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp | 7 + > .../gdb.dwarf2/dw2-inline-with-lexical-scope.exp | 4 + > gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp | 10 + > gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 10 +- > gdb/testsuite/lib/dwarf.exp | 7 +- > 21 files changed, 976 insertions(+), 1441 deletions(-) > --- > base-commit: 2002c0099f9fb4d737930acd66733cfad39f68f1 > change-id: 20231210-debug-names-fix-cfbaf8761ecc > > Best regards,