aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache-dump.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-30 12:16:58 -0700
committerTom Tromey <tom@tromey.com>2022-01-05 11:36:33 -0700
commit7befbbd4c3d50c17fb22d872fd933d8c917aa5ee (patch)
treed557613e147874cfadab23223b412fd571d6ddbc /gdb/regcache-dump.c
parent34fda50beed954b3fa392297c34c9417a81d7a38 (diff)
downloadgdb-7befbbd4c3d50c17fb22d872fd933d8c917aa5ee.zip
gdb-7befbbd4c3d50c17fb22d872fd933d8c917aa5ee.tar.gz
gdb-7befbbd4c3d50c17fb22d872fd933d8c917aa5ee.tar.bz2
Use filtered output in some dumping commands
There are several commands that may optionally send their output to a file -- they take an optional filename argument and open a file. This patch changes these commands to use filtered output. The rationale here is that, when printing to gdb_stdout, filtering is appropriate -- it is, and should be, the default for all commands. And, when writing to a file, paging will not happen anyway (it only happens when the stream==gdb_stdout), so using the _filtered form will not change anything.
Diffstat (limited to 'gdb/regcache-dump.c')
-rw-r--r--gdb/regcache-dump.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c
index 83c277f..f593450 100644
--- a/gdb/regcache-dump.c
+++ b/gdb/regcache-dump.c
@@ -43,9 +43,9 @@ protected:
if (regnum < 0)
{
if (m_dump_pseudo)
- fprintf_unfiltered (file, "Cooked value");
+ fprintf_filtered (file, "Cooked value");
else
- fprintf_unfiltered (file, "Raw value");
+ fprintf_filtered (file, "Raw value");
}
else
{
@@ -60,9 +60,9 @@ protected:
auto status = m_regcache->cooked_read (regnum, buf.data ());
if (status == REG_UNKNOWN)
- fprintf_unfiltered (file, "<invalid>");
+ fprintf_filtered (file, "<invalid>");
else if (status == REG_UNAVAILABLE)
- fprintf_unfiltered (file, "<unavailable>");
+ fprintf_filtered (file, "<unavailable>");
else
{
print_hex_chars (file, buf.data (), size,
@@ -73,7 +73,7 @@ protected:
{
/* Just print "<cooked>" for pseudo register when
regcache_dump_raw. */
- fprintf_unfiltered (file, "<cooked>");
+ fprintf_filtered (file, "<cooked>");
}
}
}
@@ -102,9 +102,9 @@ protected:
if (regnum < 0)
{
if (m_has_pseudo)
- fprintf_unfiltered (file, "Cooked value");
+ fprintf_filtered (file, "Cooked value");
else
- fprintf_unfiltered (file, "Raw value");
+ fprintf_filtered (file, "Raw value");
}
else
{
@@ -120,15 +120,15 @@ protected:
gdb_assert (status != REG_VALID);
if (status == REG_UNKNOWN)
- fprintf_unfiltered (file, "<invalid>");
+ fprintf_filtered (file, "<invalid>");
else
- fprintf_unfiltered (file, "<unavailable>");
+ fprintf_filtered (file, "<unavailable>");
}
else
{
/* Just print "<cooked>" for pseudo register when
regcache_dump_raw. */
- fprintf_unfiltered (file, "<cooked>");
+ fprintf_filtered (file, "<cooked>");
}
}
}
@@ -162,7 +162,7 @@ protected:
{
if (regnum < 0)
{
- fprintf_unfiltered (file, "Rmt Nr g/G Offset");
+ fprintf_filtered (file, "Rmt Nr g/G Offset");
}
else if (regnum < gdbarch_num_regs (m_gdbarch))
{
@@ -170,7 +170,7 @@ protected:
if (remote_register_number_and_offset (m_gdbarch, regnum,
&pnum, &poffset))
- fprintf_unfiltered (file, "%7d %11d", pnum, poffset);
+ fprintf_filtered (file, "%7d %11d", pnum, poffset);
}
}
};
@@ -188,7 +188,7 @@ protected:
void dump_reg (ui_file *file, int regnum) override
{
if (regnum < 0)
- fprintf_unfiltered (file, "Groups");
+ fprintf_filtered (file, "Groups");
else
{
const char *sep = "";
@@ -200,8 +200,8 @@ protected:
{
if (gdbarch_register_reggroup_p (m_gdbarch, regnum, group))
{
- fprintf_unfiltered (file,
- "%s%s", sep, reggroup_name (group));
+ fprintf_filtered (file,
+ "%s%s", sep, reggroup_name (group));
sep = ",";
}
}