From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jCIQMVyGDWayrSEAWB0awg (envelope-from ) for ; Wed, 03 Apr 2024 12:39:56 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=LpTXVJhB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C14A31E0C0; Wed, 3 Apr 2024 12:39:56 -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 8568F1E030 for ; Wed, 3 Apr 2024 12:39:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40E7D384772F for ; Wed, 3 Apr 2024 16:39:54 +0000 (GMT) Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 1A37C3858401 for ; Wed, 3 Apr 2024 16:39:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A37C3858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A37C3858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712162378; cv=none; b=hPuSXkrAxaIqXxfg8SNkKdm4Z2UGYG+4MAl/YB4RqYihDt2m8kponwNuEyEYbublUEhqZaGswWRrC8xlb7W7SXijXRzvIqj8GpeA8VcGnbcKlNhnZ58dEGbxQYvvUKV3NfWWqoIWlrkGtvca+NL3WAbivd/LgFw8q9hgbOOwmGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712162378; c=relaxed/simple; bh=hg4IigERXemM0/p4dS5113f19Yy/B0yjrXmLKwgHgvg=; h=DKIM-Signature:Subject:To:From:Message-ID:Date:MIME-Version; b=jCjroq45HcOKhpozJSDsdM6ZTCHibaM6SjMV+OLy51LnCQ0C8RP/q/vCM8Z/ueJ6GTGzqmciaMiDiY+TUN7goj1mQaoGsHQnoZ5tx8Cl+KeonwpJbLbN0n/9Qn9onvq2JsKpUFWh7o+TgpQoT6ciPt1s9PuKaj/7L+pMC+mqWko= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1e0edd0340fso59272925ad.2 for ; Wed, 03 Apr 2024 09:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712162372; x=1712767172; darn=sourceware.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=34uNwELNu/81LLLbJ46xut0Xwfc++bWsSXgRdI8KqyY=; b=LpTXVJhBvECz5AQJB/hs6KIOoPfLOFISWAyuLnw2xeTkQklJPMm2G5QzvayapK8l/Y Wx7YYCvUrZT1j+gUUYgMTMelCdVRzF+49Ja8U7jqa/pZ6tRs21o5LPNXmViS63RYI165 JzFOFOitHJDO7/Yc2RELht7hi2uJ7EYv74c1qEfwwHp3yC2s3ZzJyE0Cs+H1d0acwCcH 8ug+l+W0vCMo048QFavtkmdyeJ4i75aD8yi8p1VpLKyaWOKr12jCWczvRTbAJcvTK9WN YwXroOPpHPMlU5FvwiRtl28gH470Ucxag9woFNi8OpEppPtaMs+gPkuQ9kD7znQ4+oBu hNew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712162372; x=1712767172; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=34uNwELNu/81LLLbJ46xut0Xwfc++bWsSXgRdI8KqyY=; b=pMjwFzzZS9ESiE/tYY6hyPoXjgBxWyIQpWV+Wi7qxeGOmPsmlRdkau+ZTqgnVcYKXg gSgo8SVQCG78+BqzGySHI7iG/+RYoSOJx54sGCup+vdkhpQkqTxq2Cp3n0zA/iK62xMM 9P7aRSYKRlg6VksG7B3uLPBXWcwM133IbVfCBBhKEoUl2fBpU0vnVC8fE3+qbaUyXq5G mxWcZ/ToNDjPkp/cBoBSFOvVYlXYyGr6byloykKfSSD5t1ANXk/wdL+YLe5+A1rJpFD7 yOstLH3h8iio/alwNanmNsgT1GHFR4Rm7v1ZoR6ewVxjeMTZlOyjXEwofxU9QFdSFbLZ a5Xw== X-Gm-Message-State: AOJu0YwmbNGfAXscd/yqipjAQfba4v2dwQANcaLAZRjx9Yp9wNxVRL+3 9f/Hl5T6ETFjo/UhlwZLhscameF8Sing4O+B0vXFDRykB0J2Yuy9zeoL14+aYb/QIJa+swzMVvr i X-Google-Smtp-Source: AGHT+IEgB5sBqC6iV3+LgafSeE55amZio5omFab+b9ODebKq9xmBJpt8xM2XY4C/ciDChBcQZJ2Czg== X-Received: by 2002:a17:903:2345:b0:1e2:6165:8088 with SMTP id c5-20020a170903234500b001e261658088mr9238991plh.11.1712162372511; Wed, 03 Apr 2024 09:39:32 -0700 (PDT) Received: from [192.168.20.108] (201-68-109-119.dsl.telesp.net.br. [201.68.109.119]) by smtp.gmail.com with ESMTPSA id iw18-20020a170903045200b001e293a6ec19sm1728525plb.230.2024.04.03.09.39.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Apr 2024 09:39:32 -0700 (PDT) Subject: Re: [PATCH v2 4/4] gdb: Add new remote packet to check if address is tagged To: Luis Machado , Thiago Jung Bauermann Cc: gdb-patches@sourceware.org References: <20240328224850.2785280-1-gustavo.romero@linaro.org> <20240328224850.2785280-5-gustavo.romero@linaro.org> <87r0fs76wm.fsf@linaro.org> <9be4c93e-6f02-4171-8dcd-ed262ffc6d69@arm.com> From: Gustavo Romero Message-ID: <99d1b18f-7581-d754-29af-a0d3d4cfee18@linaro.org> Date: Wed, 3 Apr 2024 13:39:28 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <9be4c93e-6f02-4171-8dcd-ed262ffc6d69@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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 Hi Thiago, Luis On 4/3/24 11:04 AM, Luis Machado wrote: > On 3/30/24 03:08, Thiago Jung Bauermann wrote: >> >> Just one more suggestion that occurred to me later: >> >> Gustavo Romero writes: >> >>> For supporting the new packet, a new target hook is introduced, >>> check_memtag_addr, which is used instead of the gdbarch_tagged_address_p >>> gdbarch hook in the upper layers (printcmd.c). >> >> "check_memtag_addr" is a bit vague: what does it check? This confused me >> a bit when I was reading the code with these patches >> applied. Alternatives I can think of are "is_addr_tagged", or >> "tagged_address_p". > > That last bit seems more in line with the gdb terminology. A target took "tagged_address_p" or "target_is_address_tagged" should be a bit more clear. > > Plus we have precedent in the target hooks is_async_p, can_async_p, always_non_stop_p etc. > >> >> I'm not too fond of the "_p" suffix, but it has the advantage of being >> consistent with the existing gdbarch hook so it may be preferable in >> this case. So, I really thought of something like the is_address_tagged at first, without the _p suffix because I thought this suffix would be present only in gdbarch hooks, not in the target hooks, but that seems not right, which is still a bit confusing to me tbh, because I have this in mind: /* MTE-specific settings and hooks. */ if (tdep->has_mte ()) { /* Register a hook for checking if an address is tagged or not. */ set_gdbarch_tagged_address_p (gdbarch, aarch64_linux_tagged_address_p); which I understand that functions with _p would be the functions to be set as the hooks for the gdbarch hooks only, using the set_gdbarch_* "API" functions. That, afaics, doesn't happen for the target hooks, like is_async_p, which is never explicitly set to any hook using a set_* function (so I'm also not fond of the _p in the is_async_p case too). Anyways, I'm going for "target_is_address_tagged", which I think is the clearest option and we all seem to agree on it :) Thanks! Cheers, Gustavo