Make THREADPTR user register accessible.
gdb/
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
* xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
for THREADPTR register.
(supply_gregset_reg): Call regcache_raw_supply for THREADPTR
register.
* xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition.
(xtensa_derive_tdep): Initialize tdep->threadptr_regnum.
* xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field.
+2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
+
+ * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
+ for THREADPTR register.
+ (supply_gregset_reg): Call regcache_raw_supply for THREADPTR
+ register.
+ * xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition.
+ (xtensa_derive_tdep): Initialize tdep->threadptr_regnum.
+ * xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field.
+
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
* xtensa-tdep.c (xtensa_pseudo_register_read): Treat all
regcache_raw_collect (regcache,
gdbarch_tdep (gdbarch)->sar_regnum,
®s->sar);
+ if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
+ regcache_raw_collect (regcache,
+ gdbarch_tdep (gdbarch)->threadptr_regnum,
+ ®s->threadptr);
if (regnum >=gdbarch_tdep (gdbarch)->ar_base
&& regnum < gdbarch_tdep (gdbarch)->ar_base
+ gdbarch_tdep (gdbarch)->num_aregs)
regcache_raw_supply (regcache,
gdbarch_tdep (gdbarch)->sar_regnum,
®s->sar);
+ if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
+ regcache_raw_supply (regcache,
+ gdbarch_tdep (gdbarch)->threadptr_regnum,
+ ®s->threadptr);
if (regnum >=gdbarch_tdep (gdbarch)->ar_base
&& regnum < gdbarch_tdep (gdbarch)->ar_base
+ gdbarch_tdep (gdbarch)->num_aregs)
/* Special registers 0..255 (core). */
#define XTENSA_DBREGN_SREG(n) (0x0200+(n))
+/* User registers 0..255. */
+#define XTENSA_DBREGN_UREG(n) (0x0300+(n))
for (rmap = tdep->regmap, n = 0; rmap->target_number != -1; n++, rmap++)
{
tdep->litbase_regnum = n;
else if (rmap->target_number == XTENSA_DBREGN_SREG(230))
tdep->ps_regnum = n;
+ else if (rmap->target_number == XTENSA_DBREGN_UREG(231))
+ tdep->threadptr_regnum = n;
#if 0
else if (rmap->target_number == XTENSA_DBREGN_SREG(226))
tdep->interrupt_regnum = n;
int lcount_regnum;
int sar_regnum; /* Register number of SAR. */
int litbase_regnum; /* Register number of LITBASE. */
+ int threadptr_regnum; /* Register number of THREADPTR. */
int interrupt_regnum; /* Register number for interrupt. */
int interrupt2_regnum; /* Register number for interrupt2. */