gdbserver: xtensa: support THREADPTR register
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 19 Nov 2016 00:08:48 +0000 (16:08 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 27 Mar 2017 20:03:13 +0000 (13:03 -0700)
Provide aceess to the THREADPTR register to remote gdb.

gdb/gdbserver/
2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>

* linux-xtensa-low.c (regnum::R_THREADPTR): New enum member.
(xtensa_fill_gregset): Call collect_register_by_name for
threadptr register.
(xtensa_store_gregset): Call supply_register_by_name for
threadptr register.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-xtensa-low.c

index 7b4c4439646d73313651ad12d51266c9f38bae19..693b5e0ff165b523d1cdfb2450a398272dcaf411 100644 (file)
@@ -1,3 +1,11 @@
+2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * linux-xtensa-low.c (regnum::R_THREADPTR): New enum member.
+       (xtensa_fill_gregset): Call collect_register_by_name for
+       threadptr register.
+       (xtensa_store_gregset): Call supply_register_by_name for
+       threadptr register.
+
 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
 
        * linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register
index 80b5d33bfa0c3df77aae4c8242806f1cfb3ec70b..214abdc938b39f5ddabcd47e7c62aab71525b2c8 100644 (file)
@@ -36,6 +36,7 @@ enum regnum {
        R_LBEG, R_LEND, R_LCOUNT,
        R_SAR,
        R_WS, R_WB,
+       R_THREADPTR,
        R_A0 = 64
 };
 
@@ -86,6 +87,11 @@ xtensa_fill_gregset (struct regcache *regcache, void *buf)
   collect_register_by_name (regcache, "ps", (char*)&rset[R_PS]);
   collect_register_by_name (regcache, "windowbase", (char*)&rset[R_WB]);
   collect_register_by_name (regcache, "windowstart", (char*)&rset[R_WS]);
+
+#if XCHAL_HAVE_THREADPTR
+  collect_register_by_name (regcache, "threadptr",
+                           (char *) &rset[R_THREADPTR]);
+#endif
 }
 
 static void
@@ -135,6 +141,11 @@ xtensa_store_gregset (struct regcache *regcache, const void *buf)
   supply_register_by_name (regcache, "ps", (char*)&rset[R_PS]);
   supply_register_by_name (regcache, "windowbase", (char*)&rset[R_WB]);
   supply_register_by_name (regcache, "windowstart", (char*)&rset[R_WS]);
+
+#if XCHAL_HAVE_THREADPTR
+  supply_register_by_name (regcache, "threadptr",
+                          (char *) &rset[R_THREADPTR]);
+#endif
 }
 
 /* Xtensa GNU/Linux PTRACE interface includes extended register set.  */