From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KqC4D3zHbWqN6zoAWB0awg (envelope-from ) for ; Sat, 01 Aug 2026 06:16:28 -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=H4oqYVc+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=mIkPwfRY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=NNBXd47I; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=i/LFeL0M; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 268541E09E; Sat, 01 Aug 2026 06:16:28 -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 A81891E099 for ; Sat, 01 Aug 2026 06:16:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 111474C3189F for ; Sat, 1 Aug 2026 10:16:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 111474C3189F 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=H4oqYVc+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=mIkPwfRY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=NNBXd47I; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=i/LFeL0M Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 123D24C31814 for ; Sat, 1 Aug 2026 10:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 123D24C31814 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 123D24C31814 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785579353; cv=none; b=htZhbJ2tGmsazhU/AUbADwOUJveVmoaU953zr2aAqhEFWd4VMTWJXGLP6/Y3k34NtuWpFnuWb8qLQXg26q/ucSHBdUfRF/zMOJKFR7h9qwQtrQEQINlUJuIWesK7r5RCjrVSpJ0N2z6vt5XSfwqZWULU9e2FzkFme4F+xxlCp5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785579353; c=relaxed/simple; bh=49WoV6PP25X5Pk9mCyaUHMP4nIUMtuyo5yIV5XfF4gM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=orOjpzi2wqu5q99PuMUO15YkyaVv/1M0omZR+3M6YpRRJRAcMfos9CV9ZNxPD0Y1X52tA2Kf3g3jiEsoo6TY69tmxLFzd9Nzhc8nNe7ZrcOLNFvnTn3PH79yqp5Xvi5aEnElYCOINBageEaOqj8gxl5oW727WAOQ/iakWxjBD8E= 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=H4oqYVc+; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=mIkPwfRY; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=NNBXd47I; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=i/LFeL0M DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 123D24C31814 Received: from imap1.dmz-prg2.suse.org (unknown [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 84C5C40BF for ; Sat, 1 Aug 2026 10:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785579347; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xUDkecSV5E/Mdj8tErU0LSDUkHRrd86drWzy1Fs+j5M=; b=H4oqYVc+S9A6ZQZSoQRXbpEacwqC9KDJ08B3cTRE9WUYCaWaRP6kOnbk4P2EqFXpXtEX1l 6gkMSqV96/b31edp4k4nYhFqIFOsmpx+857FzLs1r9P1/I6DL91saZNqLmQq2BrA8lzWkD jpbY6WghpfhVw2xshFGus0umHJW2LDw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785579347; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xUDkecSV5E/Mdj8tErU0LSDUkHRrd86drWzy1Fs+j5M=; b=mIkPwfRYZsYupgWzQBOqwarlDJFVKRZYU0kfxJQRC6UtTakP27GsGXTEbq/6hu27JppL2u q1n+IMivUujqGOCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785579343; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xUDkecSV5E/Mdj8tErU0LSDUkHRrd86drWzy1Fs+j5M=; b=NNBXd47IItfeaEkIyz0UEk20fKI+/LYZkXwPCdf7AkBuYFglehaCVkbslWGypVvVycMjRm CTvWd01kRXi+LAiPTo7dYoYsRqjiZFROsQvddWAoFfNro/ErD+qdi4jqY8YAl6SiwA65mQ aFlStVD7G9XZ/CarqEvldw59Ho1bgLk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785579343; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xUDkecSV5E/Mdj8tErU0LSDUkHRrd86drWzy1Fs+j5M=; b=i/LFeL0MsaT2x0oIJtJbKEoQsTVWsZAnsSnr4l7WP2eSNXNMo2ORMFeT9YGgb0CVZuvEVW 2RBWwZV8qOclXGDA== 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 6EE2A779BF for ; Sat, 1 Aug 2026 10:15:43 +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 h4qkGU/HbWpzTwAAD6G6ig (envelope-from ) for ; Sat, 01 Aug 2026 10:15:43 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix gdb.tui/tailcall-msym.exp on ppc64-linux Date: Sat, 1 Aug 2026 12:15:42 +0200 Message-ID: <20260801101542.3131974-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.79 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.19)[-0.965]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; URIBL_BLOCKED(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; 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]; RCVD_TLS_ALL(0.00)[] 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 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. 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 -- 2.51.0