diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2016-11-18 08:58:21 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2017-03-27 13:00:04 -0700 |
commit | 1a09b50a463ad005946849540da136b5cbe6237b (patch) | |
tree | da576cf275753c41e47f9de0403968f64b2648df /gdb/gdbserver | |
parent | 0ce4291e3ffd90d2b94e02b4557d716c043bf02e (diff) | |
download | gdb-1a09b50a463ad005946849540da136b5cbe6237b.zip gdb-1a09b50a463ad005946849540da136b5cbe6237b.tar.gz gdb-1a09b50a463ad005946849540da136b5cbe6237b.tar.bz2 |
gdbserver: xtensa: add call0 support
Correctly handle a0- registers on requests from remote gdb. This fixes
'Register 1 is not available'
and subsequent assertion in the remote gdb connecting to the gdbserver:
'findvar.c:291: internal-error: value_of_register_lazy:
Assertion `frame_id_p(get_frame_id (frame))' failed.'
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/gdbserver/
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
* linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register
for all registers in a0_regnum..a0_regnum + C0_NREGS range.
(xtensa_store_gregset): Call supply_register for all registers in
a0_regnum..a0_regnum + C0_NREGS range.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbserver/linux-xtensa-low.c | 28 |
2 files changed, 35 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 14594df..7b4c443 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,10 @@ +2017-03-27 Max Filippov <jcmvbkbc@gmail.com> + + * linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register + for all registers in a0_regnum..a0_regnum + C0_NREGS range. + (xtensa_store_gregset): Call supply_register for all registers in + a0_regnum..a0_regnum + C0_NREGS range. + 2017-03-13 Simon Marchi <simon.marchi@polymtl.ca> * Makefile.in (%-ipa.o: %-ipa.c): New rule. diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c index 98c0bf2..80b5d33 100644 --- a/gdb/gdbserver/linux-xtensa-low.c +++ b/gdb/gdbserver/linux-xtensa-low.c @@ -59,6 +59,20 @@ xtensa_fill_gregset (struct regcache *regcache, void *buf) ptr += register_size (tdesc, i); } + if (XSHAL_ABI == XTHAL_ABI_CALL0) + { + int a0_regnum = find_regno (tdesc, "a0"); + ptr = (char *) &rset[R_A0 + 4 * rset[R_WB]]; + + for (i = a0_regnum; i < a0_regnum + C0_NREGS; i++) + { + if ((4 * rset[R_WB] + i - a0_regnum) == XCHAL_NUM_AREGS) + ptr = (char *) &rset[R_A0]; + collect_register (regcache, i, ptr); + ptr += register_size (tdesc, i); + } + } + /* Loop registers, if hardware has it. */ #if XCHAL_HAVE_LOOPS @@ -94,6 +108,20 @@ xtensa_store_gregset (struct regcache *regcache, const void *buf) ptr += register_size (tdesc, i); } + if (XSHAL_ABI == XTHAL_ABI_CALL0) + { + int a0_regnum = find_regno (tdesc, "a0"); + ptr = (char *) &rset[R_A0 + (4 * rset[R_WB]) % XCHAL_NUM_AREGS]; + + for (i = a0_regnum; i < a0_regnum + C0_NREGS; i++) + { + if ((4 * rset[R_WB] + i - a0_regnum) == XCHAL_NUM_AREGS) + ptr = (char *) &rset[R_A0]; + supply_register (regcache, i, ptr); + ptr += register_size (tdesc, i); + } + } + /* Loop registers, if hardware has it. */ #if XCHAL_HAVE_LOOPS |