Remove verbosity from ui_out_message and friends

That concept is never actually used, so it's just a burden.  Removing it
facilitates the refactoring in upcoming patches.

gdb/ChangeLog:

	* mi/mi-out.c (mi_message): Remove verbosity argument.
	* ada-tasks.c (print_ada_task_info, info_task, task_command):
	Update call.
	* auto-load.c (auto_load_info_scripts): Likewise.
	* breakpoint.c (breakpoint_1, watchpoints_info, tracepoints_info):
	Likewise.
	* cli-out.c (cli_message): Remove verbosity argument.
	* inferior.c (print_inferior): Update call.
	* linux-thread-db.c (info_auto_load_libthread_db): Likewise.
	* probe.c (info_probes_for_ops): Likewise.
	* skip.c (skip_info): Likewise.
	* solib.c (info_sharedlibrary_command): Likewise.
	* symfile.c (load_progress): Likewise.
	* thread.c (print_thread_info_1): Likewise.
	* ui-out.c (uo_message, ui_out_message): Remove verbosity argument.
	(ui_out_get_verblvl): Remove.
	* ui-out.h (ui_out_message): Remove verbosity argument.
	(ui_out_get_verblvl): Remove.
	(message_ftype): Remove verbosity argument.
This commit is contained in:
Simon Marchi 2016-11-26 22:06:07 -05:00
parent d2c0eef48a
commit 7fb048a2ee
15 changed files with 69 additions and 68 deletions

View File

@ -1,3 +1,25 @@
2016-11-26 Simon Marchi <simon.marchi@polymtl.ca>
* mi/mi-out.c (mi_message): Remove verbosity argument.
* ada-tasks.c (print_ada_task_info, info_task, task_command):
Update call.
* auto-load.c (auto_load_info_scripts): Likewise.
* breakpoint.c (breakpoint_1, watchpoints_info, tracepoints_info):
Likewise.
* cli-out.c (cli_message): Remove verbosity argument.
* inferior.c (print_inferior): Update call.
* linux-thread-db.c (info_auto_load_libthread_db): Likewise.
* probe.c (info_probes_for_ops): Likewise.
* skip.c (skip_info): Likewise.
* solib.c (info_sharedlibrary_command): Likewise.
* symfile.c (load_progress): Likewise.
* thread.c (print_thread_info_1): Likewise.
* ui-out.c (uo_message, ui_out_message): Remove verbosity argument.
(ui_out_get_verblvl): Remove.
* ui-out.h (ui_out_message): Remove verbosity argument.
(ui_out_get_verblvl): Remove.
(message_ftype): Remove verbosity argument.
2016-11-26 Simon Marchi <simon.marchi@polymtl.ca>
* mi/mi-out.c (mi_wrap_hint): Constify argument.

View File

@ -1013,7 +1013,7 @@ print_ada_task_info (struct ui_out *uiout,
if (ada_build_task_list () == 0)
{
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("Your application does not use any Ada tasks.\n"));
return;
}
@ -1163,7 +1163,7 @@ info_task (struct ui_out *uiout, char *taskno_str, struct inferior *inf)
if (ada_build_task_list () == 0)
{
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("Your application does not use any Ada tasks.\n"));
return;
}
@ -1328,7 +1328,7 @@ task_command (char *taskno_str, int from_tty)
if (ada_build_task_list () == 0)
{
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("Your application does not use any Ada tasks.\n"));
return;
}

View File

@ -1401,10 +1401,10 @@ auto_load_info_scripts (char *pattern, int from_tty,
if (nr_scripts == 0)
{
if (pattern && *pattern)
ui_out_message (uiout, 0, "No auto-load scripts matching %s.\n",
ui_out_message (uiout, "No auto-load scripts matching %s.\n",
pattern);
else
ui_out_message (uiout, 0, "No auto-load scripts.\n");
ui_out_message (uiout, "No auto-load scripts.\n");
}
}

View File

@ -6954,9 +6954,9 @@ breakpoint_1 (char *args, int allflag,
if (!filter)
{
if (args == NULL || *args == '\0')
ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
ui_out_message (uiout, "No breakpoints or watchpoints.\n");
else
ui_out_message (uiout, 0,
ui_out_message (uiout,
"No breakpoint or watchpoint matching '%s'.\n",
args);
}
@ -7012,9 +7012,9 @@ watchpoints_info (char *args, int from_tty)
if (num_printed == 0)
{
if (args == NULL || *args == '\0')
ui_out_message (uiout, 0, "No watchpoints.\n");
ui_out_message (uiout, "No watchpoints.\n");
else
ui_out_message (uiout, 0, "No watchpoint matching '%s'.\n", args);
ui_out_message (uiout, "No watchpoint matching '%s'.\n", args);
}
}
@ -15478,9 +15478,9 @@ tracepoints_info (char *args, int from_tty)
if (num_printed == 0)
{
if (args == NULL || *args == '\0')
ui_out_message (uiout, 0, "No tracepoints.\n");
ui_out_message (uiout, "No tracepoints.\n");
else
ui_out_message (uiout, 0, "No tracepoint matching '%s'.\n", args);
ui_out_message (uiout, "No tracepoint matching '%s'.\n", args);
}
default_collect_info ();

View File

@ -272,21 +272,16 @@ cli_text (struct ui_out *uiout, const char *string)
fputs_filtered (string, stream);
}
static void ATTRIBUTE_PRINTF (3, 0)
cli_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
static void ATTRIBUTE_PRINTF (2, 0)
cli_message (struct ui_out *uiout, const char *format, va_list args)
{
cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
if (data->suppress_output)
return;
if (ui_out_get_verblvl (uiout) >= verbosity)
{
struct ui_file *stream = VEC_last (ui_filep, data->streams);
vfprintf_unfiltered (stream, format, args);
}
struct ui_file *stream = VEC_last (ui_filep, data->streams);
vfprintf_unfiltered (stream, format, args);
}
static void

View File

@ -594,7 +594,7 @@ print_inferior (struct ui_out *uiout, char *requested_inferiors)
if (inf_count == 0)
{
ui_out_message (uiout, 0, "No inferiors.\n");
ui_out_message (uiout, "No inferiors.\n");
return;
}

View File

@ -1668,7 +1668,7 @@ info_auto_load_libthread_db (char *args, int from_tty)
do_cleanups (back_to);
if (info_count == 0)
ui_out_message (uiout, 0, _("No auto-loaded libthread-db.\n"));
ui_out_message (uiout, _("No auto-loaded libthread-db.\n"));
}
static void

View File

@ -62,9 +62,8 @@ static void mi_field_fmt (struct ui_out *uiout, int fldno,
va_list args) ATTRIBUTE_PRINTF (6, 0);
static void mi_spaces (struct ui_out *uiout, int numspaces);
static void mi_text (struct ui_out *uiout, const char *string);
static void mi_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
ATTRIBUTE_PRINTF (3, 0);
static void mi_message (struct ui_out *uiout, const char *format, va_list args)
ATTRIBUTE_PRINTF (2, 0);
static void mi_wrap_hint (struct ui_out *uiout, const char *identstring);
static void mi_flush (struct ui_out *uiout);
static int mi_redirect (struct ui_out *uiout, struct ui_file *outstream);
@ -267,8 +266,7 @@ mi_text (struct ui_out *uiout, const char *string)
}
void
mi_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args)
mi_message (struct ui_out *uiout, const char *format, va_list args)
{
}

View File

@ -717,7 +717,7 @@ info_probes_for_ops (const char *arg, int from_tty,
do_cleanups (cleanup);
if (!any_found)
ui_out_message (current_uiout, 0, _("No probes matched.\n"));
ui_out_message (current_uiout, _("No probes matched.\n"));
}
/* Implementation of the `info probes' command. */
@ -747,7 +747,7 @@ enable_probes_command (char *arg, int from_tty)
probes = collect_probes (objname, provider, probe_name, NULL);
if (VEC_empty (bound_probe_s, probes))
{
ui_out_message (current_uiout, 0, _("No probes matched.\n"));
ui_out_message (current_uiout, _("No probes matched.\n"));
do_cleanups (cleanup);
return;
}
@ -761,12 +761,12 @@ enable_probes_command (char *arg, int from_tty)
if (pops->enable_probe != NULL)
{
pops->enable_probe (probe->probe);
ui_out_message (current_uiout, 0,
ui_out_message (current_uiout,
_("Probe %s:%s enabled.\n"),
probe->probe->provider, probe->probe->name);
}
else
ui_out_message (current_uiout, 0,
ui_out_message (current_uiout,
_("Probe %s:%s cannot be enabled.\n"),
probe->probe->provider, probe->probe->name);
}
@ -793,7 +793,7 @@ disable_probes_command (char *arg, int from_tty)
probes = collect_probes (objname, provider, probe_name, NULL /* pops */);
if (VEC_empty (bound_probe_s, probes))
{
ui_out_message (current_uiout, 0, _("No probes matched.\n"));
ui_out_message (current_uiout, _("No probes matched.\n"));
do_cleanups (cleanup);
return;
}
@ -807,12 +807,12 @@ disable_probes_command (char *arg, int from_tty)
if (pops->disable_probe != NULL)
{
pops->disable_probe (probe->probe);
ui_out_message (current_uiout, 0,
ui_out_message (current_uiout,
_("Probe %s:%s disabled.\n"),
probe->probe->provider, probe->probe->name);
}
else
ui_out_message (current_uiout, 0,
ui_out_message (current_uiout,
_("Probe %s:%s cannot be disabled.\n"),
probe->probe->provider, probe->probe->name);
}

View File

@ -373,10 +373,10 @@ skip_info (char *arg, int from_tty)
if (num_printable_entries == 0)
{
if (arg == NULL)
ui_out_message (current_uiout, 0, _("\
ui_out_message (current_uiout, _("\
Not skipping any files or functions.\n"));
else
ui_out_message (current_uiout, 0,
ui_out_message (current_uiout,
_("No skiplist entries found with number %s.\n"), arg);
return;

View File

@ -1163,16 +1163,16 @@ info_sharedlibrary_command (char *pattern, int from_tty)
if (nr_libs == 0)
{
if (pattern)
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("No shared libraries matched.\n"));
else
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("No shared libraries loaded at this time.\n"));
}
else
{
if (so_missing_debug_info)
ui_out_message (uiout, 0,
ui_out_message (uiout,
_("(*): Shared library is missing "
"debugging information.\n"));
}

View File

@ -1962,7 +1962,7 @@ load_progress (ULONGEST bytes, void *untyped_arg)
{
/* The write is just starting. Let the user know we've started
this section. */
ui_out_message (current_uiout, 0, "Loading section %s, size %s lma %s\n",
ui_out_message (current_uiout, "Loading section %s, size %s lma %s\n",
args->section_name, hex_string (args->section_size),
paddress (target_gdbarch (), args->lma));
return;

View File

@ -1231,9 +1231,9 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
if (n_threads == 0)
{
if (requested_threads == NULL || *requested_threads == '\0')
ui_out_message (uiout, 0, _("No threads.\n"));
ui_out_message (uiout, _("No threads.\n"));
else
ui_out_message (uiout, 0, _("No threads match '%s'.\n"),
ui_out_message (uiout, _("No threads match '%s'.\n"),
requested_threads);
do_cleanups (old_chain);
return;
@ -1372,12 +1372,12 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
}
if (!ptid_equal (inferior_ptid, null_ptid) && is_exited (inferior_ptid))
ui_out_message (uiout, 0, "\n\
ui_out_message (uiout, "\n\
The current thread <Thread ID %s> has terminated. See `help thread'.\n",
print_thread_id (inferior_thread ()));
else if (thread_list != NULL
&& ptid_equal (inferior_ptid, null_ptid))
ui_out_message (uiout, 0, "\n\
ui_out_message (uiout, "\n\
No selected thread. See `help thread'.\n");
}
}

View File

@ -169,9 +169,9 @@ static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
ATTRIBUTE_PRINTF (6, 0);
static void uo_spaces (struct ui_out *uiout, int numspaces);
static void uo_text (struct ui_out *uiout, const char *string);
static void uo_message (struct ui_out *uiout, int verbosity,
static void uo_message (struct ui_out *uiout,
const char *format, va_list args)
ATTRIBUTE_PRINTF (3, 0);
ATTRIBUTE_PRINTF (2, 0);
static void uo_wrap_hint (struct ui_out *uiout, const char *identstring);
static void uo_flush (struct ui_out *uiout);
static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
@ -494,13 +494,12 @@ ui_out_text (struct ui_out *uiout,
}
void
ui_out_message (struct ui_out *uiout, int verbosity,
const char *format,...)
ui_out_message (struct ui_out *uiout, const char *format, ...)
{
va_list args;
va_start (args, format);
uo_message (uiout, verbosity, format, args);
uo_message (uiout, format, args);
va_end (args);
}
@ -529,16 +528,6 @@ ui_out_test_flags (struct ui_out *uiout, int mask)
return (uiout->flags & mask);
}
/* Obtain the current verbosity level (as stablished by the
'set verbositylevel' command. */
int
ui_out_get_verblvl (struct ui_out *uiout)
{
/* FIXME: not implemented yet. */
return 0;
}
int
ui_out_is_mi_like_p (struct ui_out *uiout)
{
@ -673,13 +662,13 @@ uo_text (struct ui_out *uiout,
}
void
uo_message (struct ui_out *uiout, int verbosity,
uo_message (struct ui_out *uiout,
const char *format,
va_list args)
{
if (!uiout->impl->message)
return;
uiout->impl->message (uiout, verbosity, format, args);
uiout->impl->message (uiout, format, args);
}
void

View File

@ -119,16 +119,13 @@ extern void ui_out_spaces (struct ui_out *uiout, int numspaces);
extern void ui_out_text (struct ui_out *uiout, const char *string);
extern void ui_out_message (struct ui_out *uiout, int verbosity,
const char *format, ...)
ATTRIBUTE_PRINTF (3, 4);
extern void ui_out_message (struct ui_out *uiout, const char *format, ...)
ATTRIBUTE_PRINTF (2, 3);
extern void ui_out_wrap_hint (struct ui_out *uiout, const char *identstring);
extern void ui_out_flush (struct ui_out *uiout);
extern int ui_out_get_verblvl (struct ui_out *uiout);
extern int ui_out_test_flags (struct ui_out *uiout, int mask);
extern int ui_out_query_field (struct ui_out *uiout, int colno,
@ -183,9 +180,9 @@ typedef void (field_fmt_ftype) (struct ui_out * uiout, int fldno, int width,
typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces);
typedef void (text_ftype) (struct ui_out * uiout,
const char *string);
typedef void (message_ftype) (struct ui_out * uiout, int verbosity,
typedef void (message_ftype) (struct ui_out * uiout,
const char *format, va_list args)
ATTRIBUTE_FPTR_PRINTF(3,0);
ATTRIBUTE_FPTR_PRINTF(2,0);
typedef void (wrap_hint_ftype) (struct ui_out * uiout, const char *identstring);
typedef void (flush_ftype) (struct ui_out * uiout);
typedef int (redirect_ftype) (struct ui_out * uiout,