diff options
Diffstat (limited to 'gdb/xtensa-linux-nat.c')
-rw-r--r-- | gdb/xtensa-linux-nat.c | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 7bc1689..abecb7a 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -62,56 +62,57 @@ fill_gregset (const struct regcache *regcache, int i; xtensa_elf_gregset_t *regs = (xtensa_elf_gregset_t *) gregsetp; struct gdbarch *gdbarch = regcache->arch (); + xtensa_gdbarch_tdep *tdep = (xtensa_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1) regcache->raw_collect (gdbarch_pc_regnum (gdbarch), ®s->pc); if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1) regcache->raw_collect (gdbarch_ps_regnum (gdbarch), ®s->ps); - if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum, + if (regnum == tdep->wb_regnum || regnum == -1) + regcache->raw_collect (tdep->wb_regnum, ®s->windowbase); - if (regnum == gdbarch_tdep (gdbarch)->ws_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->ws_regnum, + if (regnum == tdep->ws_regnum || regnum == -1) + regcache->raw_collect (tdep->ws_regnum, ®s->windowstart); - if (regnum == gdbarch_tdep (gdbarch)->lbeg_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->lbeg_regnum, + if (regnum == tdep->lbeg_regnum || regnum == -1) + regcache->raw_collect (tdep->lbeg_regnum, ®s->lbeg); - if (regnum == gdbarch_tdep (gdbarch)->lend_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->lend_regnum, + if (regnum == tdep->lend_regnum || regnum == -1) + regcache->raw_collect (tdep->lend_regnum, ®s->lend); - if (regnum == gdbarch_tdep (gdbarch)->lcount_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->lcount_regnum, + if (regnum == tdep->lcount_regnum || regnum == -1) + regcache->raw_collect (tdep->lcount_regnum, ®s->lcount); - if (regnum == gdbarch_tdep (gdbarch)->sar_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->sar_regnum, + if (regnum == tdep->sar_regnum || regnum == -1) + regcache->raw_collect (tdep->sar_regnum, ®s->sar); - if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1) - regcache->raw_collect (gdbarch_tdep (gdbarch)->threadptr_regnum, + if (regnum == tdep->threadptr_regnum || regnum == -1) + regcache->raw_collect (tdep->threadptr_regnum, ®s->threadptr); - if (regnum >=gdbarch_tdep (gdbarch)->ar_base - && regnum < gdbarch_tdep (gdbarch)->ar_base - + gdbarch_tdep (gdbarch)->num_aregs) + if (regnum >=tdep->ar_base + && regnum < tdep->ar_base + + tdep->num_aregs) regcache->raw_collect (regnum, - ®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]); + ®s->ar[regnum - tdep->ar_base]); else if (regnum == -1) { - for (i = 0; i < gdbarch_tdep (gdbarch)->num_aregs; ++i) - regcache->raw_collect (gdbarch_tdep (gdbarch)->ar_base + i, + for (i = 0; i < tdep->num_aregs; ++i) + regcache->raw_collect (tdep->ar_base + i, ®s->ar[i]); } - if (regnum >= gdbarch_tdep (gdbarch)->a0_base - && regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS) + if (regnum >= tdep->a0_base + && regnum < tdep->a0_base + C0_NREGS) regcache->raw_collect (regnum, ®s->ar[(4 * regs->windowbase + regnum - - gdbarch_tdep (gdbarch)->a0_base) - % gdbarch_tdep (gdbarch)->num_aregs]); + - tdep->a0_base) + % tdep->num_aregs]); else if (regnum == -1) { for (i = 0; i < C0_NREGS; ++i) - regcache->raw_collect (gdbarch_tdep (gdbarch)->a0_base + i, + regcache->raw_collect (tdep->a0_base + i, (®s->ar[(4 * regs->windowbase + i) - % gdbarch_tdep (gdbarch)->num_aregs])); + % tdep->num_aregs])); } } @@ -123,56 +124,57 @@ supply_gregset_reg (struct regcache *regcache, xtensa_elf_gregset_t *regs = (xtensa_elf_gregset_t *) gregsetp; struct gdbarch *gdbarch = regcache->arch (); + xtensa_gdbarch_tdep *tdep = (xtensa_gdbarch_tdep *) gdbarch_tdep (gdbarch); if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1) regcache->raw_supply (gdbarch_pc_regnum (gdbarch), ®s->pc); if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1) regcache->raw_supply (gdbarch_ps_regnum (gdbarch), ®s->ps); - if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->wb_regnum, + if (regnum == tdep->wb_regnum || regnum == -1) + regcache->raw_supply (tdep->wb_regnum, ®s->windowbase); - if (regnum == gdbarch_tdep (gdbarch)->ws_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->ws_regnum, + if (regnum == tdep->ws_regnum || regnum == -1) + regcache->raw_supply (tdep->ws_regnum, ®s->windowstart); - if (regnum == gdbarch_tdep (gdbarch)->lbeg_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->lbeg_regnum, + if (regnum == tdep->lbeg_regnum || regnum == -1) + regcache->raw_supply (tdep->lbeg_regnum, ®s->lbeg); - if (regnum == gdbarch_tdep (gdbarch)->lend_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->lend_regnum, + if (regnum == tdep->lend_regnum || regnum == -1) + regcache->raw_supply (tdep->lend_regnum, ®s->lend); - if (regnum == gdbarch_tdep (gdbarch)->lcount_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->lcount_regnum, + if (regnum == tdep->lcount_regnum || regnum == -1) + regcache->raw_supply (tdep->lcount_regnum, ®s->lcount); - if (regnum == gdbarch_tdep (gdbarch)->sar_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->sar_regnum, + if (regnum == tdep->sar_regnum || regnum == -1) + regcache->raw_supply (tdep->sar_regnum, ®s->sar); - if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1) - regcache->raw_supply (gdbarch_tdep (gdbarch)->threadptr_regnum, + if (regnum == tdep->threadptr_regnum || regnum == -1) + regcache->raw_supply (tdep->threadptr_regnum, ®s->threadptr); - if (regnum >=gdbarch_tdep (gdbarch)->ar_base - && regnum < gdbarch_tdep (gdbarch)->ar_base - + gdbarch_tdep (gdbarch)->num_aregs) + if (regnum >=tdep->ar_base + && regnum < tdep->ar_base + + tdep->num_aregs) regcache->raw_supply (regnum, - ®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]); + ®s->ar[regnum - tdep->ar_base]); else if (regnum == -1) { - for (i = 0; i < gdbarch_tdep (gdbarch)->num_aregs; ++i) - regcache->raw_supply (gdbarch_tdep (gdbarch)->ar_base + i, + for (i = 0; i < tdep->num_aregs; ++i) + regcache->raw_supply (tdep->ar_base + i, ®s->ar[i]); } - if (regnum >= gdbarch_tdep (gdbarch)->a0_base - && regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS) + if (regnum >= tdep->a0_base + && regnum < tdep->a0_base + C0_NREGS) regcache->raw_supply (regnum, ®s->ar[(4 * regs->windowbase + regnum - - gdbarch_tdep (gdbarch)->a0_base) - % gdbarch_tdep (gdbarch)->num_aregs]); + - tdep->a0_base) + % tdep->num_aregs]); else if (regnum == -1) { for (i = 0; i < C0_NREGS; ++i) - regcache->raw_supply (gdbarch_tdep (gdbarch)->a0_base + i, + regcache->raw_supply (tdep->a0_base + i, ®s->ar[(4 * regs->windowbase + i) - % gdbarch_tdep (gdbarch)->num_aregs]); + % tdep->num_aregs]); } } |