From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 724FD3858D1E for ; Wed, 14 Sep 2022 08:36:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 724FD3858D1E 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-out2.suse.de (Postfix) with ESMTPS id A95005CD2E; Wed, 14 Sep 2022 08:36:29 +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 925F713494; Wed, 14 Sep 2022 08:36:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qr1CIo2SIWPfEgAAMHmgww (envelope-from ); Wed, 14 Sep 2022 08:36:29 +0000 Message-ID: <22a9dc8f-d735-4d0a-4523-00ab7555b6ed@suse.de> Date: Wed, 14 Sep 2022 10:36:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH][gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp for aarch64 Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org References: <20220913144800.GA27877@delia> <39e382f2-b0e4-46b0-6745-83f0bfcc1c3d@arm.com> From: Tom de Vries In-Reply-To: <39e382f2-b0e4-46b0-6745-83f0bfcc1c3d@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A, 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 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: Wed, 14 Sep 2022 08:36:33 -0000 On 9/13/22 18:00, Luis Machado wrote: > On 9/13/22 15:48, Tom de Vries wrote: >> Hi, >> >> [ Another attempt at fixing the problem described in commit cd919f5533c >> ("[gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp"). ] > > Tricky one. :-) > It is indeed. I just did a run with cc-with-debug-names target board, and ran into FAILs in the same test-case. I haven't done root cause analysis yet, but my suspicion is that I'll need to add a .debug_aranges entries. >> >> When running the test-case gdb.dwarf2/dw2-dir-file-name.exp with >> aarch64-linux, we run into: >> ... >> (gdb) continue^M >> Continuing.^M >> ^M >> Breakpoint 2, compdir_missing__ldir_missing__file_basename () at \ >>    tmp-dw2-dir-file-name.c:999^M >> (gdb) FAIL: gdb.dwarf2/dw2-dir-file-name.exp: \ >>    compdir_missing__ldir_missing__file_basename: continue to >> breakpoint: \ >>    compdir_missing__ldir_missing__file_basename >> ... >> >> The breakpoint set at compdir_missing__ldir_missing__file_basename_label, >> address 0x400608 starts at a line entry: >> ... >> CU: tmp-dw2-dir-file-name.c: >> File name                    Line number    Starting address >> View    Stmt >> tmp-dw2-dir-file-name.c              999 >> 0x400608               x >> tmp-dw2-dir-file-name.c             1000 >> 0x40062c               x >> tmp-dw2-dir-file-name.c                -            0x40062c >> ... >> and therefore the breakpoint is printed without instruction address. >> >> In contrast, for x86_64-linux, we have the breakpoint printed with >> instruction >> address: >> ... >> (gdb) continue^M >> Continuing.^M >> ^M >> Breakpoint 2, 0x004004c1 in >> compdir_missing__ldir_missing__file_basename () \ >>    at tmp-dw2-dir-file-name.c:999^M >> (gdb) PASS: gdb.dwarf2/dw2-dir-file-name.exp: \ >>    compdir_missing__ldir_missing__file_basename: continue to >> breakpoint: \ >>    compdir_missing__ldir_missing__file_basename >> ... >> >> The breakpoint set at compdir_missing__ldir_missing__file_basename_label, >> address 0x004004c1 doesn't start at a line entry: >> ... >> CU: tmp-dw2-dir-file-name.c: >> File name                    Line number    Starting address >> View    Stmt >> tmp-dw2-dir-file-name.c              999 >> 0x4004bd               x >> tmp-dw2-dir-file-name.c             1000 >> 0x4004d3               x >> tmp-dw2-dir-file-name.c                -            0x4004d3 >> ... >> >> Fix this by: >> - unifying behaviour between the archs by adding an explicit line >> number entry >>    for the address compdir_missing__ldir_missing__file_basename_label, >> making >>    the FAIL reproducible on x86_64-linux. >> - expecting the breakpoint to be printed without instruction address. >> >> Tested on x86_64-linux and aarch64-linux. >> >> Any comments? > > Thanks for the quick patch. > > From my end it looks good, and makes the tests pass again. > Ack, I'll commit today. Thanks, - Tom