From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B9A24385C33A for ; Thu, 29 Sep 2022 20:42:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B9A24385C33A Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 28TKgBxK008409 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Sep 2022 16:42:16 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 28TKgBxK008409 Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B8A381E0D5; Thu, 29 Sep 2022 16:42:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Subject: [pushed] gdb: constify target_stack::is_pushed Date: Thu, 29 Sep 2022 16:42:10 -0400 Message-Id: <20220929204210.749209-1-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 29 Sep 2022 20:42:11 +0000 X-Spam-Status: No, score=-3189.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2022 20:42:19 -0000 The target_ops parameters here can be made const. Change-Id: Ibc18b17d6b21d06145251a03e68aca90538117d6 --- gdb/inferior.h | 2 +- gdb/target.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/inferior.h b/gdb/inferior.h index 017800165b4b..bb3aec1e8f80 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -369,7 +369,7 @@ class inferior : public refcounted_object, int unpush_target (struct target_ops *t); /* Returns true if T is pushed in this inferior's target stack. */ - bool target_is_pushed (target_ops *t) + bool target_is_pushed (const target_ops *t) { return m_target_stack.is_pushed (t); } /* Find the target beneath T in this inferior's target stack. */ diff --git a/gdb/target.h b/gdb/target.h index 0b784278c4f8..8e13ada07b6a 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1385,7 +1385,7 @@ class target_stack bool unpush (target_ops *t); /* Returns true if T is pushed on the target stack. */ - bool is_pushed (target_ops *t) const + bool is_pushed (const target_ops *t) const { return at (t->stratum ()) == t; } /* Return the target at STRATUM. */ base-commit: ac9b8c676e9f52c5238bbc61a2cdd27e3d59db10 -- 2.37.3