From 7fb048a2ee38bbc85ba0e96e2932cb0cb1f7381e Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 26 Nov 2016 22:06:07 -0500 Subject: [PATCH] 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. --- gdb/ChangeLog | 22 ++++++++++++++++++++++ gdb/ada-tasks.c | 6 +++--- gdb/auto-load.c | 4 ++-- gdb/breakpoint.c | 12 ++++++------ gdb/cli-out.c | 13 ++++--------- gdb/inferior.c | 2 +- gdb/linux-thread-db.c | 2 +- gdb/mi/mi-out.c | 8 +++----- gdb/probe.c | 14 +++++++------- gdb/skip.c | 4 ++-- gdb/solib.c | 6 +++--- gdb/symfile.c | 2 +- gdb/thread.c | 8 ++++---- gdb/ui-out.c | 23 ++++++----------------- gdb/ui-out.h | 11 ++++------- 15 files changed, 69 insertions(+), 68 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 25f40333e25..77bdfb58a1b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,25 @@ +2016-11-26 Simon Marchi + + * 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 * mi/mi-out.c (mi_wrap_hint): Constify argument. diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index c067ae66727..31092fd02c4 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -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; } diff --git a/gdb/auto-load.c b/gdb/auto-load.c index de64112021b..958c24e6850 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -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"); } } diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e2fcc082d8f..d737cadf353 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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 (); diff --git a/gdb/cli-out.c b/gdb/cli-out.c index d2082076817..e8827565695 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -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 diff --git a/gdb/inferior.c b/gdb/inferior.c index 92a18d66274..0abd2c058ef 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -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; } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 6ed3997d1d5..c1626ff54b0 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -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 diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c index 960529c712a..44e28b13cd3 100644 --- a/gdb/mi/mi-out.c +++ b/gdb/mi/mi-out.c @@ -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) { } diff --git a/gdb/probe.c b/gdb/probe.c index 285f4e12890..611a7522981 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -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); } diff --git a/gdb/skip.c b/gdb/skip.c index 15681cc7f28..fa0f0c90752 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -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; diff --git a/gdb/solib.c b/gdb/solib.c index 29b25d56c7a..db370e9ff87 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -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")); } diff --git a/gdb/symfile.c b/gdb/symfile.c index 517c277c722..52f99bfc5f6 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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; diff --git a/gdb/thread.c b/gdb/thread.c index 57b20ffd04e..e5d6c5ffc9b 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -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 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"); } } diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 64d0443369c..b8253c9b7cb 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -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 diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 569f762e497..e251d773d78 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -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, -- 2.30.2