gdb: convert arm to new-style debug macros

gdb/ChangeLog:

	* arm-tdep.c (arm_debug_printf): Add and use throughout file.

Change-Id: Iec5c2955cb79d8c0288ffded2c8a58b7eb7e3554
This commit is contained in:
Simon Marchi 2021-01-21 09:26:44 -05:00
parent be07043ea8
commit 7cb6d92a3f
2 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,7 @@
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
* arm-tdep.c (arm_debug_printf): Add and use throughout file.
2021-01-20 Simon Marchi <simon.marchi@polymtl.ca> 2021-01-20 Simon Marchi <simon.marchi@polymtl.ca>
* gdb_bfd.c (debug_bfd_cache): Change type to bool. * gdb_bfd.c (debug_bfd_cache): Change type to bool.

View File

@ -68,6 +68,11 @@
static bool arm_debug; static bool arm_debug;
/* Print an "arm" debug statement. */
#define arm_debug_printf(fmt, ...) \
debug_prefixed_printf_cond (arm_debug, "arm", fmt, ##__VA_ARGS__)
/* Macros for setting and testing a bit in a minimal symbol that marks /* Macros for setting and testing a bit in a minimal symbol that marks
it as Thumb function. The MSB of the minimal symbol's "info" field it as Thumb function. The MSB of the minimal symbol's "info" field
is used for this purpose. is used for this purpose.
@ -1122,9 +1127,8 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
start += 2; start += 2;
} }
if (arm_debug) arm_debug_printf ("Prologue scan stopped at %s",
fprintf_unfiltered (gdb_stdlog, "Prologue scan stopped at %s\n", paddress (gdbarch, start));
paddress (gdbarch, start));
if (unrecognized_pc == 0) if (unrecognized_pc == 0)
unrecognized_pc = start; unrecognized_pc = start;
@ -1782,9 +1786,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
cache->saved_regs[regno].set_addr (offset); cache->saved_regs[regno].set_addr (offset);
} }
if (arm_debug) arm_debug_printf ("Prologue scan stopped at %s",
fprintf_unfiltered (gdb_stdlog, "Prologue scan stopped at %s\n", paddress (gdbarch, unrecognized_pc));
paddress (gdbarch, unrecognized_pc));
return unrecognized_pc; return unrecognized_pc;
} }
@ -3789,10 +3792,10 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
passing register. */ passing register. */
if (return_method == return_method_struct) if (return_method == return_method_struct)
{ {
if (arm_debug) arm_debug_printf ("struct return in %s = %s",
fprintf_unfiltered (gdb_stdlog, "struct return in %s = %s\n", gdbarch_register_name (gdbarch, argreg),
gdbarch_register_name (gdbarch, argreg), paddress (gdbarch, struct_addr));
paddress (gdbarch, struct_addr));
regcache_cooked_write_unsigned (regcache, argreg, struct_addr); regcache_cooked_write_unsigned (regcache, argreg, struct_addr);
argreg++; argreg++;
} }
@ -3938,12 +3941,11 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
register. */ register. */
if (byte_order == BFD_ENDIAN_BIG) if (byte_order == BFD_ENDIAN_BIG)
regval <<= (ARM_INT_REGISTER_SIZE - partial_len) * 8; regval <<= (ARM_INT_REGISTER_SIZE - partial_len) * 8;
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n", arm_debug_printf ("arg %d in %s = 0x%s", argnum,
argnum, gdbarch_register_name (gdbarch, argreg),
gdbarch_register_name phex (regval, ARM_INT_REGISTER_SIZE));
(gdbarch, argreg),
phex (regval, ARM_INT_REGISTER_SIZE));
regcache_cooked_write_unsigned (regcache, argreg, regval); regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++; argreg++;
} }
@ -3955,9 +3957,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
store_unsigned_integer (buf, partial_len, byte_order, regval); store_unsigned_integer (buf, partial_len, byte_order, regval);
/* Push the arguments onto the stack. */ /* Push the arguments onto the stack. */
if (arm_debug) arm_debug_printf ("arg %d @ sp + %d", argnum, nstack);
fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n",
argnum, nstack);
si = push_stack_item (si, buf, ARM_INT_REGISTER_SIZE); si = push_stack_item (si, buf, ARM_INT_REGISTER_SIZE);
nstack += ARM_INT_REGISTER_SIZE; nstack += ARM_INT_REGISTER_SIZE;
} }