From patchwork Tue Feb 28 11:28:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 65753 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 C89A8384FB7E for ; Tue, 28 Feb 2023 11:31:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C89A8384FB7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677583914; bh=iC6kVUFiPxluFX1BZOTxTJAYZJSGE1GMVuRB9nKG+y0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XTByMyW9LHtVcqqa0+Qon/1z7gXieq08pSRXOKPB22kDpOxhHbbaqQSfXXukTaHGf utSBsPqdFMlUeFvLWKNJsLezFtNGjk4t4aCKhwsEMyA8Im05oO6N4cm0xjWF37ut0b nMj96QBGY5htJqYaSGGa+G79Jyko0ixz2T5jalog= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by sourceware.org (Postfix) with ESMTPS id EEE5E384F488 for ; Tue, 28 Feb 2023 11:31:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEE5E384F488 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="336401770" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="336401770" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 03:31:17 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="817058311" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="817058311" Received: from ultl2604.iul.intel.com (HELO localhost) ([172.28.48.47]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 03:31:16 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 24/26] gdbserver: return tracked register status in regcache_raw_read_unsigned Date: Tue, 28 Feb 2023 12:28:22 +0100 Message-Id: <232ee024f5b957a07c047c724d7065074da1ef34.1677582745.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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-Patchwork-Original-From: Tankut Baris Aktemur via Gdb-patches From: "Aktemur, Tankut Baris" Reply-To: Tankut Baris Aktemur Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" In regcache_raw_read_unsigned, we unconditionally return REG_VALID as the register status. This does not seem right, since the register may in fact be in another state, such as REG_UNAVAILABLE. Return the tracked status. --- gdbserver/regcache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc index 32f0e1109e6..4533e9e9b12 100644 --- a/gdbserver/regcache.cc +++ b/gdbserver/regcache.cc @@ -451,7 +451,7 @@ regcache_raw_read_unsigned (struct regcache *regcache, int regnum, *val = 0; collect_register (regcache, regnum, val); - return REG_VALID; + return regcache->get_register_status (regnum); } #ifndef IN_PROCESS_AGENT