From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eQPUHj2W42o8Pw4AWB0awg (envelope-from ) for ; Thu, 29 Oct 2026 14:53:49 -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=g5o+ngO3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=g5o+ngO3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 779811E06B; Thu, 29 Oct 2026 14:53:49 -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 [IPv6:2620:52:6:3111::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 A17AF1E007 for ; Thu, 29 Oct 2026 14:53:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3017B4BA79BA for ; Thu, 29 Oct 2026 18:53:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3017B4BA79BA 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=g5o+ngO3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=g5o+ngO3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 554E24BA79AC for ; Thu, 29 Oct 2026 18:53:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 554E24BA79AC 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 554E24BA79AC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793300000; cv=none; b=hoHMagbah2EVoi2SUeVKwt/ZR8TqQK3f1j9j3bjBWdfyMJrVZ0m9JmUtapZtOEcq+J0k9CAaOJVTI7JdxilwDoRJDpCN6pJl9ubDkOFwVKqSff7j+WXSsa2FPPrHKR4bmBxg1EFZpyESIzx0tljyTpezeDxccEaKA9NqJFdzCzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793300000; c=relaxed/simple; bh=YGmUTKuDiEoEuoRDYW5UAiUo1GJ0V7f+CCDBSu3wAD4=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=jGrZPpbAjc8QWI9da5WWi50kiQPPfKkYd0XW2uzrANE0o0/pCkcsVe6z19epsww11WZ7W3vFvjgRNrnPdzK2ZoydbTTDqXkZO4V7x5U8dD/4+fNvOO94EEZBpcCTtcJuqyE9ppG4ah87yA2Vng+shaykkzojs+ijsvShcjcalB0= 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=g5o+ngO3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=g5o+ngO3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=2YVvx1Jw DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 554E24BA79AC 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-out1.suse.de (Postfix) with ESMTPS id 4C672221E7 for ; Thu, 29 Oct 2026 18:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1793299998; 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=aAXIBKdDpeO7lHefmW7nhUSW2VZvTFFAqbmlKPK9j+g=; b=g5o+ngO30GDA7yZDUkbWCDMsTUQXYw9RgpEfw9/zQNt+LAiKsok5y/UKat4t8e55yRwwW0 aLabN9tWl1KJknrx32kNfSpoOnrFO0BBzV7moaIPM4fOuhmRyg7Vht2seK1w/FEYlGQGaN git2+TKRyVHrjzMUrMomXaHpiIyYq8o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1793299998; 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=aAXIBKdDpeO7lHefmW7nhUSW2VZvTFFAqbmlKPK9j+g=; b=2YVvx1JwM5wtNn0pXAW9PHvL0ExHFRMKI5HAjyUBHF+Gijr0wu0BrrM2eXnQ41dCA7m0rg M/g0f363q1u2tcAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1793299998; 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=aAXIBKdDpeO7lHefmW7nhUSW2VZvTFFAqbmlKPK9j+g=; b=g5o+ngO30GDA7yZDUkbWCDMsTUQXYw9RgpEfw9/zQNt+LAiKsok5y/UKat4t8e55yRwwW0 aLabN9tWl1KJknrx32kNfSpoOnrFO0BBzV7moaIPM4fOuhmRyg7Vht2seK1w/FEYlGQGaN git2+TKRyVHrjzMUrMomXaHpiIyYq8o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1793299998; 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=aAXIBKdDpeO7lHefmW7nhUSW2VZvTFFAqbmlKPK9j+g=; b=2YVvx1JwM5wtNn0pXAW9PHvL0ExHFRMKI5HAjyUBHF+Gijr0wu0BrrM2eXnQ41dCA7m0rg M/g0f363q1u2tcAA== 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 1E0EA13419 for ; Thu, 29 Oct 2026 18:53:18 +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 24NXOx2W42qGWAAAD6G6ig (envelope-from ) for ; Thu, 29 Oct 2026 18:53:18 +0000 Message-ID: <9ef9c70b-e4a9-45be-bce0-5d14e1a88967@suse.de> Date: Thu, 29 Oct 2026 19:53:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.mi/pr11022.exp on big endian From: Tom de Vries To: gdb-patches@sourceware.org References: <20261028231313.1835272-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20261028231313.1835272-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-13.28 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-0.99)[-0.991]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; 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)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,gnu.org:url] 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 10/29/26 12:13 AM, Tom de Vries wrote: > On s390x-linux, with test-case gdb.mi/pr11022.exp I run into: > ... > FAIL: $exp: data-write-memory-bytes &x "01": \ > watchpoint hit 2 (unknown output after running) > ... > > The problem is that we're writing a byte to the start address of an int, > which gets different results on big and little endian. > > Fix this by writing to an int8_t instead. > > Likewise, make sure that the 4-byte write writes to a 4-byte int by using > int32_t instead of int. > > While we're at it, reduce unnecessary escaping. > In retrospect perhaps it was not the best idea to submit this as one patch. I'll try to split it up into two patches, one simplification patch, and one fix. Thanks, - Tom > Tested on x86_64-linux and s390x-linux. > --- > gdb/testsuite/gdb.mi/pr11022.c | 7 +++++-- > gdb/testsuite/gdb.mi/pr11022.exp | 31 ++++++++++++++++++++----------- > 2 files changed, 25 insertions(+), 13 deletions(-) > > diff --git a/gdb/testsuite/gdb.mi/pr11022.c b/gdb/testsuite/gdb.mi/pr11022.c > index 676506c2849..240f50b8750 100644 > --- a/gdb/testsuite/gdb.mi/pr11022.c > +++ b/gdb/testsuite/gdb.mi/pr11022.c > @@ -15,7 +15,10 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . */ > > -int x; > +#include > + > +int32_t x; > +int8_t b; > > int > main () > @@ -24,7 +27,7 @@ main () > > for (i = 0; i < 500; ++i) { > j = 0; /* break here */ > - x = 42; > + x = b = 42; > j = i; /* expect HW watchpoint stop */ > } > return 0; > diff --git a/gdb/testsuite/gdb.mi/pr11022.exp b/gdb/testsuite/gdb.mi/pr11022.exp > index 35e31af95b1..b72db25a270 100644 > --- a/gdb/testsuite/gdb.mi/pr11022.exp > +++ b/gdb/testsuite/gdb.mi/pr11022.exp > @@ -25,7 +25,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb > return > } > > -proc test_memory_changed_observer { mi_command } { > +proc test_memory_changed_observer { var mi_command } { > with_test_prefix "${mi_command}" { > global srcfile binfile > > @@ -37,29 +37,38 @@ proc test_memory_changed_observer { mi_command } { > {\^done,bkpt=.number="2",type="breakpoint".*\}} \ > "set breakpoint" > > - mi_gdb_test "watch x" ".*" "set watchpoint" > + mi_gdb_test "watch $var" ".*" "set watchpoint" > > mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \ > - { "" "disp=\"keep\"" } "breakpoint hit" > + { "" {disp="keep"} } "breakpoint hit" > + > + set re_0 {0( '[^\r\n]*')?} > + set re_1 {1( '[^\r\n]*')?} > + set re_42 {42( '[^\r\n]*')?} > > mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \ > - { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"0\",new=\"42\"\}" } \ > + [list \ > + "" \ > + [subst_vars \ > + {wpt={number="3",exp="$var"},value={old="$re_0",new="$re_42"}}]] \ > "watchpoint hit" > > mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*" ".*" \ > - { "" "disp=\"keep\"" } "breakpoint hit 2" > + { "" {disp="keep"} } "breakpoint hit 2" > > - mi_gdb_test "-${mi_command}" {\^done} "set x" > + mi_gdb_test "-${mi_command}" {\^done} "set $var" > > mi_execute_to "exec-continue" "watchpoint-trigger" "main" "" ".*" ".*" \ > - { "" "wpt=\{number=\"3\",exp=\"x\"\},value=\{old=\"1\",new=\"42\"\}" } \ > + [list \ > + "" \ > + [subst_vars \ > + {wpt={number="3",exp="$var"},value={old="$re_1",new="$re_42"}}]] \ > "watchpoint hit 2" > > mi_gdb_exit > } > } > > -test_memory_changed_observer "data-write-memory-bytes &x \"01\"" > -# We want to trigger a target memory write here, so the word size (4 or 8) > -# is not that important. > -test_memory_changed_observer "data-write-memory &x x 4 \"01\"" > +test_memory_changed_observer b {data-write-memory-bytes &b "01"} > + > +test_memory_changed_observer x {data-write-memory &x x 4 "01"} > > base-commit: aeed64b39aed57729f66ad51560d8964e8201e6e