From: Max Filippov Date: Sat, 19 Nov 2016 00:08:48 +0000 (-0800) Subject: gdbserver: xtensa: support THREADPTR register X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a12e714b775ce025444af15dcfbd5a420363ad53;p=binutils-gdb.git gdbserver: xtensa: support THREADPTR register Provide aceess to the THREADPTR register to remote gdb. gdb/gdbserver/ 2017-03-27 Max Filippov * 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. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7b4c4439646..693b5e0ff16 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2017-03-27 Max Filippov + + * 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 * linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 80b5d33bfa0..214abdc938b 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -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. */