* [PATCH 2/2] gdbserver: LoongArch: Add orig_a0 processing
@ 2022-07-07 3:16 Youling Tang
2022-07-10 9:38 ` Tiezhu Yang
0 siblings, 1 reply; 2+ messages in thread
From: Youling Tang @ 2022-07-07 3:16 UTC (permalink / raw)
To: gdb-patches
1. Commit 736918239b16 ("gdb: LoongArch: add orig_a0 into register set")
introduced orig_a0, similar processing needs to be done in gebserver.
2. Add orig_a0 related comments.
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
gdb/loongarch-linux-nat.c | 4 ++--
gdbserver/linux-loongarch-low.cc | 4 ++++
2 files changed, 6 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 @@ class loongarch_linux_nat_target final : public linux_nat_trad_target
int store_p) override;
};
-/* 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. */
static void
@@ -70,7 +70,7 @@ fetch_gregs_from_thread (struct regcache *regcache, int regnum, pid_t tid)
}
}
-/* 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. */
static void
diff --git a/gdbserver/linux-loongarch-low.cc b/gdbserver/linux-loongarch-low.cc
index 9e2ada1f578..f6bf09a8c87 100644
--- a/gdbserver/linux-loongarch-low.cc
+++ b/gdbserver/linux-loongarch-low.cc
@@ -99,6 +99,8 @@ loongarch_fill_gregset (struct regcache *regcache, void *buf)
for (i = 1; i < 32; i++)
collect_register (regcache, LOONGARCH_ZERO_REGNUM + i, *regset + i);
+ collect_register (regcache, LOONGARCH_ORIG_A0_REGNUM,
+ *regset + LOONGARCH_ORIG_A0_REGNUM);
collect_register (regcache, LOONGARCH_PC_REGNUM, *regset + LOONGARCH_PC_REGNUM);
collect_register (regcache, LOONGARCH_BADV_REGNUM, *regset + LOONGARCH_BADV_REGNUM);
}
@@ -114,6 +116,8 @@ loongarch_store_gregset (struct regcache *regcache, const void *buf)
supply_register_zeroed (regcache, LOONGARCH_ZERO_REGNUM);
for (i = 1; i < 32; i++)
supply_register (regcache, LOONGARCH_ZERO_REGNUM + i, *regset + i);
+ supply_register (regcache, LOONGARCH_ORIG_A0_REGNUM,
+ *regset + LOONGARCH_ORIG_A0_REGNUM);
supply_register (regcache, LOONGARCH_PC_REGNUM, *regset + LOONGARCH_PC_REGNUM);
supply_register (regcache, LOONGARCH_BADV_REGNUM, *regset + LOONGARCH_BADV_REGNUM);
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] gdbserver: LoongArch: Add orig_a0 processing
2022-07-07 3:16 [PATCH 2/2] gdbserver: LoongArch: Add orig_a0 processing Youling Tang
@ 2022-07-10 9:38 ` Tiezhu Yang
0 siblings, 0 replies; 2+ messages in thread
From: Tiezhu Yang @ 2022-07-10 9:38 UTC (permalink / raw)
To: Youling Tang, gdb-patches
On 07/07/2022 11:16 AM, Youling Tang wrote:
> 1. Commit 736918239b16 ("gdb: LoongArch: add orig_a0 into register set")
> introduced orig_a0, similar processing needs to be done in gebserver.
>
> 2. Add orig_a0 related comments.
>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Pushed with small changes.
Thanks,
Tiezhu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-10 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 3:16 [PATCH 2/2] gdbserver: LoongArch: Add orig_a0 processing Youling Tang
2022-07-10 9:38 ` Tiezhu Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).