From 6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 2 Jan 2022 11:46:15 -0700 Subject: Unify gdb printf functions Now that filtered and unfiltered output can be treated identically, we can unify the printf family of functions. This is done under the name "gdb_printf". Most of this patch was written by script. --- gdb/nios2-tdep.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'gdb/nios2-tdep.c') diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index 857c60d..159d31b 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -1222,10 +1222,10 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, int innermost = (this_frame ? (frame_relative_level (this_frame) == 0) : 1); if (nios2_debug) - fprintf_unfiltered (gdb_stdlog, - "{ nios2_analyze_prologue start=%s, current=%s ", - paddress (gdbarch, start_pc), - paddress (gdbarch, current_pc)); + gdb_printf (gdb_stdlog, + "{ nios2_analyze_prologue start=%s, current=%s ", + paddress (gdbarch, start_pc), + paddress (gdbarch, current_pc)); /* Set up the default values of the registers. */ nios2_setup_default (cache); @@ -1252,7 +1252,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, memcpy (temp_value, value, sizeof (temp_value)); value = temp_value; if (nios2_debug) - fprintf_unfiltered (gdb_stdlog, "*"); + gdb_printf (gdb_stdlog, "*"); } op = nios2_fetch_insn (gdbarch, pc, &insn); @@ -1265,9 +1265,9 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, if (nios2_debug) { if (op->size == 2) - fprintf_unfiltered (gdb_stdlog, "[%04X]", insn & 0xffff); + gdb_printf (gdb_stdlog, "[%04X]", insn & 0xffff); else - fprintf_unfiltered (gdb_stdlog, "[%08X]", insn); + gdb_printf (gdb_stdlog, "[%08X]", insn); } /* The following instructions can appear in the prologue. */ @@ -1554,7 +1554,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, cache->return_regnum = NIOS2_EA_REGNUM; if (nios2_debug) - fprintf_unfiltered (gdb_stdlog, "\n-> retreg=%d, ", cache->return_regnum); + gdb_printf (gdb_stdlog, "\n-> retreg=%d, ", cache->return_regnum); if (cache->reg_value[NIOS2_FP_REGNUM].reg == NIOS2_SP_REGNUM) /* If the FP now holds an offset from the CFA then this is a @@ -1571,7 +1571,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, /* Somehow the stack pointer has been corrupted. We can't return. */ if (nios2_debug) - fprintf_unfiltered (gdb_stdlog, " }\n"); + gdb_printf (gdb_stdlog, " }\n"); return 0; } @@ -1598,7 +1598,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, if (ra == current_pc) { if (nios2_debug) - fprintf_unfiltered + gdb_printf (gdb_stdlog, ", r%d@r%d+?> }\n", paddress (gdbarch, cache->reg_value[base_reg].offset), @@ -1660,8 +1660,8 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc, } if (nios2_debug) - fprintf_unfiltered (gdb_stdlog, "cfa=%s }\n", - paddress (gdbarch, cache->cfa)); + gdb_printf (gdb_stdlog, "cfa=%s }\n", + paddress (gdbarch, cache->cfa)); return prologue_end; } -- cgit v1.1