+2017-10-25 Alan Hayward <alan.hayward@arm.com>
+
+ * aarch64-tdep.h (enum aarch64_regnum): Remove.
+ * arch/aarch64.h: New file.
+
2017-10-24 Ulrich Weigand <uweigand@de.ibm.com>
* dfp.h (decimal_from_string): Use const reference for argument.
#ifndef AARCH64_TDEP_H
#define AARCH64_TDEP_H
+#include "arch/aarch64.h"
+
/* Forward declarations. */
struct gdbarch;
struct regset;
#define AARCH64_DWARF_SP 31
#define AARCH64_DWARF_V0 64
-/* Register numbers of various important registers. */
-enum aarch64_regnum
-{
- AARCH64_X0_REGNUM, /* First integer register */
-
- /* Frame register in AArch64 code, if used. */
- AARCH64_FP_REGNUM = AARCH64_X0_REGNUM + 29,
- AARCH64_LR_REGNUM = AARCH64_X0_REGNUM + 30, /* Return address */
- AARCH64_SP_REGNUM, /* Stack pointer */
- AARCH64_PC_REGNUM, /* Program counter */
- AARCH64_CPSR_REGNUM, /* Contains status register */
- AARCH64_V0_REGNUM, /* First floating point / vector register */
-
- /* Last floating point / vector register */
- AARCH64_V31_REGNUM = AARCH64_V0_REGNUM + 31,
- AARCH64_FPSR_REGNUM, /* Floating point status register */
- AARCH64_FPCR_REGNUM, /* Floating point control register */
-
- /* Other useful registers. */
-
- /* Last integer-like argument */
- AARCH64_LAST_X_ARG_REGNUM = AARCH64_X0_REGNUM + 7,
- AARCH64_STRUCT_RETURN_REGNUM = AARCH64_X0_REGNUM + 8,
- AARCH64_LAST_V_ARG_REGNUM = AARCH64_V0_REGNUM + 7
-};
-
/* Size of integer registers. */
#define X_REGISTER_SIZE 8
#define B_REGISTER_SIZE 1
--- /dev/null
+/* Common target-dependent functionality for AArch64.
+
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef ARCH_AARCH64_H
+#define ARCH_AARCH64_H
+
+/* Register numbers of various important registers. */
+enum aarch64_regnum
+{
+ AARCH64_X0_REGNUM, /* First integer register. */
+ AARCH64_FP_REGNUM = AARCH64_X0_REGNUM + 29, /* Frame register, if used. */
+ AARCH64_LR_REGNUM = AARCH64_X0_REGNUM + 30, /* Return address. */
+ AARCH64_SP_REGNUM, /* Stack pointer. */
+ AARCH64_PC_REGNUM, /* Program counter. */
+ AARCH64_CPSR_REGNUM, /* Current Program Status Register. */
+ AARCH64_V0_REGNUM, /* First fp/vec register. */
+ AARCH64_V31_REGNUM = AARCH64_V0_REGNUM + 31, /* Last fp/vec register. */
+ AARCH64_FPSR_REGNUM, /* Floating Point Status Register. */
+ AARCH64_FPCR_REGNUM, /* Floating Point Control Register. */
+
+ /* Other useful registers. */
+ AARCH64_LAST_X_ARG_REGNUM = AARCH64_X0_REGNUM + 7,
+ AARCH64_STRUCT_RETURN_REGNUM = AARCH64_X0_REGNUM + 8,
+ AARCH64_LAST_V_ARG_REGNUM = AARCH64_V0_REGNUM + 7
+};
+
+#define AARCH64_X_REGS_NUM 31
+#define AARCH64_V_REGS_NUM 32
+#define AARCH64_NUM_REGS AARCH64_FPCR_REGNUM + 1
+
+#endif /* ARCH_AARCH64_H */
+2017-10-25 Alan Hayward <alan.hayward@arm.com>
+
+ * linux-aarch64-low.c (aarch64_fill_gregset): Replace defines
+ with REGNO.
+ (aarch64_store_gregset): Likewise.
+ (aarch64_fill_fpregset): Likewise.
+ (aarch64_store_fpregset): Likewise.
+
2017-10-21 Simon Marchi <simon.marchi@ericsson.com>
* gdbthread.h (find_thread, for_each_thread): New functions.
#include <sys/uio.h>
#include "gdb_proc_service.h"
+#include "arch/aarch64.h"
/* Defined in auto-generated files. */
void init_registers_aarch64 (void);
#include <sys/reg.h>
#endif
-#define AARCH64_X_REGS_NUM 31
-#define AARCH64_V_REGS_NUM 32
-#define AARCH64_X0_REGNO 0
-#define AARCH64_SP_REGNO 31
-#define AARCH64_PC_REGNO 32
-#define AARCH64_CPSR_REGNO 33
-#define AARCH64_V0_REGNO 34
-#define AARCH64_FPSR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM)
-#define AARCH64_FPCR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 1)
-
-#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2)
-
/* Per-process arch-specific data we want to keep. */
struct arch_process_info
int i;
for (i = 0; i < AARCH64_X_REGS_NUM; i++)
- collect_register (regcache, AARCH64_X0_REGNO + i, ®set->regs[i]);
- collect_register (regcache, AARCH64_SP_REGNO, ®set->sp);
- collect_register (regcache, AARCH64_PC_REGNO, ®set->pc);
- collect_register (regcache, AARCH64_CPSR_REGNO, ®set->pstate);
+ collect_register (regcache, AARCH64_X0_REGNUM + i, ®set->regs[i]);
+ collect_register (regcache, AARCH64_SP_REGNUM, ®set->sp);
+ collect_register (regcache, AARCH64_PC_REGNUM, ®set->pc);
+ collect_register (regcache, AARCH64_CPSR_REGNUM, ®set->pstate);
}
static void
int i;
for (i = 0; i < AARCH64_X_REGS_NUM; i++)
- supply_register (regcache, AARCH64_X0_REGNO + i, ®set->regs[i]);
- supply_register (regcache, AARCH64_SP_REGNO, ®set->sp);
- supply_register (regcache, AARCH64_PC_REGNO, ®set->pc);
- supply_register (regcache, AARCH64_CPSR_REGNO, ®set->pstate);
+ supply_register (regcache, AARCH64_X0_REGNUM + i, ®set->regs[i]);
+ supply_register (regcache, AARCH64_SP_REGNUM, ®set->sp);
+ supply_register (regcache, AARCH64_PC_REGNUM, ®set->pc);
+ supply_register (regcache, AARCH64_CPSR_REGNUM, ®set->pstate);
}
static void
int i;
for (i = 0; i < AARCH64_V_REGS_NUM; i++)
- collect_register (regcache, AARCH64_V0_REGNO + i, ®set->vregs[i]);
- collect_register (regcache, AARCH64_FPSR_REGNO, ®set->fpsr);
- collect_register (regcache, AARCH64_FPCR_REGNO, ®set->fpcr);
+ collect_register (regcache, AARCH64_V0_REGNUM + i, ®set->vregs[i]);
+ collect_register (regcache, AARCH64_FPSR_REGNUM, ®set->fpsr);
+ collect_register (regcache, AARCH64_FPCR_REGNUM, ®set->fpcr);
}
static void
int i;
for (i = 0; i < AARCH64_V_REGS_NUM; i++)
- supply_register (regcache, AARCH64_V0_REGNO + i, ®set->vregs[i]);
- supply_register (regcache, AARCH64_FPSR_REGNO, ®set->fpsr);
- supply_register (regcache, AARCH64_FPCR_REGNO, ®set->fpcr);
+ supply_register (regcache, AARCH64_V0_REGNUM + i, ®set->vregs[i]);
+ supply_register (regcache, AARCH64_FPSR_REGNUM, ®set->fpsr);
+ supply_register (regcache, AARCH64_FPCR_REGNUM, ®set->fpcr);
}
/* Enable miscellaneous debugging output. The name is historical - it