From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7873) id 14A3C3861C6D; Sun, 10 Jul 2022 09:31:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14A3C3861C6D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tiezhu Yang To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdbserver: LoongArch: Add orig_a0 processing X-Act-Checkin: binutils-gdb X-Git-Author: Youling Tang X-Git-Refname: refs/heads/master X-Git-Oldrev: 3eba483364436567fd1b6ac4b5d82e23bb223a54 X-Git-Newrev: 74baa6cd1c8168705a39d45f317cc9f79e31ac3a Message-Id: <20220710093117.14A3C3861C6D@sourceware.org> Date: Sun, 10 Jul 2022 09:31:17 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2022 09:31:17 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D74baa6cd1c81= 68705a39d45f317cc9f79e31ac3a commit 74baa6cd1c8168705a39d45f317cc9f79e31ac3a Author: Youling Tang Date: Sun Jul 10 10:57:33 2022 +0800 gdbserver: LoongArch: Add orig_a0 processing =20 Commit 736918239b16 ("gdb: LoongArch: add orig_a0 into register set") introduced orig_a0, similar processing needs to be done in gdbserver. =20 At the same time, add orig_a0 related comments. =20 Signed-off-by: Youling Tang Signed-off-by: Tiezhu Yang Diff: --- gdb/loongarch-linux-nat.c | 4 ++-- gdbserver/linux-loongarch-low.cc | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/loongarch-linux-nat.c b/gdb/loongarch-linux-nat.c index 1fd1af6c99f..1b4a37c94fb 100644 --- a/gdb/loongarch-linux-nat.c +++ b/gdb/loongarch-linux-nat.c @@ -44,7 +44,7 @@ protected: int store_p) override; }; =20 -/* Fill GDB's register array with the general-purpose, pc and badv +/* Fill GDB's register array with the general-purpose, orig_a0, pc and badv register values from the current thread. */ =20 static void @@ -70,7 +70,7 @@ fetch_gregs_from_thread (struct regcache *regcache, int r= egnum, pid_t tid) } } =20 -/* Store to the current thread the valid general-purpose, pc and badv +/* Store to the current thread the valid general-purpose, orig_a0, pc and = badv register values in the GDB's register array. */ =20 static void diff --git a/gdbserver/linux-loongarch-low.cc b/gdbserver/linux-loongarch-l= ow.cc index 7b81e4b786a..91826b42361 100644 --- a/gdbserver/linux-loongarch-low.cc +++ b/gdbserver/linux-loongarch-low.cc @@ -99,6 +99,7 @@ loongarch_fill_gregset (struct regcache *regcache, void *= buf) =20 for (i =3D 1; i < 32; i++) collect_register (regcache, i, *regset + i); + collect_register (regcache, LOONGARCH_ORIG_A0_REGNUM, *regset + LOONGARC= H_ORIG_A0_REGNUM); collect_register (regcache, LOONGARCH_PC_REGNUM, *regset + LOONGARCH_PC_= REGNUM); collect_register (regcache, LOONGARCH_BADV_REGNUM, *regset + LOONGARCH_B= ADV_REGNUM); } @@ -114,6 +115,7 @@ loongarch_store_gregset (struct regcache *regcache, con= st void *buf) supply_register_zeroed (regcache, 0); for (i =3D 1; i < 32; i++) supply_register (regcache, i, *regset + i); + supply_register (regcache, LOONGARCH_ORIG_A0_REGNUM, *regset + LOONGARCH= _ORIG_A0_REGNUM); supply_register (regcache, LOONGARCH_PC_REGNUM, *regset + LOONGARCH_PC_R= EGNUM); supply_register (regcache, LOONGARCH_BADV_REGNUM, *regset + LOONGARCH_BA= DV_REGNUM); }