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.
This commit is contained in:
parent
244ac24b51
commit
d4396e0e97
20 changed files with 109 additions and 127 deletions
|
@ -8255,10 +8255,9 @@ handle_automatic_hardware_breakpoints (bp_location *bl)
|
||||||
bl->loc_type = new_type;
|
bl->loc_type = new_type;
|
||||||
if (!said)
|
if (!said)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered (_("Note: automatically using "
|
||||||
_("Note: automatically using "
|
"hardware breakpoints for "
|
||||||
"hardware breakpoints for "
|
"read-only addresses.\n"));
|
||||||
"read-only addresses.\n"));
|
|
||||||
said = true;
|
said = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,7 +427,7 @@ display_gdb_prompt (const char *new_prompt)
|
||||||
/* Don't use a _filtered function here. It causes the assumed
|
/* Don't use a _filtered function here. It causes the assumed
|
||||||
character position to be off, since the newline we read from
|
character position to be off, since the newline we read from
|
||||||
the user is not accounted for. */
|
the user is not accounted for. */
|
||||||
fprintf_unfiltered (gdb_stdout, "%s", actual_gdb_prompt.c_str ());
|
printf_unfiltered ("%s", actual_gdb_prompt.c_str ());
|
||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,13 +105,12 @@ fbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
|
||||||
size = kve->kve_end - kve->kve_start;
|
size = kve->kve_end - kve->kve_start;
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
|
||||||
"Save segment, %ld bytes at %s (%c%c%c)\n",
|
(long) size,
|
||||||
(long) size,
|
paddress (target_gdbarch (), kve->kve_start),
|
||||||
paddress (target_gdbarch (), kve->kve_start),
|
kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
|
||||||
kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
|
kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
|
||||||
kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
|
kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
|
||||||
kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invoke the callback function to create the corefile segment.
|
/* Invoke the callback function to create the corefile segment.
|
||||||
|
|
15
gdb/gcore.c
15
gdb/gcore.c
|
@ -140,9 +140,8 @@ gcore_command (const char *args, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("Opening corefile '%s' for output.\n",
|
||||||
"Opening corefile '%s' for output.\n",
|
corefilename.get ());
|
||||||
corefilename.get ());
|
|
||||||
|
|
||||||
if (target_supports_dumpcore ())
|
if (target_supports_dumpcore ())
|
||||||
target_dumpcore (corefilename.get ());
|
target_dumpcore (corefilename.get ());
|
||||||
|
@ -161,7 +160,7 @@ gcore_command (const char *args, int from_tty)
|
||||||
unlink_file.keep ();
|
unlink_file.keep ();
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename.get ());
|
printf_filtered ("Saved corefile %s\n", corefilename.get ());
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum bfd_architecture
|
static enum bfd_architecture
|
||||||
|
@ -385,8 +384,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
|
||||||
{
|
{
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
|
printf_filtered ("Ignore segment, %s bytes at %s\n",
|
||||||
plongest (size), paddress (target_gdbarch (), vaddr));
|
plongest (size), paddress (target_gdbarch (), vaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -445,8 +444,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
|
||||||
|
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
|
printf_filtered ("Save segment, %s bytes at %s\n",
|
||||||
plongest (size), paddress (target_gdbarch (), vaddr));
|
plongest (size), paddress (target_gdbarch (), vaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_set_section_size (osec, size);
|
bfd_set_section_size (osec, size);
|
||||||
|
|
|
@ -320,7 +320,7 @@ pascm_set_func (const char *args, int from_tty, struct cmd_list_element *c)
|
||||||
|
|
||||||
/* GDB is usually silent when a parameter is set. */
|
/* GDB is usually silent when a parameter is set. */
|
||||||
if (*msg.get () != '\0')
|
if (*msg.get () != '\0')
|
||||||
fprintf_filtered (gdb_stdout, "%s\n", msg.get ());
|
printf_filtered ("%s\n", msg.get ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A callback function that is registered against the respective
|
/* A callback function that is registered against the respective
|
||||||
|
|
|
@ -1103,7 +1103,7 @@ jump_command (const char *arg, int from_tty)
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
{
|
{
|
||||||
printf_filtered (_("Continuing at "));
|
printf_filtered (_("Continuing at "));
|
||||||
fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
|
puts_filtered (paddress (gdbarch, addr));
|
||||||
printf_filtered (".\n");
|
printf_filtered (".\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -580,7 +580,7 @@ info_checkpoints_command (const char *arg, int from_tty)
|
||||||
if (fi.num == 0)
|
if (fi.num == 0)
|
||||||
printf_filtered (_(" (main process)"));
|
printf_filtered (_(" (main process)"));
|
||||||
printf_filtered (_(" at "));
|
printf_filtered (_(" at "));
|
||||||
fputs_filtered (paddress (gdbarch, pc), gdb_stdout);
|
puts_filtered (paddress (gdbarch, pc));
|
||||||
|
|
||||||
symtab_and_line sal = find_pc_line (pc, 0);
|
symtab_and_line sal = find_pc_line (pc, 0);
|
||||||
if (sal.symtab)
|
if (sal.symtab)
|
||||||
|
|
|
@ -165,7 +165,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
{
|
{
|
||||||
fputs_filtered ("\"\"", gdb_stdout);
|
puts_filtered ("\"\"");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,9 @@ macro_expand_command (const char *exp, int from_tty)
|
||||||
{
|
{
|
||||||
gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
|
gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
|
||||||
|
|
||||||
fputs_filtered ("expands to: ", gdb_stdout);
|
puts_filtered ("expands to: ");
|
||||||
fputs_filtered (expanded.get (), gdb_stdout);
|
puts_filtered (expanded.get ());
|
||||||
fputs_filtered ("\n", gdb_stdout);
|
puts_filtered ("\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
macro_inform_no_debuginfo ();
|
macro_inform_no_debuginfo ();
|
||||||
|
@ -91,9 +91,9 @@ macro_expand_once_command (const char *exp, int from_tty)
|
||||||
{
|
{
|
||||||
gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
|
gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
|
||||||
|
|
||||||
fputs_filtered ("expands to: ", gdb_stdout);
|
puts_filtered ("expands to: ");
|
||||||
fputs_filtered (expanded.get (), gdb_stdout);
|
puts_filtered (expanded.get ());
|
||||||
fputs_filtered ("\n", gdb_stdout);
|
puts_filtered ("\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
macro_inform_no_debuginfo ();
|
macro_inform_no_debuginfo ();
|
||||||
|
@ -137,32 +137,32 @@ print_macro_definition (const char *name,
|
||||||
struct macro_source_file *file,
|
struct macro_source_file *file,
|
||||||
int line)
|
int line)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout, "Defined at ");
|
printf_filtered ("Defined at ");
|
||||||
show_pp_source_pos (gdb_stdout, file, line);
|
show_pp_source_pos (gdb_stdout, file, line);
|
||||||
|
|
||||||
if (line != 0)
|
if (line != 0)
|
||||||
fprintf_filtered (gdb_stdout, "#define %s", name);
|
printf_filtered ("#define %s", name);
|
||||||
else
|
else
|
||||||
fprintf_filtered (gdb_stdout, "-D%s", name);
|
printf_filtered ("-D%s", name);
|
||||||
|
|
||||||
if (d->kind == macro_function_like)
|
if (d->kind == macro_function_like)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
fputs_filtered ("(", gdb_stdout);
|
puts_filtered ("(");
|
||||||
for (i = 0; i < d->argc; i++)
|
for (i = 0; i < d->argc; i++)
|
||||||
{
|
{
|
||||||
fputs_filtered (d->argv[i], gdb_stdout);
|
puts_filtered (d->argv[i]);
|
||||||
if (i + 1 < d->argc)
|
if (i + 1 < d->argc)
|
||||||
fputs_filtered (", ", gdb_stdout);
|
puts_filtered (", ");
|
||||||
}
|
}
|
||||||
fputs_filtered (")", gdb_stdout);
|
puts_filtered (")");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line != 0)
|
if (line != 0)
|
||||||
fprintf_filtered (gdb_stdout, " %s\n", d->replacement);
|
printf_filtered (" %s\n", d->replacement);
|
||||||
else
|
else
|
||||||
fprintf_filtered (gdb_stdout, "=%s\n", d->replacement);
|
printf_filtered ("=%s\n", d->replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The implementation of the `info macro' command. */
|
/* The implementation of the `info macro' command. */
|
||||||
|
@ -229,10 +229,9 @@ info_macro_command (const char *args, int from_tty)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("The symbol `%s' has no definition as a C/C++"
|
||||||
"The symbol `%s' has no definition as a C/C++"
|
" preprocessor macro\n"
|
||||||
" preprocessor macro\n"
|
"at ", name);
|
||||||
"at ", name);
|
|
||||||
show_pp_source_pos (gdb_stdout, ms->file, ms->line);
|
show_pp_source_pos (gdb_stdout, ms->file, ms->line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,18 +423,18 @@ static void
|
||||||
print_one_macro (const char *name, const struct macro_definition *macro,
|
print_one_macro (const char *name, const struct macro_definition *macro,
|
||||||
struct macro_source_file *source, int line)
|
struct macro_source_file *source, int line)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout, "macro define %s", name);
|
printf_filtered ("macro define %s", name);
|
||||||
if (macro->kind == macro_function_like)
|
if (macro->kind == macro_function_like)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
fprintf_filtered (gdb_stdout, "(");
|
printf_filtered ("(");
|
||||||
for (i = 0; i < macro->argc; ++i)
|
for (i = 0; i < macro->argc; ++i)
|
||||||
fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "",
|
printf_filtered ("%s%s", (i > 0) ? ", " : "",
|
||||||
macro->argv[i]);
|
macro->argv[i]);
|
||||||
fprintf_filtered (gdb_stdout, ")");
|
printf_filtered (")");
|
||||||
}
|
}
|
||||||
fprintf_filtered (gdb_stdout, " %s\n", macro->replacement);
|
printf_filtered (" %s\n", macro->replacement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -247,13 +247,12 @@ nbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
|
||||||
size_t size = kve->kve_end - kve->kve_start;
|
size_t size = kve->kve_end - kve->kve_start;
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
|
||||||
"Save segment, %ld bytes at %s (%c%c%c)\n",
|
(long) size,
|
||||||
(long) size,
|
paddress (target_gdbarch (), kve->kve_start),
|
||||||
paddress (target_gdbarch (), kve->kve_start),
|
kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
|
||||||
kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
|
kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
|
||||||
kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
|
kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
|
||||||
kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invoke the callback function to create the corefile segment.
|
/* Invoke the callback function to create the corefile segment.
|
||||||
|
|
|
@ -1155,7 +1155,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format == 'i')
|
if (format == 'i')
|
||||||
fputs_filtered (pc_prefix (next_address), gdb_stdout);
|
puts_filtered (pc_prefix (next_address));
|
||||||
print_address (next_gdbarch, next_address, gdb_stdout);
|
print_address (next_gdbarch, next_address, gdb_stdout);
|
||||||
printf_filtered (":");
|
printf_filtered (":");
|
||||||
for (i = maxelts;
|
for (i = maxelts;
|
||||||
|
@ -1683,7 +1683,7 @@ info_address_command (const char *exp, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
printf_filtered ("Symbol \"");
|
printf_filtered ("Symbol \"");
|
||||||
fputs_filtered (sym->print_name (), gdb_stdout);
|
puts_filtered (sym->print_name ());
|
||||||
printf_filtered ("\" is ");
|
printf_filtered ("\" is ");
|
||||||
val = SYMBOL_VALUE (sym);
|
val = SYMBOL_VALUE (sym);
|
||||||
if (SYMBOL_OBJFILE_OWNED (sym))
|
if (SYMBOL_OBJFILE_OWNED (sym))
|
||||||
|
@ -2184,9 +2184,9 @@ do_one_display (struct display *d)
|
||||||
}
|
}
|
||||||
catch (const gdb_exception_error &ex)
|
catch (const gdb_exception_error &ex)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout, _("%p[<error: %s>%p]\n"),
|
printf_filtered (_("%p[<error: %s>%p]\n"),
|
||||||
metadata_style.style ().ptr (), ex.what (),
|
metadata_style.style ().ptr (), ex.what (),
|
||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1421,9 +1421,9 @@ partial_symtab::expand_dependencies (struct objfile *objfile)
|
||||||
/* Inform about additional files to be read in. */
|
/* Inform about additional files to be read in. */
|
||||||
if (info_verbose)
|
if (info_verbose)
|
||||||
{
|
{
|
||||||
fputs_filtered (" ", gdb_stdout);
|
puts_filtered (" ");
|
||||||
wrap_here ("");
|
wrap_here ("");
|
||||||
fputs_filtered ("and ", gdb_stdout);
|
puts_filtered ("and ");
|
||||||
wrap_here ("");
|
wrap_here ("");
|
||||||
printf_filtered ("%s...", dependencies[i]->filename);
|
printf_filtered ("%s...", dependencies[i]->filename);
|
||||||
wrap_here (""); /* Flush output */
|
wrap_here (""); /* Flush output */
|
||||||
|
@ -1696,13 +1696,11 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
|
||||||
psymtab->fullname
|
psymtab->fullname
|
||||||
? psymtab->fullname : "(null)");
|
? psymtab->fullname : "(null)");
|
||||||
printf_filtered (" text addresses ");
|
printf_filtered (" text addresses ");
|
||||||
fputs_filtered (paddress (gdbarch,
|
puts_filtered (paddress (gdbarch,
|
||||||
psymtab->text_low (objfile)),
|
psymtab->text_low (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered (" -- ");
|
printf_filtered (" -- ");
|
||||||
fputs_filtered (paddress (gdbarch,
|
puts_filtered (paddress (gdbarch,
|
||||||
psymtab->text_high (objfile)),
|
psymtab->text_high (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
printf_filtered (" psymtabs_addrmap_supported %s\n",
|
printf_filtered (" psymtabs_addrmap_supported %s\n",
|
||||||
(psymtab->psymtabs_addrmap_supported
|
(psymtab->psymtabs_addrmap_supported
|
||||||
|
@ -1793,11 +1791,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
|
||||||
printf_filtered ("Psymtab ");
|
printf_filtered ("Psymtab ");
|
||||||
puts_filtered (ps->filename);
|
puts_filtered (ps->filename);
|
||||||
printf_filtered (" covers bad range ");
|
printf_filtered (" covers bad range ");
|
||||||
fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
|
puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered (" - ");
|
printf_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
|
puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1849,15 +1845,13 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
|
||||||
printf_filtered ("Psymtab ");
|
printf_filtered ("Psymtab ");
|
||||||
puts_filtered (ps->filename);
|
puts_filtered (ps->filename);
|
||||||
printf_filtered (" covers ");
|
printf_filtered (" covers ");
|
||||||
fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
|
puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered (" - ");
|
printf_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
|
puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered (" but symtab covers only ");
|
printf_filtered (" but symtab covers only ");
|
||||||
fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
|
puts_filtered (paddress (gdbarch, BLOCK_START (b)));
|
||||||
printf_filtered (" - ");
|
printf_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
|
puts_filtered (paddress (gdbarch, BLOCK_END (b)));
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -414,7 +414,7 @@ get_set_value (const char *args, int from_tty,
|
||||||
|
|
||||||
const char *str = set_doc_string.get ();
|
const char *str = set_doc_string.get ();
|
||||||
if (str != nullptr && str[0] != '\0')
|
if (str != nullptr && str[0] != '\0')
|
||||||
fprintf_filtered (gdb_stdout, "%s\n", str);
|
printf_filtered ("%s\n", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A callback function that is registered against the respective
|
/* A callback function that is registered against the respective
|
||||||
|
|
25
gdb/stack.c
25
gdb/stack.c
|
@ -1549,11 +1549,11 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
{
|
{
|
||||||
printf_filtered (_("Stack frame at "));
|
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 (":\n");
|
||||||
printf_filtered (" %s = ", pc_regname);
|
printf_filtered (" %s = ", pc_regname);
|
||||||
if (frame_pc_p)
|
if (frame_pc_p)
|
||||||
fputs_filtered (paddress (gdbarch, get_frame_pc (fi)), gdb_stdout);
|
puts_filtered (paddress (gdbarch, get_frame_pc (fi)));
|
||||||
else
|
else
|
||||||
fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout);
|
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)
|
if (funname)
|
||||||
{
|
{
|
||||||
printf_filtered (" in ");
|
printf_filtered (" in ");
|
||||||
fputs_filtered (funname, gdb_stdout);
|
puts_filtered (funname);
|
||||||
}
|
}
|
||||||
wrap_here (" ");
|
wrap_here (" ");
|
||||||
if (sal.symtab)
|
if (sal.symtab)
|
||||||
|
@ -1603,7 +1603,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (caller_pc_p)
|
if (caller_pc_p)
|
||||||
fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);
|
puts_filtered (paddress (gdbarch, caller_pc));
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
|
|
||||||
if (calling_frame_info == NULL)
|
if (calling_frame_info == NULL)
|
||||||
|
@ -1623,8 +1623,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf_filtered (" called by frame at ");
|
printf_filtered (" called by frame at ");
|
||||||
fputs_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)),
|
puts_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)));
|
||||||
gdb_stdout);
|
|
||||||
}
|
}
|
||||||
if (get_next_frame (fi) && calling_frame_info)
|
if (get_next_frame (fi) && calling_frame_info)
|
||||||
puts_filtered (",");
|
puts_filtered (",");
|
||||||
|
@ -1632,8 +1631,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
if (get_next_frame (fi))
|
if (get_next_frame (fi))
|
||||||
{
|
{
|
||||||
printf_filtered (" caller of frame at ");
|
printf_filtered (" caller of frame at ");
|
||||||
fputs_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))),
|
puts_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))));
|
||||||
gdb_stdout);
|
|
||||||
}
|
}
|
||||||
if (get_next_frame (fi) || calling_frame_info)
|
if (get_next_frame (fi) || calling_frame_info)
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
|
@ -1653,7 +1651,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf_filtered (" Arglist at ");
|
printf_filtered (" Arglist at ");
|
||||||
fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
|
puts_filtered (paddress (gdbarch, arg_list));
|
||||||
printf_filtered (",");
|
printf_filtered (",");
|
||||||
|
|
||||||
if (!gdbarch_frame_num_args_p (gdbarch))
|
if (!gdbarch_frame_num_args_p (gdbarch))
|
||||||
|
@ -1686,7 +1684,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf_filtered (" Locals at ");
|
printf_filtered (" Locals at ");
|
||||||
fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
|
puts_filtered (paddress (gdbarch, arg_list));
|
||||||
printf_filtered (",");
|
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);
|
(value_contents_all (value).data (), sp_size, byte_order);
|
||||||
|
|
||||||
printf_filtered (" Previous frame's sp is ");
|
printf_filtered (" Previous frame's sp is ");
|
||||||
fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
|
puts_filtered (paddress (gdbarch, sp));
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
}
|
}
|
||||||
else if (VALUE_LVAL (value) == lval_memory)
|
else if (VALUE_LVAL (value) == lval_memory)
|
||||||
{
|
{
|
||||||
printf_filtered (" Previous frame's sp at ");
|
printf_filtered (" Previous frame's sp at ");
|
||||||
fputs_filtered (paddress (gdbarch, value_address (value)),
|
puts_filtered (paddress (gdbarch, value_address (value)));
|
||||||
gdb_stdout);
|
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
}
|
}
|
||||||
else if (VALUE_LVAL (value) == lval_register)
|
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 (" ");
|
wrap_here (" ");
|
||||||
printf_filtered (" %s at ",
|
printf_filtered (" %s at ",
|
||||||
gdbarch_register_name (gdbarch, i));
|
gdbarch_register_name (gdbarch, i));
|
||||||
fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
|
puts_filtered (paddress (gdbarch, addr));
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3211,13 +3211,13 @@ list_overlays_command (const char *args, int from_tty)
|
||||||
name = bfd_section_name (osect->the_bfd_section);
|
name = bfd_section_name (osect->the_bfd_section);
|
||||||
|
|
||||||
printf_filtered ("Section %s, loaded at ", name);
|
printf_filtered ("Section %s, loaded at ", name);
|
||||||
fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
|
puts_filtered (paddress (gdbarch, lma));
|
||||||
puts_filtered (" - ");
|
puts_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
|
puts_filtered (paddress (gdbarch, lma + size));
|
||||||
printf_filtered (", mapped at ");
|
printf_filtered (", mapped at ");
|
||||||
fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
|
puts_filtered (paddress (gdbarch, vma));
|
||||||
puts_filtered (" - ");
|
puts_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
|
puts_filtered (paddress (gdbarch, vma + size));
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
|
|
||||||
nmapped++;
|
nmapped++;
|
||||||
|
|
|
@ -873,7 +873,7 @@ gdb_readline_no_editing (const char *prompt)
|
||||||
/* Don't use a _filtered function here. It causes the assumed
|
/* Don't use a _filtered function here. It causes the assumed
|
||||||
character position to be off, since the newline we read from
|
character position to be off, since the newline we read from
|
||||||
the user is not accounted for. */
|
the user is not accounted for. */
|
||||||
fputs_unfiltered (prompt, gdb_stdout);
|
puts_unfiltered (prompt);
|
||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2567,8 +2567,8 @@ info_scope_command (const char *args_in, int from_tty)
|
||||||
printf_filtered ("constant bytes: ");
|
printf_filtered ("constant bytes: ");
|
||||||
if (SYMBOL_TYPE (sym))
|
if (SYMBOL_TYPE (sym))
|
||||||
for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
|
for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
|
||||||
fprintf_filtered (gdb_stdout, " %02x",
|
printf_filtered (" %02x",
|
||||||
(unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
|
(unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
|
||||||
break;
|
break;
|
||||||
case LOC_STATIC:
|
case LOC_STATIC:
|
||||||
printf_filtered ("in static storage at address ");
|
printf_filtered ("in static storage at address ");
|
||||||
|
|
|
@ -554,7 +554,7 @@ whatis_exp (const char *exp, int show)
|
||||||
if (flags.print_offsets
|
if (flags.print_offsets
|
||||||
&& (type->code () == TYPE_CODE_STRUCT
|
&& (type->code () == TYPE_CODE_STRUCT
|
||||||
|| type->code () == TYPE_CODE_UNION))
|
|| type->code () == TYPE_CODE_UNION))
|
||||||
fprintf_filtered (gdb_stdout, "/* offset | size */ ");
|
printf_filtered ("/* offset | size */ ");
|
||||||
|
|
||||||
printf_filtered ("type = ");
|
printf_filtered ("type = ");
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,8 @@ static unsigned int nr_failed_invariants;
|
||||||
static void
|
static void
|
||||||
broken_doc_invariant (const char *prefix, const char *name, const char *msg)
|
broken_doc_invariant (const char *prefix, const char *name, const char *msg)
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("help doc broken invariant: command '%s%s' help doc %s\n",
|
||||||
"help doc broken invariant: command '%s%s' help doc %s\n",
|
prefix, name, msg);
|
||||||
prefix, name, msg);
|
|
||||||
nr_failed_invariants++;
|
nr_failed_invariants++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,13 +129,12 @@ traverse_command_structure (struct cmd_list_element **list,
|
||||||
auto dupl = lists.find (list);
|
auto dupl = lists.find (list);
|
||||||
if (dupl != lists.end ())
|
if (dupl != lists.end ())
|
||||||
{
|
{
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("list %p duplicated,"
|
||||||
"list %p duplicated,"
|
" reachable via prefix '%s' and '%s'."
|
||||||
" reachable via prefix '%s' and '%s'."
|
" Duplicated list first command is '%s'\n",
|
||||||
" Duplicated list first command is '%s'\n",
|
list,
|
||||||
list,
|
prefix, dupl->second,
|
||||||
prefix, dupl->second,
|
(*list)->name);
|
||||||
(*list)->name);
|
|
||||||
nr_duplicates++;
|
nr_duplicates++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -165,17 +163,15 @@ traverse_command_structure (struct cmd_list_element **list,
|
||||||
|| (prefixcmd == nullptr && *list != cmdlist))
|
|| (prefixcmd == nullptr && *list != cmdlist))
|
||||||
{
|
{
|
||||||
if (c->prefix == nullptr)
|
if (c->prefix == nullptr)
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("list %p reachable via prefix '%s'."
|
||||||
"list %p reachable via prefix '%s'."
|
" command '%s' has null prefixcmd\n",
|
||||||
" command '%s' has null prefixcmd\n",
|
list,
|
||||||
list,
|
prefix, c->name);
|
||||||
prefix, c->name);
|
|
||||||
else
|
else
|
||||||
fprintf_filtered (gdb_stdout,
|
printf_filtered ("list %p reachable via prefix '%s'."
|
||||||
"list %p reachable via prefix '%s'."
|
" command '%s' has a different prefixcmd\n",
|
||||||
" command '%s' has a different prefixcmd\n",
|
list,
|
||||||
list,
|
prefix, c->name);
|
||||||
prefix, c->name);
|
|
||||||
nr_invalid_prefixcmd++;
|
nr_invalid_prefixcmd++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
gdb/utils.c
10
gdb/utils.c
|
@ -1587,13 +1587,13 @@ puts_filtered_tabular (char *string, int width, int right)
|
||||||
gdb_assert (chars_per_line > 0);
|
gdb_assert (chars_per_line > 0);
|
||||||
if (chars_per_line == UINT_MAX)
|
if (chars_per_line == UINT_MAX)
|
||||||
{
|
{
|
||||||
fputs_filtered (string, gdb_stdout);
|
puts_filtered (string);
|
||||||
fputs_filtered ("\n", gdb_stdout);
|
puts_filtered ("\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
|
if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
|
||||||
fputs_filtered ("\n", gdb_stdout);
|
puts_filtered ("\n");
|
||||||
|
|
||||||
if (width >= chars_per_line)
|
if (width >= chars_per_line)
|
||||||
width = chars_per_line - 1;
|
width = chars_per_line - 1;
|
||||||
|
@ -1610,8 +1610,8 @@ puts_filtered_tabular (char *string, int width, int right)
|
||||||
while (spaces--)
|
while (spaces--)
|
||||||
spacebuf[spaces] = ' ';
|
spacebuf[spaces] = ' ';
|
||||||
|
|
||||||
fputs_filtered (spacebuf, gdb_stdout);
|
puts_filtered (spacebuf);
|
||||||
fputs_filtered (string, gdb_stdout);
|
puts_filtered (string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue