+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.
+
2018-05-08 Simon Marchi <simon.marchi@ericsson.com>
* unittests/string_view-selftests.c: Define GNULIB_NAMESPACE.
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "xtensa-tdep.h"
#include "osabi.h"
#include "linux-tdep.h"
#include "solib-svr4.h"
static void
xtensa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->num_nopriv_regs < tdep->num_regs)
+ tdep->num_regs = tdep->num_nopriv_regs;
+
linux_init_abi (info, gdbarch);
set_solib_svr4_fetch_link_map_offsets
max_size = rmap->byte_size;
if (rmap->mask != 0 && tdep->num_regs == 0)
tdep->num_regs = n;
- /* Find out out how to deal with priveleged registers.
-
- if ((rmap->flags & XTENSA_REGISTER_FLAGS_PRIVILEGED) != 0
- && tdep->num_nopriv_regs == 0)
- tdep->num_nopriv_regs = n;
- */
if ((rmap->flags & XTENSA_REGISTER_FLAGS_PRIVILEGED) != 0
- && tdep->num_regs == 0)
- tdep->num_regs = n;
+ && tdep->num_nopriv_regs == 0)
+ tdep->num_nopriv_regs = n;
}
+ if (tdep->num_regs == 0)
+ tdep->num_regs = tdep->num_nopriv_regs;
/* Number of pseudo registers. */
tdep->num_pseudo_regs = n - tdep->num_regs;