Remove some uses of printf_unfiltered
A number of spots call printf_unfiltered only because they are in code that should not be interrupted by the pager. However, I believe these cases are all handled by infrun's blanket ban on paging, and so can be converted to the default (_filtered) API. After this patch, I think all the remaining _unfiltered calls are ones that really ought to be. A few -- namely in complete_command -- could be replaced by a scoped assignment to pagination_enabled, but for the remainder, the code seems simple enough like this.
This commit is contained in:
parent
9e4902bfac
commit
830df12588
16 changed files with 74 additions and 74 deletions
|
@ -1296,8 +1296,8 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
|
|||
fbsd_lwp_debug_printf ("deleting thread for LWP %u",
|
||||
pl.pl_lwpid);
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[%s exited]\n"),
|
||||
target_pid_to_str (wptid).c_str ());
|
||||
printf_filtered (_("[%s exited]\n"),
|
||||
target_pid_to_str (wptid).c_str ());
|
||||
low_delete_thread (thr);
|
||||
delete_thread (thr);
|
||||
}
|
||||
|
|
10
gdb/infcmd.c
10
gdb/infcmd.c
|
@ -1179,11 +1179,11 @@ signal_command (const char *signum_exp, int from_tty)
|
|||
&& signal_pass_state (tp->stop_signal ()))
|
||||
{
|
||||
if (!must_confirm)
|
||||
printf_unfiltered (_("Note:\n"));
|
||||
printf_unfiltered (_(" Thread %s previously stopped with signal %s, %s.\n"),
|
||||
print_thread_id (tp),
|
||||
gdb_signal_to_name (tp->stop_signal ()),
|
||||
gdb_signal_to_string (tp->stop_signal ()));
|
||||
printf_filtered (_("Note:\n"));
|
||||
printf_filtered (_(" Thread %s previously stopped with signal %s, %s.\n"),
|
||||
print_thread_id (tp),
|
||||
gdb_signal_to_name (tp->stop_signal ()),
|
||||
gdb_signal_to_string (tp->stop_signal ()));
|
||||
must_confirm = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,11 +164,11 @@ add_inferior (int pid)
|
|||
if (print_inferior_events)
|
||||
{
|
||||
if (pid != 0)
|
||||
printf_unfiltered (_("[New inferior %d (%s)]\n"),
|
||||
inf->num,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered (_("[New inferior %d (%s)]\n"),
|
||||
inf->num,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
else
|
||||
printf_unfiltered (_("[New inferior %d]\n"), inf->num);
|
||||
printf_filtered (_("[New inferior %d]\n"), inf->num);
|
||||
}
|
||||
|
||||
return inf;
|
||||
|
@ -264,9 +264,9 @@ detach_inferior (inferior *inf)
|
|||
exit_inferior_1 (inf, 0);
|
||||
|
||||
if (print_inferior_events)
|
||||
printf_unfiltered (_("[Inferior %d (%s) detached]\n"),
|
||||
inf->num,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered (_("[Inferior %d (%s) detached]\n"),
|
||||
inf->num,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
10
gdb/infrun.c
10
gdb/infrun.c
|
@ -1130,9 +1130,9 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
|
|||
|
||||
/* What is this a.out's name? */
|
||||
process_ptid = ptid_t (pid);
|
||||
printf_unfiltered (_("%s is executing new program: %s\n"),
|
||||
target_pid_to_str (process_ptid).c_str (),
|
||||
exec_file_target);
|
||||
printf_filtered (_("%s is executing new program: %s\n"),
|
||||
target_pid_to_str (process_ptid).c_str (),
|
||||
exec_file_target);
|
||||
|
||||
/* We've followed the inferior through an exec. Therefore, the
|
||||
inferior has essentially been killed & reborn. */
|
||||
|
@ -4159,7 +4159,7 @@ fetch_inferior_event ()
|
|||
&& exec_done_display_p
|
||||
&& (inferior_ptid == null_ptid
|
||||
|| inferior_thread ()->state != THREAD_RUNNING))
|
||||
printf_unfiltered (_("completed.\n"));
|
||||
printf_filtered (_("completed.\n"));
|
||||
}
|
||||
|
||||
/* See infrun.h. */
|
||||
|
@ -8851,7 +8851,7 @@ Are you sure you want to change it? "),
|
|||
sigs[signum] = 1;
|
||||
}
|
||||
else
|
||||
printf_unfiltered (_("Not confirmed, unchanged.\n"));
|
||||
printf_filtered (_("Not confirmed, unchanged.\n"));
|
||||
}
|
||||
break;
|
||||
case GDB_SIGNAL_0:
|
||||
|
|
|
@ -894,8 +894,8 @@ exit_lwp (struct lwp_info *lp)
|
|||
if (th)
|
||||
{
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[%s exited]\n"),
|
||||
target_pid_to_str (lp->ptid).c_str ());
|
||||
printf_filtered (_("[%s exited]\n"),
|
||||
target_pid_to_str (lp->ptid).c_str ());
|
||||
|
||||
delete_thread (th);
|
||||
}
|
||||
|
|
|
@ -936,7 +936,7 @@ try_thread_db_load_1 (struct thread_db_info *info)
|
|||
return false;
|
||||
}
|
||||
|
||||
printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n"));
|
||||
printf_filtered (_("[Thread debugging using libthread_db enabled]\n"));
|
||||
|
||||
if (!libthread_db_search_path.empty () || libthread_db_debug)
|
||||
{
|
||||
|
@ -946,8 +946,8 @@ try_thread_db_load_1 (struct thread_db_info *info)
|
|||
if (library == NULL)
|
||||
library = LIBTHREAD_DB_SO;
|
||||
|
||||
printf_unfiltered (_("Using host libthread_db library \"%ps\".\n"),
|
||||
styled_string (file_name_style.style (), library));
|
||||
printf_filtered (_("Using host libthread_db library \"%ps\".\n"),
|
||||
styled_string (file_name_style.style (), library));
|
||||
}
|
||||
|
||||
/* The thread library was detected. Activate the thread_db target
|
||||
|
|
|
@ -371,11 +371,11 @@ mdebug_build_psymtabs (minimal_symbol_reader &reader,
|
|||
if (compare_glevel (max_glevel, GLEVEL_2) < 0)
|
||||
{
|
||||
if (max_gdbinfo == 0)
|
||||
printf_unfiltered (_("\n%s not compiled with -g, "
|
||||
"debugging support is limited.\n"),
|
||||
objfile->name);
|
||||
printf_unfiltered (_("You should compile with -g2 or "
|
||||
"-g3 for best debugging support.\n"));
|
||||
printf_filtered (_("\n%s not compiled with -g, "
|
||||
"debugging support is limited.\n"),
|
||||
objfile->name);
|
||||
printf_filtered (_("You should compile with -g2 or "
|
||||
"-g3 for best debugging support.\n"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -626,8 +626,8 @@ nbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
|
|||
ourstatus->set_thread_exited (0);
|
||||
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[%s exited]\n"),
|
||||
target_pid_to_str (wptid).c_str ());
|
||||
printf_filtered (_("[%s exited]\n"),
|
||||
target_pid_to_str (wptid).c_str ());
|
||||
delete_thread (thr);
|
||||
}
|
||||
|
||||
|
|
|
@ -2122,8 +2122,8 @@ wait_again:
|
|||
if (what == SYS_lwp_exit)
|
||||
{
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[%s exited]\n"),
|
||||
target_pid_to_str (retval).c_str ());
|
||||
printf_filtered (_("[%s exited]\n"),
|
||||
target_pid_to_str (retval).c_str ());
|
||||
delete_thread (find_thread_ptid (this, retval));
|
||||
target_continue_no_signal (ptid);
|
||||
goto wait_again;
|
||||
|
@ -2229,8 +2229,8 @@ wait_again:
|
|||
else if (what == SYS_lwp_exit)
|
||||
{
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[%s exited]\n"),
|
||||
target_pid_to_str (retval).c_str ());
|
||||
printf_filtered (_("[%s exited]\n"),
|
||||
target_pid_to_str (retval).c_str ());
|
||||
delete_thread (find_thread_ptid (this, retval));
|
||||
status->set_spurious ();
|
||||
return retval;
|
||||
|
|
10
gdb/remote.c
10
gdb/remote.c
|
@ -6005,8 +6005,8 @@ remote_target::remote_detach_1 (inferior *inf, int from_tty)
|
|||
|
||||
target_mourn_inferior (inferior_ptid);
|
||||
if (print_inferior_events)
|
||||
printf_unfiltered (_("[Inferior %d (%s) detached]\n"),
|
||||
inf->num, infpid.c_str ());
|
||||
printf_filtered (_("[Inferior %d (%s) detached]\n"),
|
||||
inf->num, infpid.c_str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -9961,7 +9961,7 @@ remote_target::getpkt_or_notif_sane_1 (gdb::char_vector *buf,
|
|||
{
|
||||
/* We have tried hard enough, and just can't receive the
|
||||
packet/notification. Give up. */
|
||||
printf_unfiltered (_("Ignoring packet error, continuing...\n"));
|
||||
printf_filtered (_("Ignoring packet error, continuing...\n"));
|
||||
|
||||
/* Skip the ack char if we're in no-ack mode. */
|
||||
if (!rs->noack_mode)
|
||||
|
@ -12312,8 +12312,8 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename,
|
|||
{
|
||||
static int warning_issued = 0;
|
||||
|
||||
printf_unfiltered (_("Reading %s from remote target...\n"),
|
||||
filename);
|
||||
printf_filtered (_("Reading %s from remote target...\n"),
|
||||
filename);
|
||||
|
||||
if (!warning_issued)
|
||||
{
|
||||
|
|
|
@ -638,7 +638,7 @@ check_for_thread_db (void)
|
|||
break;
|
||||
|
||||
case TD_OK:
|
||||
printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n"));
|
||||
printf_filtered (_("[Thread debugging using libthread_db enabled]\n"));
|
||||
|
||||
/* The thread library was detected. Activate the sol_thread target. */
|
||||
current_inferior ()->push_target (&sol_thread_ops);
|
||||
|
|
|
@ -292,10 +292,10 @@ lm_addr_check (const struct so_list *so, bfd *abfd)
|
|||
&& (l_addr & align) == ((l_dynaddr - dynaddr) & align))
|
||||
{
|
||||
if (info_verbose)
|
||||
printf_unfiltered (_("Using PIC (Position Independent Code) "
|
||||
"prelink displacement %s for \"%s\".\n"),
|
||||
paddress (target_gdbarch (), l_addr),
|
||||
so->so_name);
|
||||
printf_filtered (_("Using PIC (Position Independent Code) "
|
||||
"prelink displacement %s for \"%s\".\n"),
|
||||
paddress (target_gdbarch (), l_addr),
|
||||
so->so_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2834,10 +2834,10 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
|
|||
the executable symbols/file has been already relocated to
|
||||
displacement. */
|
||||
|
||||
printf_unfiltered (_("Using PIE (Position Independent Executable) "
|
||||
"displacement %s for \"%s\".\n"),
|
||||
paddress (target_gdbarch (), exec_displacement),
|
||||
bfd_get_filename (current_program_space->exec_bfd ()));
|
||||
printf_filtered (_("Using PIE (Position Independent Executable) "
|
||||
"displacement %s for \"%s\".\n"),
|
||||
paddress (target_gdbarch (), exec_displacement),
|
||||
bfd_get_filename (current_program_space->exec_bfd ()));
|
||||
}
|
||||
|
||||
*displacementp = exec_displacement;
|
||||
|
|
14
gdb/solib.c
14
gdb/solib.c
|
@ -1022,11 +1022,11 @@ solib_add (const char *pattern, int from_tty, int readsyms)
|
|||
{
|
||||
if (pattern != NULL)
|
||||
{
|
||||
printf_unfiltered (_("Loading symbols for shared libraries: %s\n"),
|
||||
pattern);
|
||||
printf_filtered (_("Loading symbols for shared libraries: %s\n"),
|
||||
pattern);
|
||||
}
|
||||
else
|
||||
printf_unfiltered (_("Loading symbols for shared libraries.\n"));
|
||||
printf_filtered (_("Loading symbols for shared libraries.\n"));
|
||||
}
|
||||
|
||||
current_program_space->solib_add_generation++;
|
||||
|
@ -1071,8 +1071,8 @@ solib_add (const char *pattern, int from_tty, int readsyms)
|
|||
/* If no pattern was given, be quiet for shared
|
||||
libraries we have already loaded. */
|
||||
if (pattern && (from_tty || info_verbose))
|
||||
printf_unfiltered (_("Symbols already loaded for %s\n"),
|
||||
gdb->so_name);
|
||||
printf_filtered (_("Symbols already loaded for %s\n"),
|
||||
gdb->so_name);
|
||||
}
|
||||
else if (solib_read_symbols (gdb, add_flags))
|
||||
loaded_any_symbols = true;
|
||||
|
@ -1083,7 +1083,7 @@ solib_add (const char *pattern, int from_tty, int readsyms)
|
|||
breakpoint_re_set ();
|
||||
|
||||
if (from_tty && pattern && ! any_matches)
|
||||
printf_unfiltered
|
||||
printf_filtered
|
||||
("No loaded shared libraries match the pattern `%s'.\n", pattern);
|
||||
|
||||
if (loaded_any_symbols)
|
||||
|
@ -1359,7 +1359,7 @@ static void
|
|||
reload_shared_libraries_1 (int from_tty)
|
||||
{
|
||||
if (print_symbol_loading_p (from_tty, 0, 0))
|
||||
printf_unfiltered (_("Loading symbols for shared libraries.\n"));
|
||||
printf_filtered (_("Loading symbols for shared libraries.\n"));
|
||||
|
||||
for (struct so_list *so : current_program_space->solibs ())
|
||||
{
|
||||
|
|
16
gdb/target.c
16
gdb/target.c
|
@ -3646,11 +3646,11 @@ target_announce_detach (int from_tty)
|
|||
pid = inferior_ptid.pid ();
|
||||
exec_file = get_exec_file (0);
|
||||
if (exec_file == nullptr)
|
||||
printf_unfiltered ("Detaching from pid %s\n",
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered ("Detaching from pid %s\n",
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
else
|
||||
printf_unfiltered (_("Detaching from program: %s, %s\n"), exec_file,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered (_("Detaching from program: %s, %s\n"), exec_file,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
}
|
||||
|
||||
/* See target.h */
|
||||
|
@ -3664,11 +3664,11 @@ target_announce_attach (int from_tty, int pid)
|
|||
const char *exec_file = get_exec_file (0);
|
||||
|
||||
if (exec_file != nullptr)
|
||||
printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered ("Attaching to program: %s, %s\n", exec_file,
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
else
|
||||
printf_unfiltered ("Attaching to %s\n",
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
printf_filtered ("Attaching to %s\n",
|
||||
target_pid_to_str (ptid_t (pid)).c_str ());
|
||||
}
|
||||
|
||||
/* The inferior process has died. Long live the inferior! */
|
||||
|
|
|
@ -293,7 +293,7 @@ add_thread_with_info (process_stratum_target *targ, ptid_t ptid,
|
|||
result->priv.reset (priv);
|
||||
|
||||
if (print_thread_events)
|
||||
printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid).c_str ());
|
||||
printf_filtered (_("[New %s]\n"), target_pid_to_str (ptid).c_str ());
|
||||
|
||||
annotate_new_thread ();
|
||||
return result;
|
||||
|
|
|
@ -429,11 +429,11 @@ windows_delete_thread (ptid_t ptid, DWORD exit_code, bool main_thread_p)
|
|||
here as well. */
|
||||
|
||||
if (info_verbose)
|
||||
printf_unfiltered ("[Deleting %s]\n", target_pid_to_str (ptid).c_str ());
|
||||
printf_filtered ("[Deleting %s]\n", target_pid_to_str (ptid).c_str ());
|
||||
else if (print_thread_events && !main_thread_p)
|
||||
printf_unfiltered (_("[%s exited with code %u]\n"),
|
||||
target_pid_to_str (ptid).c_str (),
|
||||
(unsigned) exit_code);
|
||||
printf_filtered (_("[%s exited with code %u]\n"),
|
||||
target_pid_to_str (ptid).c_str (),
|
||||
(unsigned) exit_code);
|
||||
|
||||
delete_thread (find_thread_ptid (&the_windows_nat_target, ptid));
|
||||
|
||||
|
@ -1631,11 +1631,11 @@ windows_nat_target::get_windows_debug_event (int pid,
|
|||
default:
|
||||
if (saw_create != 1)
|
||||
break;
|
||||
printf_unfiltered ("gdb: kernel event for pid=%u tid=0x%x\n",
|
||||
(unsigned) current_event.dwProcessId,
|
||||
(unsigned) current_event.dwThreadId);
|
||||
printf_unfiltered (" unknown event code %u\n",
|
||||
(unsigned) current_event.dwDebugEventCode);
|
||||
printf_filtered ("gdb: kernel event for pid=%u tid=0x%x\n",
|
||||
(unsigned) current_event.dwProcessId,
|
||||
(unsigned) current_event.dwThreadId);
|
||||
printf_filtered (" unknown event code %u\n",
|
||||
(unsigned) current_event.dwDebugEventCode);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue