From patchwork Thu Apr 18 20:10:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 88683 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B918384AB40 for ; Thu, 18 Apr 2024 20:12:19 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 40EA3384AB44 for ; Thu, 18 Apr 2024 20:11:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40EA3384AB44 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 40EA3384AB44 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713471067; cv=none; b=sfqAOFuYgsjc6Mb5QlprIqfpyx1/X7wU7RKs7alRtRtY5EIvo4weNYNU67hx9zSfb2dc2u03NN1Wtg4yAQhjDq7sBm9s6WTt7kkZ2LfYuQgBhyuTYQ3p9Xf2pR86QstuFO6PLx12ZxrKLBSeAjpb6oAFjq+31q4WKo7IuZWT9es= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713471067; c=relaxed/simple; bh=5sDr5g7U2ywTRYm1e6GUiteL43TzBcSbyiTAO8R27Z8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=eUEISA2katfM8fEuxqoKcvOcySwlDEYNc/VxuI4BOB6dWeLXB36xdjuH5K12h2WJGcpn631ZjOrQevfM+YkmKkSqnsfVlY2z/wbuRB5OKAxZ6fjLtZUXilRPQiBft9k00AVRZr1w67UfRX916bEubnniElXJqDEvXYerVmgNGeU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1e857e571f3so11064035ad.0 for ; Thu, 18 Apr 2024 13:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713471064; x=1714075864; 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=+Udz0sOQRKXAm5kiKFSTNh5JUUjk+Jni+c5SH40tgmE=; b=PeQPZam+i12guqTnyTe8rkxXsWKNJRHeYj4nyDH8ddNRXmcUdM/cl3G+ExbxKFMdNS CBFA1RiqY+aJypNmIgfVe+hDr9W6SvZ5vKwIi+12/YB+sNTlo4/GkSlSccgD3phg+qAM 5abBEAczz23nKovRrWA/IKtIU4LoHjqd6W7KIJ4cA/tQ+2keKaCeJUYq+89cgW6v/PR1 +QdPSeewbNhgEz6QZ47PZYM+pWDTsQMJzl/WOpWVBfTL8XR/nZ9H1Kr2JZb5CPh3njVc ftv4rg8J/3VXdKiP87V1h3jZoKdHDYrUedN7x2v+AHlSoK8k5w3UvGV9SlHfzxCSZ41h gEPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713471064; x=1714075864; 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=+Udz0sOQRKXAm5kiKFSTNh5JUUjk+Jni+c5SH40tgmE=; b=eKPghbwnxkLOYEVEpNJY3YjKOyc+0nbIMJVcFOFTp8zs9EuQ0Dr22EF1PNc44Pk0kb 97YtDociz34vZETluKQ24mao5xhSgkUhGXeGvIcaBzMqYBNUqQfnwtp3E/MXL+qw8ktC jXeDDM1o4ARpbcemTOwjQUVJA5ZceMRQh5ziMUoU3Ccx/udAsy4MkFgCEu75op6vyBpX oM1N+ksi4ATUbpe9t5twi4awftiDVIidxsQ8u3vHVtddk2OmQbbx886tj31pQy1ZxlS2 8UO24mGof5/AllAu2l5wbuz/ude7qIx4jc4XhYanxB9KNaQO4eZNtitSRQEDq2qzI/Ax QtmA== X-Gm-Message-State: AOJu0YzXd3n+L05ys1qgRsU+1WrKLLoT9oQfhvj4aJ2ayfTcp51hmRcI FXyV58TR13irfX1fesXkt3VCKli6iqKMZR1hKZCTp8jvLipyJCUdFoNYyCi9XhPGHi3kmc0K8Lk T X-Google-Smtp-Source: AGHT+IFNV8TdYuE/wxX9x9I/eOUGuPE9wVtwHQ9EL/0B6rxTbpIOlUAg4oZwfo8p+5xEBZZ5pClmzQ== X-Received: by 2002:a17:903:50e:b0:1e5:3d8a:75fd with SMTP id jn14-20020a170903050e00b001e53d8a75fdmr106506plb.69.1713471064029; Thu, 18 Apr 2024 13:11:04 -0700 (PDT) Received: from amd.. ([2804:7f0:b403:ad57:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id n18-20020a170903111200b001e0b5eee802sm1925524plh.123.2024.04.18.13.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:11:03 -0700 (PDT) From: Gustavo Romero To: gdb-patches@sourceware.org Cc: luis.machado@arm.com, thiago.bauermann@linaro.org, eliz@gnu.org, tom@tromey.com, gustavo.romero@linaro.org Subject: [PATCH v6 4/8] gdb: Use passed gdbarch instead of calling current_inferior Date: Thu, 18 Apr 2024 20:10:35 +0000 Message-Id: <20240418201039.236867-5-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240418201039.236867-1-gustavo.romero@linaro.org> References: <20240418201039.236867-1-gustavo.romero@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 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+patchwork=sourceware.org@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 Suggested-by: Thiago Jung Bauermann Approved-By: Luis Machado Tested-By: Luis Machado --- gdb/printcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 5635f605314..4edbd458e4d 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