aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-30 17:31:41 -0700
committerTom Tromey <tom@tromey.com>2022-01-25 15:22:49 -0700
commitd4396e0e97d21ad766089748fde1e11257384c49 (patch)
treed688f73ec95568444a01a01f2c85474e3db3c9db /gdb/stack.c
parent244ac24b51ba1375794eed93b58d5813e7c044ca (diff)
downloadgdb-d4396e0e97d21ad766089748fde1e11257384c49.zip
gdb-d4396e0e97d21ad766089748fde1e11257384c49.tar.gz
gdb-d4396e0e97d21ad766089748fde1e11257384c49.tar.bz2
Reduce explicit use of gdb_stdout
In an earlier version of the pager rewrite series, it was important to audit unfiltered output calls to see which were truly necessary. This is no longer necessary, but it still seems like a decent cleanup to change calls to avoid explicitly passing gdb_stdout. That is, rather than using something like fprintf_unfiltered with gdb_stdout, the code ought to use plain printf_unfiltered instead. This patch makes this change. I went ahead and converted all the _filtered calls I could find, as well, for the same clarity.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index b81be29..7a2d7da 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1549,11 +1549,11 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
{
printf_filtered (_("Stack frame at "));
}
- fputs_filtered (paddress (gdbarch, get_frame_base (fi)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (fi)));
printf_filtered (":\n");
printf_filtered (" %s = ", pc_regname);
if (frame_pc_p)
- fputs_filtered (paddress (gdbarch, get_frame_pc (fi)), gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_pc (fi)));
else
fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout);
@@ -1561,7 +1561,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
if (funname)
{
printf_filtered (" in ");
- fputs_filtered (funname, gdb_stdout);
+ puts_filtered (funname);
}
wrap_here (" ");
if (sal.symtab)
@@ -1603,7 +1603,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
}
if (caller_pc_p)
- fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);
+ puts_filtered (paddress (gdbarch, caller_pc));
printf_filtered ("\n");
if (calling_frame_info == NULL)
@@ -1623,8 +1623,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
else
{
printf_filtered (" called by frame at ");
- fputs_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)));
}
if (get_next_frame (fi) && calling_frame_info)
puts_filtered (",");
@@ -1632,8 +1631,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
if (get_next_frame (fi))
{
printf_filtered (" caller of frame at ");
- fputs_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))));
}
if (get_next_frame (fi) || calling_frame_info)
puts_filtered ("\n");
@@ -1653,7 +1651,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
else
{
printf_filtered (" Arglist at ");
- fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+ puts_filtered (paddress (gdbarch, arg_list));
printf_filtered (",");
if (!gdbarch_frame_num_args_p (gdbarch))
@@ -1686,7 +1684,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
else
{
printf_filtered (" Locals at ");
- fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+ puts_filtered (paddress (gdbarch, arg_list));
printf_filtered (",");
}
}
@@ -1721,14 +1719,13 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
(value_contents_all (value).data (), sp_size, byte_order);
printf_filtered (" Previous frame's sp is ");
- fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
+ puts_filtered (paddress (gdbarch, sp));
printf_filtered ("\n");
}
else if (VALUE_LVAL (value) == lval_memory)
{
printf_filtered (" Previous frame's sp at ");
- fputs_filtered (paddress (gdbarch, value_address (value)),
- gdb_stdout);
+ puts_filtered (paddress (gdbarch, value_address (value)));
printf_filtered ("\n");
}
else if (VALUE_LVAL (value) == lval_register)
@@ -1771,7 +1768,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
wrap_here (" ");
printf_filtered (" %s at ",
gdbarch_register_name (gdbarch, i));
- fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
+ puts_filtered (paddress (gdbarch, addr));
count++;
}
}