summaryrefslogtreecommitdiff
path: root/gdb/arch
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-01-11 16:52:42 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-01-11 16:52:42 -0500
commitc6185dce03deb07b4c824d04969ab88abaf63460 (patch)
treefac41622ea5a0b0f452954afbd3469483f44cc33 /gdb/arch
parenteef401dce1f890921168598fec71495dbf122f59 (diff)
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
Diffstat (limited to 'gdb/arch')
-rw-r--r--gdb/arch/aarch64-insn.c9
-rw-r--r--gdb/arch/aarch64-insn.h5
2 files changed, 8 insertions, 6 deletions
diff --git a/gdb/arch/aarch64-insn.c b/gdb/arch/aarch64-insn.c
index 1252889091..6a5abf729b 100644
--- a/gdb/arch/aarch64-insn.c
+++ b/gdb/arch/aarch64-insn.c
@@ -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;
diff --git a/gdb/arch/aarch64-insn.h b/gdb/arch/aarch64-insn.h
index 57aeb23fea..1e8c5eac94 100644
--- a/gdb/arch/aarch64-insn.h
+++ b/gdb/arch/aarch64-insn.h
@@ -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. */