gdb: xtensa: handle privileged registers
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 25 Apr 2018 18:55:56 +0000 (11:55 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Wed, 9 May 2018 16:30:06 +0000 (09:30 -0700)
commit37d9e0623102352e0ae27c311760a9e6569ae5e0
tree308150ef1110d72414922a26daf348c771105ca7
parent60cb2c8a331ed8e4ad20afc51f9cdb3d8d18a869
gdb: xtensa: handle privileged registers

xtensa GDB may be used with both bare-metal and linux-based
applications. In case of bare-metal application gdbserver is able to
provide information about all CPU registers: both unprivileged and
privileged. In case of linux-based application only a small subset of
privileged state is available. Currently xtensa GDB only expects
unprivileged registers in 'g' packets and it fails to communicate with
server that sends both privileged and unprivileged registers.

Allow bare-metal xtensa GDB to deal with both privileged and
unprivileged registers by initializing tdep->num_regs with the total
number of target CPU registers. Keep linux-based xtensa GDB
functionality as is by copying tdep->num_nopriv_regs to tdep->num_regs.

gdb/
2018-05-09  Max Filippov  <jcmvbkbc@gmail.com>

* xtensa-linux-tdep.c (xtensa-tdep.h): New include.
(xtensa_linux_init_abi): Limit tdep->num_regs by
tdep->num_nopriv_regs.
* xtensa-tdep.c (xtensa_derive_tdep): Calculate
tdep->num_nopriv_regs and only copy it to tdep->num_regs if it's
not initialized.
gdb/ChangeLog
gdb/xtensa-linux-tdep.c
gdb/xtensa-tdep.c
This page took 0.025453 seconds and 4 git commands to generate.