diff options
author | Alan Hayward <alan.hayward@arm.com> | 2019-08-16 10:19:18 +0100 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2019-08-16 10:19:18 +0100 |
commit | aa7ca1bb443e8c2baad17392f395d1556fecfafa (patch) | |
tree | a5a8006f5d93879956ad07a0a184bc657e0fc69e /gdb/aarch64-tdep.c | |
parent | fdfc8cf7f04e2f4d24ec9fff331ebd71a2e768a3 (diff) | |
download | gdb-aa7ca1bb443e8c2baad17392f395d1556fecfafa.zip gdb-aa7ca1bb443e8c2baad17392f395d1556fecfafa.tar.gz gdb-aa7ca1bb443e8c2baad17392f395d1556fecfafa.tar.bz2 |
Move [PAC] into a new MI field addr_flags
Add a new print_pc which prints both the PC and a new field addr_flags.
Call this wherever the PC is printed in stack.c.
Add a new gdbarch method get_pc_address_flags to obtain the addr_flag
contents. By default returns an empty string, on AArch64 this returns
PAC if the address has been masked in the frame.
Document this in the manual and NEWS file.
gdb/ChangeLog:
* NEWS (Other MI changes): New subsection.
* aarch64-tdep.c (aarch64_get_pc_address_flags): New function.
(aarch64_gdbarch_init): Add aarch64_get_pc_address_flags.
* arch-utils.c (default_get_pc_address_flags): New function.
* arch-utils.h (default_get_pc_address_flags): New declaration.
* gdbarch.sh: Add get_pc_address_flags.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* stack.c (print_pc): New function.
(print_frame_info) (print_frame): Call print_pc.
gdb/doc/ChangeLog:
* gdb.texinfo (AArch64 Pointer Authentication)
(GDB/MI Breakpoint Information) (Frame Information): Document
addr_field.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 5e9f7b8..e512118 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -273,6 +273,17 @@ aarch64_frame_unmask_lr (struct gdbarch_tdep *tdep, return addr; } +/* Implement the "get_pc_address_flags" gdbarch method. */ + +static std::string +aarch64_get_pc_address_flags (frame_info *frame, CORE_ADDR pc) +{ + if (pc != 0 && get_frame_pc_masked (frame)) + return "PAC"; + + return ""; +} + /* Analyze a prologue, looking for a recognizable stack frame and frame pointer. Scan until we encounter a store that could clobber the stack frame unexpectedly, or an unknown instruction. */ @@ -3370,6 +3381,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_gen_return_address (gdbarch, aarch64_gen_return_address); + set_gdbarch_get_pc_address_flags (gdbarch, aarch64_get_pc_address_flags); + tdesc_use_registers (gdbarch, tdesc, tdesc_data); /* Add standard register aliases. */ |