From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CZxqB9l1hWrXSTAAWB0awg (envelope-from ) for ; Wed, 19 Aug 2026 05:22:33 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TmpHB8Gq; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=zLBcNnBA; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nrMVcWlZ; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=P/KRbdN8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 099891E033; Wed, 19 Aug 2026 05:22:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 468961E033 for ; Wed, 19 Aug 2026 05:22:32 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2263E4BA9034 for ; Wed, 19 Aug 2026 09:22:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2263E4BA9034 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TmpHB8Gq; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=zLBcNnBA; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nrMVcWlZ; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=P/KRbdN8 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 9281D4BA902C for ; Wed, 19 Aug 2026 09:22:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9281D4BA902C 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 9281D4BA902C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787131325; cv=none; b=YY7BUpFGhLp1QE1v1NZiOrw9FYDYSre+w2BlaI9EiWHP9dVBCPUl1wC4bgi2ZNNvzz/zRY9Dk4EPppmoodsV7gjO9RKruGvVi4OcM8Nh6sD0+yMtIarAqB6pHeg4516gVYsm+Q1kJ07yVBfUCgge3sm8/7KV9wcVW7Gdz1Uwv18= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787131325; c=relaxed/simple; bh=FVpRdrVujtJPPV5HCRgmUazhHK7rD6lfPMktGZIcF68=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=KXbGv7xL3VjXvudGtJbVUJuXC4NSqk5RnEsDX2UsJLSc5I4mRvW7tdcWnuH+Lo3BoJRsItDQM2LAj0dkb+AogULl4LulpBku3tWoOBEpQTcPXUc6+kVz9y3JjKrerQSPGKOnzj9G2eU5ZzoQ27tXlyin70R1/HY2o2NMaCBfeRU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TmpHB8Gq; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=zLBcNnBA; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=nrMVcWlZ; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=P/KRbdN8 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9281D4BA902C Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 38CFC3E88 for ; Wed, 19 Aug 2026 09:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787131320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zO+O7AOUzYYsqtRLcPcy6GhhI7k9/bAce/UMcINNnFs=; b=TmpHB8GqyKLPRI243TafAwWVL9WFwqSPBC1sFZaAxdCIHjVkOiIZi62UnmOVMI1jXQYJMP 4oobyq1wOLUTqACrWy8JbTdzWOK7XOZFE4nfLIn/rkih8gHIxwDq3xSznOtZ98ChRszw4X lF86F1Rgng2QPLvOZr6zhMQYfOgOqc0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787131320; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zO+O7AOUzYYsqtRLcPcy6GhhI7k9/bAce/UMcINNnFs=; b=zLBcNnBAZuNlf+IFBO57t7CcOINeEL9pLy6xuVYTLjkkmO0g2zwulMwTsczkEX3M1+RJL7 P2b+JK5JO5ObaaAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nrMVcWlZ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="P/KRbdN8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787131316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zO+O7AOUzYYsqtRLcPcy6GhhI7k9/bAce/UMcINNnFs=; b=nrMVcWlZm+qCuizh7mAjiYWliMGSKf7ia3dDHzJ3TVFHkyvYUUGtSrcnHH0Tb6QgQ4ZGo2 kMQ77TMQERY3X0CqK+zaJ527yw1DVq19J6W6uItighln93Qj1NmbRSFTOGp7v6jBeNdluO Ra3q5ukKEJkEYtnLHG5zJK188oFHE84= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787131316; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zO+O7AOUzYYsqtRLcPcy6GhhI7k9/bAce/UMcINNnFs=; b=P/KRbdN8s5cJg8HAE1fXdPvFJFissu+Wbfb/IBk1zLblutlKPC/gS2T7+sCslNolf2qPkP u3umPPyl7uqfVYBg== 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 241A82F81 for ; Wed, 19 Aug 2026 09:21:56 +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 PwHtBrR1hWqZLAAAD6G6ig (envelope-from ) for ; Wed, 19 Aug 2026 09:21:56 +0000 Message-ID: <9e4b59f1-4ccf-4db1-b1dc-69d9e6c75212@suse.de> Date: Wed, 19 Aug 2026 11:21:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.tui/tailcall-msym.exp on ppc64-linux From: Tom de Vries To: gdb-patches@sourceware.org References: <20260801101542.3131974-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20260801101542.3131974-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[gdb.base:url,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:dkim,gdb.tui:url]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Queue-Id: 38CFC3E88 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/1/26 12:15 PM, Tom de Vries wrote: > On ppc64-linux, with test-case gdb.tui/tailcall-msym.exp I ran into: > ... > FAIL: $exp: status bar says main > ... > > The test-case: > - compiles the source to executable tailcall-msym > - gets some information about addresses > - recompiles the source to assembly > - adds some extra text to the assembly > - compiles the updated assembly into tailcall-msym-updated > > The test-case source contains three functions: main, caller and callee. > > The idea is that the updated executable has the same instructions, but an > additional function dumy_func at the location of the instructions of caller > after the call to callee. > > On x86_64-linux, that looks like this: > ... > 000000000040111d : > 40111d: 55 push %rbp > 40111e: 48 89 e5 mov %rsp,%rbp > 401121: e8 f0 ff ff ff call 401116 > > 0000000000401126 : > 401126: 8b 05 e8 2e 00 00 mov 0x2ee8(%rip),%eax > 40112c: 83 c0 01 add $0x1,%eax > 40112f: 89 05 df 2e 00 00 mov %eax,0x2edf(%rip) > 401135: 8b 05 d9 2e 00 00 mov 0x2ed9(%rip),%eax > 40113b: 83 c0 01 add $0x1,%eax > 40113e: 89 05 d0 2e 00 00 mov %eax,0x2ed0(%rip) > 401144: 90 nop > 401145: 5d pop %rbp > 401146: c3 ret > ... > > On ppc64-linux using the v1 ABI that doesn't work out (because of the complex > way functions are laid out in assembly), and instead caller stays the same, > but main is renamed to dummy_func: > ... > (gdb) p dummy_func > $3 = {} 0x9b0 > (gdb) p main > $4 = {} 0x9b0 > (gdb) > ... > > There's a note in the test-case: > ... > # Emit a new size for function 'caller', the assembler seems happy > # enough to just use this new length instead of the original length > # the compiler emitted. > # > # If this is ever a problem then we'll need to parse through the > # assembler file and remove the original .size directive. > ... > and I tried that out manually, but it didn't help either. > > Fix this by bailing out if not all four functions exist: > ... > UNSUPPORTED: $exp: couldn't find function main > ... > > Likewise in gdb.base/tailcall-msym.exp. > I've pushed this. Thanks, - Tom > Tested on ppc64-linux and x86_64-linux. > --- > gdb/testsuite/gdb.base/tailcall-msym.exp | 19 +++++++++++++++++ > gdb/testsuite/gdb.tui/tailcall-msym.exp | 27 +++++++++++++++++++++--- > 2 files changed, 43 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/tailcall-msym.exp b/gdb/testsuite/gdb.base/tailcall-msym.exp > index d6cd06f88cd..9ffaa7f17c1 100644 > --- a/gdb/testsuite/gdb.base/tailcall-msym.exp > +++ b/gdb/testsuite/gdb.base/tailcall-msym.exp > @@ -132,6 +132,25 @@ if { [prepare_for_testing "prepare" ${testfile}-updated $asm_file {nodebug}] } { > return > } > > +foreach func {caller callee main dummy_func} { > + set re_found \ > + "^$valnum_re = {} $hex <$func>" > + > + set found 0 > + gdb_test_multiple "p $func" "" { > + -re -wrap $re_found { > + set found 1 > + } > + -re -wrap "" { > + } > + } > + > + if {!$found} { > + unsupported "couldn't find function $func" > + return > + } > +} > + > if {![runto callee]} { > return > } > diff --git a/gdb/testsuite/gdb.tui/tailcall-msym.exp b/gdb/testsuite/gdb.tui/tailcall-msym.exp > index 81b52355c01..1e13414f760 100644 > --- a/gdb/testsuite/gdb.tui/tailcall-msym.exp > +++ b/gdb/testsuite/gdb.tui/tailcall-msym.exp > @@ -136,15 +136,36 @@ if { [build_executable "build" $real_testfile $asm_file {nodebug}] } { > > Term::clean_restart 24 80 $real_testfile > > -if {![runto callee]} { > +if {![Term::prepare_for_tui]} { > + unsupported "TUI not supported" > return > } > > -if {![Term::enter_tui]} { > - unsupported "TUI not supported" > +foreach func {caller callee main dummy_func} { > + set re_found \ > + "^$valnum_re = {} $hex <$func>" > + > + set found 0 > + gdb_test_multiple "p $func" "" { > + -re -wrap $re_found { > + set found 1 > + } > + -re -wrap "" { > + } > + } > + > + if {!$found} { > + unsupported "couldn't find function $func" > + return > + } > +} > + > +if {![runto callee]} { > return > } > > +Term::command_no_prompt_prefix "tui enable" > + > # Check the function name on display in the status bar. The interesting > # case here is 'caller', which is a tailcall function in an objfile with > # no debug information. > > base-commit: 5b805c95e9399e35f7bc895ec5b67aabdbc6ce41