]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbserver: LoongArch: Add orig_a0 processing
authorYouling Tang <tangyouling@loongson.cn>
Sun, 10 Jul 2022 02:57:33 +0000 (10:57 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Sun, 10 Jul 2022 09:27:55 +0000 (17:27 +0800)
Commit 736918239b16 ("gdb: LoongArch: add orig_a0 into register set")
introduced orig_a0, similar processing needs to be done in gdbserver.

At the same time, add orig_a0 related comments.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
gdb/loongarch-linux-nat.c
gdbserver/linux-loongarch-low.cc

index 1fd1af6c99fc248395974affd09a0af4f4ce0924..1b4a37c94fb161894f30f0262ea6d27461daaf18 100644 (file)
@@ -44,7 +44,7 @@ protected:
                               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
index 7b81e4b786aebf69a156a5e9453e2d6363023f3a..91826b4236145be516d6ca932c59c5fa60473069 100644 (file)
@@ -99,6 +99,7 @@ loongarch_fill_gregset (struct regcache *regcache, void *buf)
 
   for (i = 1; i < 32; i++)
     collect_register (regcache, 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 +115,7 @@ loongarch_store_gregset (struct regcache *regcache, const void *buf)
   supply_register_zeroed (regcache, 0);
   for (i = 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_REGNUM);
   supply_register (regcache, LOONGARCH_BADV_REGNUM, *regset + LOONGARCH_BADV_REGNUM);
 }