aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/linux-aarch64-ipa.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdbserver/linux-aarch64-ipa.cc')
-rw-r--r--gdbserver/linux-aarch64-ipa.cc128
1 files changed, 38 insertions, 90 deletions
diff --git a/gdbserver/linux-aarch64-ipa.cc b/gdbserver/linux-aarch64-ipa.cc
index e37bed0..074474b 100644
--- a/gdbserver/linux-aarch64-ipa.cc
+++ b/gdbserver/linux-aarch64-ipa.cc
@@ -30,14 +30,14 @@
/* Each register saved by the jump pad is in a 16 byte cell. */
#define FT_CR_SIZE 16
-#define FT_CR_FPCR 0
-#define FT_CR_FPSR 1
-#define FT_CR_CPSR 2
-#define FT_CR_PC 3
-#define FT_CR_SP 4
-#define FT_CR_X0 5
-#define FT_CR_GPR(n) (FT_CR_X0 + (n))
-#define FT_CR_FPR(n) (FT_CR_GPR (31) + (n))
+#define FT_CR_FPCR 0
+#define FT_CR_FPSR 1
+#define FT_CR_CPSR 2
+#define FT_CR_PC 3
+#define FT_CR_SP 4
+#define FT_CR_X0 5
+#define FT_CR_GPR(n) (FT_CR_X0 + (n))
+#define FT_CR_FPR(n) (FT_CR_GPR (31) + (n))
/* Mapping between registers collected by the jump pad and GDB's register
array layout used by regcache.
@@ -45,94 +45,43 @@
See linux-aarch64-low.c (aarch64_install_fast_tracepoint_jump_pad) for
more details. */
-static const int aarch64_ft_collect_regmap[] = {
- FT_CR_GPR (0),
- FT_CR_GPR (1),
- FT_CR_GPR (2),
- FT_CR_GPR (3),
- FT_CR_GPR (4),
- FT_CR_GPR (5),
- FT_CR_GPR (6),
- FT_CR_GPR (7),
- FT_CR_GPR (8),
- FT_CR_GPR (9),
- FT_CR_GPR (10),
- FT_CR_GPR (11),
- FT_CR_GPR (12),
- FT_CR_GPR (13),
- FT_CR_GPR (14),
- FT_CR_GPR (15),
- FT_CR_GPR (16),
- FT_CR_GPR (17),
- FT_CR_GPR (18),
- FT_CR_GPR (19),
- FT_CR_GPR (20),
- FT_CR_GPR (21),
- FT_CR_GPR (22),
- FT_CR_GPR (23),
- FT_CR_GPR (24),
- FT_CR_GPR (25),
- FT_CR_GPR (26),
- FT_CR_GPR (27),
- FT_CR_GPR (28),
- /* FP */
- FT_CR_GPR (29),
- /* LR */
- FT_CR_GPR (30),
- FT_CR_SP,
- FT_CR_PC,
- FT_CR_CPSR,
- FT_CR_FPR (0),
- FT_CR_FPR (1),
- FT_CR_FPR (2),
- FT_CR_FPR (3),
- FT_CR_FPR (4),
- FT_CR_FPR (5),
- FT_CR_FPR (6),
- FT_CR_FPR (7),
- FT_CR_FPR (8),
- FT_CR_FPR (9),
- FT_CR_FPR (10),
- FT_CR_FPR (11),
- FT_CR_FPR (12),
- FT_CR_FPR (13),
- FT_CR_FPR (14),
- FT_CR_FPR (15),
- FT_CR_FPR (16),
- FT_CR_FPR (17),
- FT_CR_FPR (18),
- FT_CR_FPR (19),
- FT_CR_FPR (20),
- FT_CR_FPR (21),
- FT_CR_FPR (22),
- FT_CR_FPR (23),
- FT_CR_FPR (24),
- FT_CR_FPR (25),
- FT_CR_FPR (26),
- FT_CR_FPR (27),
- FT_CR_FPR (28),
- FT_CR_FPR (29),
- FT_CR_FPR (30),
- FT_CR_FPR (31),
- FT_CR_FPSR,
- FT_CR_FPCR
-};
+static const int aarch64_ft_collect_regmap[]
+ = { FT_CR_GPR (0), FT_CR_GPR (1), FT_CR_GPR (2), FT_CR_GPR (3),
+ FT_CR_GPR (4), FT_CR_GPR (5), FT_CR_GPR (6), FT_CR_GPR (7),
+ FT_CR_GPR (8), FT_CR_GPR (9), FT_CR_GPR (10), FT_CR_GPR (11),
+ FT_CR_GPR (12), FT_CR_GPR (13), FT_CR_GPR (14), FT_CR_GPR (15),
+ FT_CR_GPR (16), FT_CR_GPR (17), FT_CR_GPR (18), FT_CR_GPR (19),
+ FT_CR_GPR (20), FT_CR_GPR (21), FT_CR_GPR (22), FT_CR_GPR (23),
+ FT_CR_GPR (24), FT_CR_GPR (25), FT_CR_GPR (26), FT_CR_GPR (27),
+ FT_CR_GPR (28),
+ /* FP */
+ FT_CR_GPR (29),
+ /* LR */
+ FT_CR_GPR (30), FT_CR_SP, FT_CR_PC, FT_CR_CPSR, FT_CR_FPR (0),
+ FT_CR_FPR (1), FT_CR_FPR (2), FT_CR_FPR (3), FT_CR_FPR (4),
+ FT_CR_FPR (5), FT_CR_FPR (6), FT_CR_FPR (7), FT_CR_FPR (8),
+ FT_CR_FPR (9), FT_CR_FPR (10), FT_CR_FPR (11), FT_CR_FPR (12),
+ FT_CR_FPR (13), FT_CR_FPR (14), FT_CR_FPR (15), FT_CR_FPR (16),
+ FT_CR_FPR (17), FT_CR_FPR (18), FT_CR_FPR (19), FT_CR_FPR (20),
+ FT_CR_FPR (21), FT_CR_FPR (22), FT_CR_FPR (23), FT_CR_FPR (24),
+ FT_CR_FPR (25), FT_CR_FPR (26), FT_CR_FPR (27), FT_CR_FPR (28),
+ FT_CR_FPR (29), FT_CR_FPR (30), FT_CR_FPR (31), FT_CR_FPSR, FT_CR_FPCR };
#define AARCH64_NUM_FT_COLLECT_GREGS \
- (sizeof (aarch64_ft_collect_regmap) / sizeof(aarch64_ft_collect_regmap[0]))
+ (sizeof (aarch64_ft_collect_regmap) / sizeof (aarch64_ft_collect_regmap[0]))
/* Fill in REGCACHE with registers saved by the jump pad in BUF. */
void
supply_fast_tracepoint_registers (struct regcache *regcache,
- const unsigned char *buf)
+ const unsigned char *buf)
{
int i;
for (i = 0; i < AARCH64_NUM_FT_COLLECT_GREGS; i++)
supply_register (regcache, i,
- ((char *) buf)
- + (aarch64_ft_collect_regmap[i] * FT_CR_SIZE));
+ ((char *) buf)
+ + (aarch64_ft_collect_regmap[i] * FT_CR_SIZE));
}
ULONGEST
@@ -142,7 +91,7 @@ get_raw_reg (const unsigned char *raw_regs, int regnum)
return 0;
return *(ULONGEST *) (raw_regs
- + aarch64_ft_collect_regmap[regnum] * FT_CR_SIZE);
+ + aarch64_ft_collect_regmap[regnum] * FT_CR_SIZE);
}
/* Return target_desc to use for IPA, given the tdesc index passed by
@@ -185,17 +134,16 @@ alloc_jump_pad_buffer (size_t size)
for (; addr; addr -= pagesize)
{
/* No MAP_FIXED - we don't want to zap someone's mapping. */
- res = mmap ((void *) addr, size,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ res = mmap ((void *) addr, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
/* If we got what we wanted, return. */
if ((uintptr_t) res == addr)
- return res;
+ return res;
/* If we got a mapping, but at a wrong address, undo it. */
if (res != MAP_FAILED)
- munmap (res, size);
+ munmap (res, size);
}
return NULL;