From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TrImIUGQoGaFFzAAWB0awg (envelope-from ) for ; Wed, 24 Jul 2024 01:25:21 -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=Bae19GyX; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=embpkCK+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=QPXnT2Fu; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=wh0nIbn2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 729AE1E0C3; Wed, 24 Jul 2024 01:25:21 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 24F491E030 for ; Wed, 24 Jul 2024 01:25:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68FFF3858404 for ; Wed, 24 Jul 2024 05:25:18 +0000 (GMT) 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 45E6A3858D29 for ; Wed, 24 Jul 2024 05:24:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 45E6A3858D29 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 45E6A3858D29 Authentication-Results: server2.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=1721798699; cv=none; b=cuF7ZcDoWRs3mDPJIVkmCxRmq0yKKLj9NHu0EjOmmp5IHukM4MtdZOEDcgxvIc7Y/UA12JvnLtvcPlwlbCAcYVvMToz8rbFK6ccVSh2Huf6LPip/YQEShtv5+rtThmslUjKS3nLDEmR2MhMWLGcuNWMZQrxwoqYU6XUf0l1687o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721798699; c=relaxed/simple; bh=+quVXGXWm1n2A0QAULsGLqbXKGJSMpZScMd7IIJF0mk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=XjcGNEIuHaX1+sWsEwtOkcLKA0Xj7VtHAksao+iLxpeVoCLzP0T7aEca3fgE1hVRiV7Ug5MYbLXpAXzu3z4ZBMJvmBeV5EmS8ter9wER2tOWnb5m+Qz4D/s5xFVK1fl1Ccixg/JHbx9ZfybgkuK6nVqk7VIHTOfZOaehzJyvNyg= ARC-Authentication-Results: i=1; server2.sourceware.org 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-out1.suse.de (Postfix) with ESMTPS id CA02421A5C; Wed, 24 Jul 2024 05:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721798695; 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=soeevmoIPwceU8BNnpQhhheGO3KtXYuGPdDE/4iZeBg=; b=Bae19GyXOKF0Cw7C0CTYe6fo1NVn6M87szR0k5Sdd1wM7J18k8m0HsQ9wl/SvWl+oePSjy N+ObK1FqNC+HDOqsTsCgngrcfdzJz6bu1kpTrBruM0eX/uJqA8GfmvAKEfDKCHMt5XNuJr ArDhRWrBWYbgytnjp8bUskQ8mlDcN2k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721798695; 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=soeevmoIPwceU8BNnpQhhheGO3KtXYuGPdDE/4iZeBg=; b=embpkCK+PgNdFHZS6Erebw03jlQ01+czm9x66ZiztKv8nnxBUuFgqDrYgjvy/ypYD4vkX/ fsQ/5/fvCt9vwbCQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=QPXnT2Fu; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wh0nIbn2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721798694; 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=soeevmoIPwceU8BNnpQhhheGO3KtXYuGPdDE/4iZeBg=; b=QPXnT2Fu5G3yWMOrnhuFHjtZRPUt49s1Po5/IYAL15Qh34MC+DLVp5QlIB91wCyfhtjDLa 7SiI/vKzKohiSIHI8lYy7tKD08STfxZvDW3HeJ/eAqlkBrn7KDH717YViCDuMmemO8qvKa qZh5o5RXxzEqTK5vLLDOa4Rbf6ixNV8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721798694; 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=soeevmoIPwceU8BNnpQhhheGO3KtXYuGPdDE/4iZeBg=; b=wh0nIbn2ZBg8QPXFUQsT193PBRHBjSaRmbtPZVUWkXjjvM51MpsKmu6timOwnhAygdAy0r LZ3CXAmu/c559GDQ== 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 AFF701324F; Wed, 24 Jul 2024 05:24:54 +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 Sa4hKSaQoGajGgAAD6G6ig (envelope-from ); Wed, 24 Jul 2024 05:24:54 +0000 Message-ID: <6d4a4345-0247-4c1f-9db3-e0347b475e4b@suse.de> Date: Wed, 24 Jul 2024 07:25:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] [gdb/testsuite] Add xfail in gdb.base/hbreak.exp To: Luis Machado , gdb-patches@sourceware.org References: <20240717151055.21480-1-tdevries@suse.de> <6ad9fbd8-1977-4688-9534-00d1271bba99@arm.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <6ad9fbd8-1977-4688-9534-00d1271bba99@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Rspamd-Queue-Id: CA02421A5C X-Spam-Score: -4.30 X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MX_GOOD(-0.01)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,arm.com:email]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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.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 7/23/24 12:02, Luis Machado wrote: > On 7/17/24 16:14, Luis Machado wrote: >> On 7/17/24 16:10, Tom de Vries wrote: >>> On an aarch64-linux system with 32-bit userland running in a chroot, and using >>> target board unix/mthumb I get: >>> ... >>> (gdb) hbreak hbreak.c:27^M >>> Hardware assisted breakpoint 2 at 0x4004e2: file hbreak.c, line 27.^M >> >> That is a bit odd, but it goes through the compat layer, which is not exercised >> as often as the 32-bit code. >> >> Let me see if I can reproduce this one on my end. > > I managed to reproduce this. I checked with the kernel folks and this should > work, but I'm not sure where the error is coming from. > Hi Luis, thanks for looking into this, and the approval, committed. Are you or the kernel folks following up on this, in terms of a linux kernel PR or some such? It would be nice to add some sort of reference to the xfail. Thanks, - Tom >> >> >>> (gdb) PASS: gdb.base/hbreak.exp: hbreak >>> continue^M >>> Continuing.^M >>> Unexpected error setting breakpoint: Invalid argument.^M >>> (gdb) FAIL: gdb.base/hbreak.exp: continue to break-at-exit after hbreak >>> ... >>> due to this call in arm_linux_nat_target::low_prepare_to_resume: >>> ... >>> if (ptrace (PTRACE_SETHBPREGS, pid, >>> (PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0) >>> perror_with_name (_("Unexpected error setting breakpoint")); >>> ... >>> >>> This problem does not happen if instead we use a 4-byte aligned address. >>> >>> I'm not sure if this is simply unsupported or if there's a kernel bug of some >>> sort, but I don't see what gdb can do about this. >>> >>> Tentatively mark this as xfail. >>> >>> Tested on aarch64-linux. >>> --- >>> gdb/testsuite/gdb.base/hbreak.exp | 40 ++++++++++++++++++++++++++----- >>> 1 file changed, 34 insertions(+), 6 deletions(-) >>> >>> diff --git a/gdb/testsuite/gdb.base/hbreak.exp b/gdb/testsuite/gdb.base/hbreak.exp >>> index 73a3e2afb67..b140257a23e 100644 >>> --- a/gdb/testsuite/gdb.base/hbreak.exp >>> +++ b/gdb/testsuite/gdb.base/hbreak.exp >>> @@ -27,10 +27,38 @@ if ![runto_main] { >>> >>> set breakline [gdb_get_line_number "break-at-exit"] >>> >>> -gdb_test "hbreak ${srcfile}:${breakline}" \ >>> - "Hardware assisted breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*${srcfile}, line ${breakline}\\." \ >>> - "hbreak" >>> +set re_loc "file \[^\r\n\]*$srcfile, line $breakline" >>> +set re_dot [string_to_regexp .] >>> >>> -gdb_test "continue" \ >>> - "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \ >>> - "continue to break-at-exit after hbreak" >>> +set addr 0x0 >>> +gdb_test_multiple "hbreak ${srcfile}:${breakline}" "hbreak" { >>> + -re -wrap "Hardware assisted breakpoint $decimal at ($hex): $re_loc$re_dot" { >>> + set addr $expect_out(1,string) >>> + pass $gdb_test_name >>> + } >>> +} >>> + >>> +set have_xfail 0 >>> +if { [istarget arm*-*-*] } { >>> + # When running 32-bit userland on aarch64 kernel, thumb instructions that >>> + # are not 4-byte aligned may not be supported for setting a hardware >>> + # breakpoint on. >>> + set have_xfail [expr ($addr & 0x2) == 2] >>> +} >>> + >>> +set re_xfail \ >>> + [string_to_regexp \ >>> + "Unexpected error setting breakpoint: Invalid argument."] >>> + >>> +gdb_test_multiple "continue" "continue to break-at-exit after hbreak" { >>> + -re -wrap "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" { >>> + pass $gdb_test_name >>> + } >>> + -re -wrap $re_xfail { >>> + if { $have_xfail } { >>> + xfail $gdb_test_name >>> + } else { >>> + fail $gdb_test_name >>> + } >>> + } >>> +} >>> >>> base-commit: 0ed152c5c6b3c72fc505b331ed77e08b438d643a >> > > In any case, I agree gdb doesn't have a better way to deal with it. > > Approved-By: Luis Machado