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: 789872 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp750836wrm; Thu, 18 Apr 2024 13:12:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7Mt3ZxWyTL+9N5aIl9G6E3nwD2lHPOFJZkuZASaOQlOSMBPlcuD1pYRy3vBhcuhTvIsVkiG3gPvEMNq0WoSj7 X-Google-Smtp-Source: AGHT+IGRBugy9hhZZgN8I9vtukc2Gw6FtWdckKV1uviJiK+loRZlfBmuWEgblzufUa8M/QIKlpPb X-Received: by 2002:ac8:5915:0:b0:434:8f61:4bb9 with SMTP id 21-20020ac85915000000b004348f614bb9mr133139qty.58.1713471132383; Thu, 18 Apr 2024 13:12:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713471132; cv=pass; d=google.com; s=arc-20160816; b=zTgm1cm4+JCPT0DEAIhTEGNvjfM4s7NDS9kai/xiwyW6dfPsrbTohuTiPykM/W7eq1 VXp879a8Zsox8PLhp8TJPfljLBfV2g1uJt0MNlUEYakly3VY70IxpOcmONNTpcoYvicv IYVg8CBcHUa5qjhqk6SsUKAuJfL6asy0+M3Kmy+ibm8enlDfWSMGZQ+HcISV1ry9Vanz 4hqvD6eMwTelnFabigAQGu6SAkamdtEG+o5bgp1VzCtdG6vN53rUmYg2Xuod66p+dJ66 BAP4z0nobI5XNloJDyLr+ce4hO5laXkToRnFTQ3M+aC7lksfYmEieQ3WzlIu/58Srpt6 ubvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=+Udz0sOQRKXAm5kiKFSTNh5JUUjk+Jni+c5SH40tgmE=; fh=PHP0XrDyWzrRvU96cs6sxWXpzsZ2PqUxQqbJpAaSNaA=; b=dGWvgMjosR34/vTdIVDD3JDstuSRrn+j9+BP5909VkT72/lFLh4oi2Kuiuw7nt5MQJ 9991Xzu8jkXUWeKvPXOfAp//cAIM8IJyBs0rHqtsp7thRMENfLushngoCS54LAsAamHC ZRzhCPkX8Bk7Ukp9F9BfjgwTyKy2eymqcYQHZwWPW9kuckAsXTyhdNf0R3pg3939CMHU th3ggiLEahFjhMyJ32PDBTNgjsY9Nwy2iM4eWgYTmJvOREhI4k/MnGdzsurI16js6jBR Co7q69YjdIQMH+B/jzzWpL45UlQ2kLqZ3NaplgV+4u43So80Fs4DYCwE0bVSjRiTC31e 2xLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PeQPZam+; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d14-20020ac85ace000000b00436f83741fbsi2293790qtd.282.2024.04.18.13.12.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PeQPZam+; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0498D385841D for ; Thu, 18 Apr 2024 20:12:12 +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-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+patch=linaro.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