aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-26 13:41:36 -0700
committerTom Tromey <tom@tromey.com>2021-12-29 10:40:10 -0700
commitd68510ac191cb8b4b662a5fd1f3bcf9f4b136971 (patch)
treeab8d361f18255facf28e086d9a102515e123fa13 /gdb/arm-tdep.c
parent0fed74615b0f263c359a13a7a17ade36a986ddd1 (diff)
downloadgdb-d68510ac191cb8b4b662a5fd1f3bcf9f4b136971.zip
gdb-d68510ac191cb8b4b662a5fd1f3bcf9f4b136971.tar.gz
gdb-d68510ac191cb8b4b662a5fd1f3bcf9f4b136971.tar.bz2
Use correct stream for process record output
The process record code often emits unfiltered output. In some cases, this output ought to go to gdb_stderr (but see below). In other cases, the output is guarded by a logging variable and so ought to go to gdb_stdlog. This patch makes these changes. Note that in many cases, the output to stderr is followed by a "return -1", which is how process record indicates an error. It seems to me that calling error here would be preferable, because, in many cases, that's all the caller does when it sees a -1. However, I haven't made this change. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index e0ef1d2..e4af38c 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -11328,9 +11328,10 @@ arm_record_b_bl (insn_decode_record *arm_insn_r)
static int
arm_record_unsupported_insn (insn_decode_record *arm_insn_r)
{
- printf_unfiltered (_("Process record does not support instruction "
- "0x%0x at address %s.\n"),arm_insn_r->arm_insn,
- paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr));
+ fprintf_unfiltered (gdb_stderr,
+ _("Process record does not support instruction "
+ "0x%0x at address %s.\n"),arm_insn_r->arm_insn,
+ paddress (arm_insn_r->gdbarch, arm_insn_r->this_addr));
return -1;
}
@@ -11916,7 +11917,7 @@ arm_record_coproc_data_proc (insn_decode_record *arm_insn_r)
}
else
{
- printf_unfiltered (_("no syscall record support\n"));
+ fprintf_unfiltered (gdb_stderr, _("no syscall record support\n"));
return -1;
}
}
@@ -12348,11 +12349,12 @@ thumb_record_misc (insn_decode_record *thumb_insn_r)
record_buf[1] = ARM_LR_REGNUM;
thumb_insn_r->reg_rec_count = 2;
/* We need to save SPSR value, which is not yet done. */
- printf_unfiltered (_("Process record does not support instruction "
- "0x%0x at address %s.\n"),
- thumb_insn_r->arm_insn,
- paddress (thumb_insn_r->gdbarch,
- thumb_insn_r->this_addr));
+ fprintf_unfiltered (gdb_stderr,
+ _("Process record does not support instruction "
+ "0x%0x at address %s.\n"),
+ thumb_insn_r->arm_insn,
+ paddress (thumb_insn_r->gdbarch,
+ thumb_insn_r->this_addr));
return -1;
case 0xf:
@@ -12440,7 +12442,7 @@ thumb_record_ldm_stm_swi (insn_decode_record *thumb_insn_r)
}
else
{
- printf_unfiltered (_("no syscall record support\n"));
+ fprintf_unfiltered (gdb_stderr, _("no syscall record support\n"));
return -1;
}
}
@@ -13351,10 +13353,11 @@ decode_insn (abstract_memory_reader &reader, insn_decode_record *arm_record,
{
if (record_debug)
{
- printf_unfiltered (_("Process record: error reading memory at "
- "addr %s len = %d.\n"),
- paddress (arm_record->gdbarch,
- arm_record->this_addr), insn_size);
+ fprintf_unfiltered (gdb_stdlog,
+ _("Process record: error reading memory at "
+ "addr %s len = %d.\n"),
+ paddress (arm_record->gdbarch,
+ arm_record->this_addr), insn_size);
}
return -1;
}
@@ -13619,10 +13622,11 @@ arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (record_debug)
{
- printf_unfiltered (_("Process record: error reading memory at "
- "addr %s len = %d.\n"),
- paddress (arm_record.gdbarch,
- arm_record.this_addr), 2);
+ fprintf_unfiltered (gdb_stdlog,
+ _("Process record: error reading memory at "
+ "addr %s len = %d.\n"),
+ paddress (arm_record.gdbarch,
+ arm_record.this_addr), 2);
}
return -1;
}