aboutsummaryrefslogtreecommitdiff
path: root/gdb/xtensa-linux-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-11-15 15:22:34 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-11-15 21:39:16 -0500
commitaa70a99eb03444f41f50e100c9b1e00e9a32cde9 (patch)
treeec0747ecf73c9e88e8ee3e5de86f129bf88dab64 /gdb/xtensa-linux-nat.c
parent39cdfdb2614ae5654f5aa77792085b37cb342929 (diff)
downloadgdb-aa70a99eb03444f41f50e100c9b1e00e9a32cde9.zip
gdb-aa70a99eb03444f41f50e100c9b1e00e9a32cde9.tar.gz
gdb-aa70a99eb03444f41f50e100c9b1e00e9a32cde9.tar.bz2
gdb: adjust gdbarch_tdep calls in nat files
Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") forgot to update the gdbarch_tdep calls in the native files other than x86-64 Linux. This patch updates them all (to the best of my knowledge). These are the files I was able to build-test: aarch64-linux-nat.c amd64-bsd-nat.c arm-linux-nat.c ppc-linux-nat.c windows-nat.c xtensa-linux-nat.c And these are the ones I could not build-test: aix-thread.c arm-netbsd-nat.c ppc-fbsd-nat.c ppc-netbsd-nat.c ia64-tdep.c (the part that needs libunwind) ppc-obsd-nat.c rs6000-nat.c If there are still some build problems related to gdbarch_tdep in them, they should be pretty obvious to fix. Change-Id: Iaa3d791a850e4432973757598e634e3da6061428
Diffstat (limited to 'gdb/xtensa-linux-nat.c')
-rw-r--r--gdb/xtensa-linux-nat.c106
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), &regs->pc);
if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
regcache->raw_collect (gdbarch_ps_regnum (gdbarch), &regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
- &regs->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
+ &regs->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,
&regs->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,
&regs->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,
(&regs->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), &regs->pc);
if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
regcache->raw_supply (gdbarch_ps_regnum (gdbarch), &regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
&regs->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,
- &regs->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
+ &regs->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,
&regs->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,
&regs->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,
&regs->ar[(4 * regs->windowbase + i)
- % gdbarch_tdep (gdbarch)->num_aregs]);
+ % tdep->num_aregs]);
}
}