mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
gdb: xtensa-linux: add call0 support
Correctly handle a0- registers. This allows debugging call0 code in linux natively. The register structure is the same for windowed and call0 ABIs because currently linux kernel internally requires windowed registers, so they are always present. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range. (supply_gregset_reg): Call regcache_raw_supply for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
|
||||||
|
|
||||||
|
* xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
|
||||||
|
for a single specified register or for all registers in
|
||||||
|
a0_base..a0_base + C0_NREGS range.
|
||||||
|
(supply_gregset_reg): Call regcache_raw_supply for a single
|
||||||
|
specified register or for all registers in a0_base..a0_base +
|
||||||
|
C0_NREGS range.
|
||||||
|
|
||||||
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
|
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
|
||||||
|
|
||||||
* arch/xtensa.h (C0_NREGS): Add definition.
|
* arch/xtensa.h (C0_NREGS): Add definition.
|
||||||
|
@ -94,6 +94,20 @@ fill_gregset (const struct regcache *regcache,
|
|||||||
gdbarch_tdep (gdbarch)->ar_base + i,
|
gdbarch_tdep (gdbarch)->ar_base + i,
|
||||||
®s->ar[i]);
|
®s->ar[i]);
|
||||||
}
|
}
|
||||||
|
if (regnum >= gdbarch_tdep (gdbarch)->a0_base
|
||||||
|
&& regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
|
||||||
|
regcache_raw_collect (regcache, regnum,
|
||||||
|
®s->ar[(4 * regs->windowbase + regnum
|
||||||
|
- gdbarch_tdep (gdbarch)->a0_base)
|
||||||
|
% gdbarch_tdep (gdbarch)->num_aregs]);
|
||||||
|
else if (regnum == -1)
|
||||||
|
{
|
||||||
|
for (i = 0; i < C0_NREGS; ++i)
|
||||||
|
regcache_raw_collect (regcache,
|
||||||
|
gdbarch_tdep (gdbarch)->a0_base + i,
|
||||||
|
®s->ar[(4 * regs->windowbase + i)
|
||||||
|
% gdbarch_tdep (gdbarch)->num_aregs]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -146,6 +160,20 @@ supply_gregset_reg (struct regcache *regcache,
|
|||||||
gdbarch_tdep (gdbarch)->ar_base + i,
|
gdbarch_tdep (gdbarch)->ar_base + i,
|
||||||
®s->ar[i]);
|
®s->ar[i]);
|
||||||
}
|
}
|
||||||
|
if (regnum >= gdbarch_tdep (gdbarch)->a0_base
|
||||||
|
&& regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
|
||||||
|
regcache_raw_supply (regcache, regnum,
|
||||||
|
®s->ar[(4 * regs->windowbase + regnum
|
||||||
|
- gdbarch_tdep (gdbarch)->a0_base)
|
||||||
|
% gdbarch_tdep (gdbarch)->num_aregs]);
|
||||||
|
else if (regnum == -1)
|
||||||
|
{
|
||||||
|
for (i = 0; i < C0_NREGS; ++i)
|
||||||
|
regcache_raw_supply (regcache,
|
||||||
|
gdbarch_tdep (gdbarch)->a0_base + i,
|
||||||
|
®s->ar[(4 * regs->windowbase + i)
|
||||||
|
% gdbarch_tdep (gdbarch)->num_aregs]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user