mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
Use filtered output in gnu-nat.c commands
gnu-nat.c has a number of ordinary commands that should use filtered output. In a few cases, I changed the output to use gdb_stderr as well. I can't compile this file, so this patch is split out as a "best effort".
This commit is contained in:
102
gdb/gnu-nat.c
102
gdb/gnu-nat.c
@ -2704,29 +2704,33 @@ struct cmd_list_element *show_thread_default_cmd_list = NULL;
|
|||||||
static void
|
static void
|
||||||
set_thread_cmd (const char *args, int from_tty)
|
set_thread_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
printf_unfiltered ("\"set thread\" must be followed by the "
|
fprintf_filtered (gdb_stderr,
|
||||||
"name of a thread property, or \"default\".\n");
|
"\"set thread\" must be followed by the "
|
||||||
|
"name of a thread property, or \"default\".\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_thread_cmd (const char *args, int from_tty)
|
show_thread_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
printf_unfiltered ("\"show thread\" must be followed by the "
|
fprintf_unfiltered (gdb_stderr,
|
||||||
"name of a thread property, or \"default\".\n");
|
"\"show thread\" must be followed by the "
|
||||||
|
"name of a thread property, or \"default\".\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_thread_default_cmd (const char *args, int from_tty)
|
set_thread_default_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
printf_unfiltered ("\"set thread default\" must be followed "
|
fprintf_unfiltered (gdb_stderr,
|
||||||
"by the name of a thread property.\n");
|
"\"set thread default\" must be followed "
|
||||||
|
"by the name of a thread property.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_thread_default_cmd (const char *args, int from_tty)
|
show_thread_default_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
printf_unfiltered ("\"show thread default\" must be followed "
|
fprintf_unfiltered (gdb_stderr,
|
||||||
"by the name of a thread property.\n");
|
"\"show thread default\" must be followed "
|
||||||
|
"by the name of a thread property.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2818,10 +2822,10 @@ show_task_pause_cmd (const char *args, int from_tty)
|
|||||||
struct inf *inf = cur_inf ();
|
struct inf *inf = cur_inf ();
|
||||||
|
|
||||||
check_empty (args, "show task pause");
|
check_empty (args, "show task pause");
|
||||||
printf_unfiltered ("The inferior task %s suspended while gdb has control.\n",
|
printf_filtered ("The inferior task %s suspended while gdb has control.\n",
|
||||||
inf->task
|
inf->task
|
||||||
? (inf->pause_sc == 0 ? "isn't" : "is")
|
? (inf->pause_sc == 0 ? "isn't" : "is")
|
||||||
: (inf->pause_sc == 0 ? "won't be" : "will be"));
|
: (inf->pause_sc == 0 ? "won't be" : "will be"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2835,9 +2839,9 @@ static void
|
|||||||
show_task_detach_sc_cmd (const char *args, int from_tty)
|
show_task_detach_sc_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
check_empty (args, "show task detach-suspend-count");
|
check_empty (args, "show task detach-suspend-count");
|
||||||
printf_unfiltered ("The inferior task will be left with a "
|
printf_filtered ("The inferior task will be left with a "
|
||||||
"suspend count of %d when detaching.\n",
|
"suspend count of %d when detaching.\n",
|
||||||
cur_inf ()->detach_sc);
|
cur_inf ()->detach_sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2857,9 +2861,9 @@ show_thread_default_pause_cmd (const char *args, int from_tty)
|
|||||||
int sc = inf->default_thread_pause_sc;
|
int sc = inf->default_thread_pause_sc;
|
||||||
|
|
||||||
check_empty (args, "show thread default pause");
|
check_empty (args, "show thread default pause");
|
||||||
printf_unfiltered ("New threads %s suspended while gdb has control%s.\n",
|
printf_filtered ("New threads %s suspended while gdb has control%s.\n",
|
||||||
sc ? "are" : "aren't",
|
sc ? "are" : "aren't",
|
||||||
!sc && inf->pause_sc ? " (but the task is)" : "");
|
!sc && inf->pause_sc ? " (but the task is)" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2877,8 +2881,8 @@ show_thread_default_run_cmd (const char *args, int from_tty)
|
|||||||
struct inf *inf = cur_inf ();
|
struct inf *inf = cur_inf ();
|
||||||
|
|
||||||
check_empty (args, "show thread default run");
|
check_empty (args, "show thread default run");
|
||||||
printf_unfiltered ("New threads %s allowed to run.\n",
|
printf_filtered ("New threads %s allowed to run.\n",
|
||||||
inf->default_thread_run_sc == 0 ? "are" : "aren't");
|
inf->default_thread_run_sc == 0 ? "are" : "aren't");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2892,8 +2896,8 @@ static void
|
|||||||
show_thread_default_detach_sc_cmd (const char *args, int from_tty)
|
show_thread_default_detach_sc_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
check_empty (args, "show thread default detach-suspend-count");
|
check_empty (args, "show thread default detach-suspend-count");
|
||||||
printf_unfiltered ("New threads will get a detach-suspend-count of %d.\n",
|
printf_filtered ("New threads will get a detach-suspend-count of %d.\n",
|
||||||
cur_inf ()->default_thread_detach_sc);
|
cur_inf ()->default_thread_detach_sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2956,8 +2960,8 @@ show_stopped_cmd (const char *args, int from_tty)
|
|||||||
struct inf *inf = active_inf ();
|
struct inf *inf = active_inf ();
|
||||||
|
|
||||||
check_empty (args, "show stopped");
|
check_empty (args, "show stopped");
|
||||||
printf_unfiltered ("The inferior process %s stopped.\n",
|
printf_filtered ("The inferior process %s stopped.\n",
|
||||||
inf->stopped ? "is" : "isn't");
|
inf->stopped ? "is" : "isn't");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2985,10 +2989,10 @@ show_sig_thread_cmd (const char *args, int from_tty)
|
|||||||
|
|
||||||
check_empty (args, "show signal-thread");
|
check_empty (args, "show signal-thread");
|
||||||
if (inf->signal_thread)
|
if (inf->signal_thread)
|
||||||
printf_unfiltered ("The signal thread is %s.\n",
|
printf_filtered ("The signal thread is %s.\n",
|
||||||
proc_string (inf->signal_thread));
|
proc_string (inf->signal_thread));
|
||||||
else
|
else
|
||||||
printf_unfiltered ("There is no signal thread.\n");
|
printf_filtered ("There is no signal thread.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3016,10 +3020,10 @@ show_signals_cmd (const char *args, int from_tty)
|
|||||||
struct inf *inf = cur_inf ();
|
struct inf *inf = cur_inf ();
|
||||||
|
|
||||||
check_empty (args, "show signals");
|
check_empty (args, "show signals");
|
||||||
printf_unfiltered ("The inferior process's signals %s intercepted.\n",
|
printf_filtered ("The inferior process's signals %s intercepted.\n",
|
||||||
inf->task
|
inf->task
|
||||||
? (inf->traced ? "are" : "aren't")
|
? (inf->traced ? "are" : "aren't")
|
||||||
: (inf->want_signals ? "will be" : "won't be"));
|
: (inf->want_signals ? "will be" : "won't be"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3045,18 +3049,18 @@ show_exceptions_cmd (const char *args, int from_tty)
|
|||||||
struct inf *inf = cur_inf ();
|
struct inf *inf = cur_inf ();
|
||||||
|
|
||||||
check_empty (args, "show exceptions");
|
check_empty (args, "show exceptions");
|
||||||
printf_unfiltered ("Exceptions in the inferior %s trapped.\n",
|
printf_filtered ("Exceptions in the inferior %s trapped.\n",
|
||||||
inf->task
|
inf->task
|
||||||
? (inf->want_exceptions ? "are" : "aren't")
|
? (inf->want_exceptions ? "are" : "aren't")
|
||||||
: (inf->want_exceptions ? "will be" : "won't be"));
|
: (inf->want_exceptions ? "will be" : "won't be"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_task_cmd (const char *args, int from_tty)
|
set_task_cmd (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
printf_unfiltered ("\"set task\" must be followed by the name"
|
printf_filtered ("\"set task\" must be followed by the name"
|
||||||
" of a task property.\n");
|
" of a task property.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3320,10 +3324,10 @@ show_thread_pause_cmd (const char *args, int from_tty)
|
|||||||
int sc = thread->pause_sc;
|
int sc = thread->pause_sc;
|
||||||
|
|
||||||
check_empty (args, "show task pause");
|
check_empty (args, "show task pause");
|
||||||
printf_unfiltered ("Thread %s %s suspended while gdb has control%s.\n",
|
printf_filtered ("Thread %s %s suspended while gdb has control%s.\n",
|
||||||
proc_string (thread),
|
proc_string (thread),
|
||||||
sc ? "is" : "isn't",
|
sc ? "is" : "isn't",
|
||||||
!sc && thread->inf->pause_sc ? " (but the task is)" : "");
|
!sc && thread->inf->pause_sc ? " (but the task is)" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3340,9 +3344,9 @@ show_thread_run_cmd (const char *args, int from_tty)
|
|||||||
struct proc *thread = cur_thread ();
|
struct proc *thread = cur_thread ();
|
||||||
|
|
||||||
check_empty (args, "show thread run");
|
check_empty (args, "show thread run");
|
||||||
printf_unfiltered ("Thread %s %s allowed to run.",
|
printf_filtered ("Thread %s %s allowed to run.",
|
||||||
proc_string (thread),
|
proc_string (thread),
|
||||||
thread->run_sc == 0 ? "is" : "isn't");
|
thread->run_sc == 0 ? "is" : "isn't");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3358,10 +3362,10 @@ show_thread_detach_sc_cmd (const char *args, int from_tty)
|
|||||||
struct proc *thread = cur_thread ();
|
struct proc *thread = cur_thread ();
|
||||||
|
|
||||||
check_empty (args, "show thread detach-suspend-count");
|
check_empty (args, "show thread detach-suspend-count");
|
||||||
printf_unfiltered ("Thread %s will be left with a suspend count"
|
printf_filtered ("Thread %s will be left with a suspend count"
|
||||||
" of %d when detaching.\n",
|
" of %d when detaching.\n",
|
||||||
proc_string (thread),
|
proc_string (thread),
|
||||||
thread->detach_sc);
|
thread->detach_sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3403,7 +3407,7 @@ thread_takeover_sc_cmd (const char *args, int from_tty)
|
|||||||
error (("%s."), safe_strerror (err));
|
error (("%s."), safe_strerror (err));
|
||||||
thread->sc = info->suspend_count;
|
thread->sc = info->suspend_count;
|
||||||
if (from_tty)
|
if (from_tty)
|
||||||
printf_unfiltered ("Suspend count was %d.\n", thread->sc);
|
printf_filtered ("Suspend count was %d.\n", thread->sc);
|
||||||
if (info != &_info)
|
if (info != &_info)
|
||||||
vm_deallocate (mach_task_self (), (vm_address_t) info,
|
vm_deallocate (mach_task_self (), (vm_address_t) info,
|
||||||
info_len * sizeof (int));
|
info_len * sizeof (int));
|
||||||
|
Reference in New Issue
Block a user