gdb: convert aarch64 to new-style debug macros

I haven't tried this on an actual aarch64 machine, but I am able to
exercise it like this:

    (gdb) set debug aarch64
    (gdb) maintenance selftest aa
    Running selftest aarch64-analyze-prologue.
    [aarch64] aarch64_analyze_prologue: prologue analysis gave up addr=0x14 opcode=0xf94013e0
    Running selftest aarch64-process-record.
    Ran 2 unit tests, 0 failed

gdb/ChangeLog:

	* arch/aarch64-insn.h (aarch64_debug_printf): New.
	* arch/aarch64-insn.c: Use aarch64_debug_printf.
	* aarch64-tdep.c: Use aarch64_debug_printf.

Change-Id: Ifdb40e2816ab8e55a9aabb066d1833d9b5a46094
This commit is contained in:
Simon Marchi
2021-01-11 16:52:42 -05:00
parent eef401dce1
commit c6185dce03
4 changed files with 48 additions and 61 deletions

View File

@@ -69,12 +69,9 @@ aarch64_decode_adr (CORE_ADDR addr, uint32_t insn, int *is_adrp,
else
*offset = (immhi | immlo);
if (aarch64_debug)
{
debug_printf ("decode: 0x%s 0x%x %s x%u, #?\n",
core_addr_to_string_nz (addr), insn,
*is_adrp ? "adrp" : "adr", *rd);
}
aarch64_debug_printf ("decode: 0x%s 0x%x %s x%u, #?",
core_addr_to_string_nz (addr), insn,
*is_adrp ? "adrp" : "adr", *rd);
return 1;
}
return 0;

View File

@@ -21,6 +21,11 @@
extern bool aarch64_debug;
/* Print an "aarch64" debug statement. */
#define aarch64_debug_printf(fmt, ...) \
debug_prefixed_printf_cond (aarch64_debug, "aarch64", fmt, ##__VA_ARGS__)
/* Support routines for instruction parsing. */
/* Create a mask of X bits. */