From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 455B7385800C for ; Sat, 6 Nov 2021 12:25:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 455B7385800C Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 59408212B9; Sat, 6 Nov 2021 12:25:11 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3AEBE13ABE; Sat, 6 Nov 2021 12:25:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id A5aXDCd0hmFUPQAAMHmgww (envelope-from ); Sat, 06 Nov 2021 12:25:11 +0000 Subject: Re: [PATCH v2 00/32] Rewrite the DWARF "partial" reader To: Tom Tromey , gdb-patches@sourceware.org References: <20211104180907.2360627-1-tom@tromey.com> From: Tom de Vries Message-ID: <4a288a6a-63c4-e36e-da20-01ae3fd0955c@suse.de> Date: Sat, 6 Nov 2021 13:25:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20211104180907.2360627-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Sat, 06 Nov 2021 12:25:15 -0000 On 11/4/21 7:08 PM, Tom Tromey wrote: > Here is v2 of my series to rewrit the DWARF partial symbol reader. > > You can find v1 here: > > https://sourceware.org/pipermail/gdb-patches/2021-August/181624.html > > This update addresses all the review comments. I believe it fixes all > the problems that Tom de Vries found. > > I regression tested this on x86-64 Fedora 34. > I regression tested this on openSUSE Leap 15.2 x86_64 and got only known FAILs: ... FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone (timeout) FAIL: gdb.cp/no-dmgl-verbose.exp: setting breakpoint at 'f(std::string)' FAIL: gdb.go/package.exp: setting breakpoint at package2.Foo FAIL: gdb.go/package.exp: going to first breakpoint (the program exited) ... So that looks great :) Then I tried an experiment with parsing all .debug files installed on the system which happens to be 636 files, totaling at 4.8 GB. More concretely, I ran this command in a file loop: ... $ for f in $(find /usr/lib/debug/ -name "*.debug" | grep -v build-id); do echo "Loading $f"; gdb -q -batch $f; done 2>&1 | tee LOG ... My idea was to compare execution times, but instead I ran into some trouble (while using master instead, everything worked fine). This triggered a fair amount of times: ... $ grep -c "has duplicate debug_info_offset 0x0, ignoring .debug_aranges" LOG 40 ... as well as: ... $ grep -c "DW_FORM_GNU_strp_alt used without .debug_str" LOG 16 ... I managed to reproduce both with a hello world, like so: ... $ cat ./hello.c #include int main (void) { printf ("hello00000000000000000000000000000000000000000000000000000000000000000000\n"); return 0; } $ gcc ./hello.c -g $ cp a.out b.out $ dwz -m c.out a.out b.out $ gdb -q -batch a.out warning: Section .debug_aranges in /home/vries/gdb_versions/devel/a.out has duplicate debug_info_offset 0x0, ignoring .debug_aranges. DW_FORM_GNU_strp_alt used without .debug_str section [in module /home/vries/gdb_versions/devel/c.out] ... The latter may or may not trigger, and disappears with "maint set worker-thread 0". The exec seems sane. The .debug_aranges section does not have duplicates, and does not contain a .debug_info offset 0x0: ... $ readelf -wr a.out | egrep "debug_aranges|Offset into" Contents of the .debug_aranges section: Offset into .debug_info: 0x1f Offset into .debug_info: 0x4d Offset into .debug_info: 0x87 Offset into .debug_info: 0xa9 Offset into .debug_info: 0xf5 Offset into .debug_info: 0x1ce ... The a.out indeed doesn't have a .debug_str, but the .gnu_debuglink file c.out does: ... $ readelf -S -W a.out | grep debug_str $ $ readelf -S -W c.out | grep debug_str [ 5] .debug_str PROGBITS 0000000000000000 0005a1 0005fe 01 MS 0 0 1 $ ... I managed to reproduce both problems using system compiler gcc 7.5.0 and gcc 11.2.1. [ If you have trouble reproducing this, maybe the target boards cc-with-dwz and cc-with-dwz-m will help. ] Thanks, - Tom > Let me know what you think. > > Tom > >