Skip to content

Commit 59c2837

Browse files
committed
AArch64: Read pauth section from core files
gdb/ChangeLog: * aarch64-linux-tdep.c (aarch64_linux_iterate_over_regset_sections): Check for pauth section. * aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.
1 parent 17e116a commit 59c2837

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

gdb/ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2019-03-22 Alan Hayward <alan.hayward@arm.com>
2+
Jiong Wang <jiong.wang@arm.com>
3+
4+
* aarch64-linux-tdep.c
5+
(aarch64_linux_iterate_over_regset_sections): Check for pauth
6+
section.
7+
* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_PAUTH): New define.
8+
19
2019-03-22 Alan Hayward <alan.hayward@arm.com>
210
Jiong Wang <jiong.wang@arm.com>
311

gdb/aarch64-linux-tdep.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,26 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
627627
else
628628
cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, AARCH64_LINUX_SIZEOF_FPREGSET,
629629
&aarch64_linux_fpregset, NULL, cb_data);
630+
631+
632+
if (tdep->has_pauth ())
633+
{
634+
/* Create this on the fly in order to handle the variable location. */
635+
const struct regcache_map_entry pauth_regmap[] =
636+
{
637+
{ 2, AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), 8},
638+
{ 0 }
639+
};
640+
641+
const struct regset aarch64_linux_pauth_regset =
642+
{
643+
pauth_regmap, regcache_supply_regset, regcache_collect_regset
644+
};
645+
646+
cb (".reg-aarch-pauth", AARCH64_LINUX_SIZEOF_PAUTH,
647+
AARCH64_LINUX_SIZEOF_PAUTH, &aarch64_linux_pauth_regset,
648+
"pauth registers", cb_data);
649+
}
630650
}
631651

632652
/* Implement the "core_read_description" gdbarch method. */

gdb/aarch64-linux-tdep.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
alignment. */
3434
#define AARCH64_LINUX_SIZEOF_FPREGSET (33 * V_REGISTER_SIZE)
3535

36+
/* The pauth regset consists of 2 X sized registers. */
37+
#define AARCH64_LINUX_SIZEOF_PAUTH (2 * X_REGISTER_SIZE)
38+
3639
extern const struct regset aarch64_linux_gregset;
3740
extern const struct regset aarch64_linux_fpregset;
3841

0 commit comments

Comments
 (0)