Message ID | 23857f86bb74dc803b8deedc1c38e51363554500.1677582745.git.tankut.baris.aktemur@intel.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 6CAF0383FBB7 for <patchwork@sourceware.org>; Tue, 28 Feb 2023 11:31:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CAF0383FBB7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677583914; bh=UII4nydFbh8/XqpPQSG2sMgYMMwYxGsuAA8fsMYCOXU=; 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=C5GO804hdjGb4lbXOv0Jinf55as95EZZAbzhXyezNak/pAMhmb1d1QTv7F8Mlp5ej C62ThnvepJca062GK3iaEC6PI5pIa6OMC1vDL/mLQE3NHBKWsaypGGgkePW0aTvSYN SS95ycCbsmE6MdJNbhsyigCurifX/k65ThfjFtPU= 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 0308038493DC for <gdb-patches@sourceware.org>; Tue, 28 Feb 2023 11:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0308038493DC X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="336401749" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="336401749" 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:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="817058290" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="817058290" 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:10 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 23/26] gdbserver: set register statuses in registers_from_string Date: Tue, 28 Feb 2023 12:28:21 +0100 Message-Id: <23857f86bb74dc803b8deedc1c38e51363554500.1677582745.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1677582744.git.tankut.baris.aktemur@intel.com> References: <cover.1677582744.git.tankut.baris.aktemur@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tankut Baris Aktemur via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
gdbserver: refactor regcache and allow gradually populating
|
|
Commit Message
Aktemur, Tankut Baris
Feb. 28, 2023, 11:28 a.m. UTC
The registers_from_string function uses hex2bin to set the values of all registers. Set the register statuses to REG_VALID to reflect this change. --- gdbserver/regcache.cc | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 2023-02-28 06:28, Tankut Baris Aktemur via Gdb-patches wrote: > The registers_from_string function uses hex2bin to set the values of > all registers. Set the register statuses to REG_VALID to reflect this > change. > --- > gdbserver/regcache.cc | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc > index 644f436c681..32f0e1109e6 100644 > --- a/gdbserver/regcache.cc > +++ b/gdbserver/regcache.cc > @@ -259,6 +259,8 @@ regcache::registers_from_string (const char *buf) > len = tdesc->registers_size * 2; > } > hex2bin (buf, registers, len / 2); > + /* All register data have been re-written. Update the statuses. */ > + memset (register_status, REG_VALID, tdesc->reg_defs.size ()); > } > > /* See regcache.h */ Well... technically, registers_from_string is written in a way that if the input buffer is too short, the registers at the end will not be written (don't know why it's written like that, instead of erroring out, but that's how it is right now). So you should only set to REG_VALID the registers that are actually completely written, setting the rest to REG_UNKNOWN. Simon
diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc index 644f436c681..32f0e1109e6 100644 --- a/gdbserver/regcache.cc +++ b/gdbserver/regcache.cc @@ -259,6 +259,8 @@ regcache::registers_from_string (const char *buf) len = tdesc->registers_size * 2; } hex2bin (buf, registers, len / 2); + /* All register data have been re-written. Update the statuses. */ + memset (register_status, REG_VALID, tdesc->reg_defs.size ()); } /* See regcache.h */