From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QFBBGrtNDmaMySIAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 02:50:35 -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=z6EJ4RZA; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 66CEC1E0C0; Thu, 4 Apr 2024 02:50:35 -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 54DD41E08C for ; Thu, 4 Apr 2024 02:50:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F103A3858C50 for ; Thu, 4 Apr 2024 06:50:32 +0000 (GMT) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id CDACE3858C32 for ; Thu, 4 Apr 2024 06:48:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CDACE3858C32 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 CDACE3858C32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712213336; cv=none; b=ZD84y9HpdFzJTReUJSXGosiub3CQW19A7GCVH8eriscLuxzeXt49BK7k+YrPOmbmUgC4jqQx3znvzLXEGS3vaVx5SCkJxHsWy30Bi0EcxY/AkirFQ5Uy7TfwurZeGT3b2nGB8k+OgbMEWTgxjXBnXS7eGRrZtSB/PExVG0hwbQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712213336; c=relaxed/simple; bh=biB/Jfk29K6e4bngrml/SPgQBP6fEkIBiEIcROOxMhU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=EugjnrosbqB93TlTawX39GPKoYjgREgkt6YEZFiTjkdmeA1GzBjEiDuUs0qnhWmcNgPiCQoHvp7n1rWEGDPyejjIf5AzVIrbEmwN2CIfalgiV0j84/szyKVcs9fiYuLkPqUec2c7a0y+QAUA5ngpFIcMmJvAW/TfVDixT8aoRjs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3c5d50e190bso371273b6e.2 for ; Wed, 03 Apr 2024 23:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712213332; x=1712818132; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Qsh8ZoUkD9tLuOVPgVN9rMDq0Yb6rVyAgck6A3Y+ReI=; b=z6EJ4RZAXLQeMwT3Ppof8s4KbJKwkXAfHK6UFO2IvjP3sRMwo+G6dV9DqZbrGwmFHa Cwa6ifP/KnUNDg1nJHdP/NQO1B2l7CUwdknBGDzbuydGAL0Y4FmjodoXbxLWFMmH0ljw 7NglU1Pl3fL/2WfE6TIoJeG9F69K4WS9flNotQoQmD9hROT+hgVkhAaYgXiQN57krgGt o3YRMGbRasS49/V0BNaB/xp620FJaE4cogSE/pZ/NNV0ZEqk0gAdePUw7vIz36+sLFVY x9q05lFF+lkeOGEI9LK9Dir+zWt//RyPY8Auy0400cvX1VsfSPKp8N7VNitXTml4Vkdn zwoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712213332; x=1712818132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qsh8ZoUkD9tLuOVPgVN9rMDq0Yb6rVyAgck6A3Y+ReI=; b=aP+jlVhbRPudywN/XKNocV/DaAOLi6vsUt2RKCnLoBn6U4bhp1cgcZZNgiRW0wRuH4 8GiXn97ZnN243YCSZYjT/8yZzmCh+De72N1Pxuhkaf16OoaG2grO1vq5BZLbNIDyy9Dl 62lemRKZuubWfAq9VVvpfXV3CWlznad3GZ/duOGwxs8as6n0xWYjL3IalLGnMUee0sk6 XWRglBsy3eMpFEX47TtoOahWSC+FthXqrpEwQ7We9M4dGt5BBJ0KqLsBxCdCwScsvBQN THSI87icoSQVh8gOGLzSZdQqKcIXvh4aDmBp1orUKQMmlSL/WZGK1wKobN/V6nZHGgAe JXQg== X-Gm-Message-State: AOJu0Yy4ehPZ7We1Tz8Wn3qQygECvAlUnQOilAkrrAwgM9Gd1CpBoLRv e0kH5AFCWT877Cx3+qe/1M58BBQiXuLSv4t2aRqj0BhGta86+0KvciqyuDoVqekzZZK40IudxS1 c X-Google-Smtp-Source: AGHT+IGB9joi3HjdcbN/f6sH0L96OMA8SoKmNuR33pq9/lalE12TFYFjAPhfmmUfWho7ZCH4PJ7CHA== X-Received: by 2002:a05:6808:1587:b0:3c3:c594:d924 with SMTP id t7-20020a056808158700b003c3c594d924mr1544711oiw.8.1712213332533; Wed, 03 Apr 2024 23:48:52 -0700 (PDT) Received: from amd.. ([2804:7f0:b402:d0dc:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id n16-20020aa79850000000b006e64ddfa71asm13218899pfq.170.2024.04.03.23.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 23:48:52 -0700 (PDT) From: Gustavo Romero To: gdb-patches@sourceware.org Cc: luis.machado@arm.com, thiago.bauermann@linaro.org, gustavo.romero@linaro.org Subject: [PATCH v3 4/7] gdb: Use passed gdbarch instead of calling current_inferior Date: Thu, 4 Apr 2024 06:48:16 +0000 Message-Id: <20240404064819.2848899-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240404064819.2848899-1-gustavo.romero@linaro.org> References: <20240404064819.2848899-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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 In do_examine function, use passed gdbarch when checking if an address is tagged instead of calling current_inferior()->arch() to make the code more localized and help modularity by not calling a current_* function, which disguises the use of a global state/variable. There is no change in the code behavior. Signed-off-by: Gustavo Romero --- gdb/printcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 774e3ec74ae..62fbcb98cfb 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1132,7 +1132,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr) = value_from_ulongest (builtin_type (gdbarch)->builtin_data_ptr, tag_laddr); - if (gdbarch_tagged_address_p (current_inferior ()->arch (), v_addr)) + if (gdbarch_tagged_address_p (gdbarch, v_addr)) { /* Fetch the allocation tag. */ struct value *tag -- 2.34.1