summaryrefslogtreecommitdiff
path: root/gdb/debuginfod-support.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-02 11:46:15 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a (patch)
tree641a6a86240919fe4ba9219fbbbe15bc6331c22d /gdb/debuginfod-support.c
parenta11ac3b3e8ff6769badcf0041894f6c5acc1b94f (diff)
downloadbinutils-gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.gz
Unify gdb printf functions
Now that filtered and unfiltered output can be treated identically, we can unify the printf family of functions. This is done under the name "gdb_printf". Most of this patch was written by script.
Diffstat (limited to 'gdb/debuginfod-support.c')
-rw-r--r--gdb/debuginfod-support.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index d5d023ff7bb..b3a49bfeccf 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -115,9 +115,9 @@ progressfn (debuginfod_client *c, long cur, long total)
if (check_quit_flag ())
{
- printf_filtered ("Cancelling download of %s %ps...\n",
- data->desc,
- styled_string (file_name_style.style (), data->fname));
+ gdb_printf ("Cancelling download of %s %ps...\n",
+ data->desc,
+ styled_string (file_name_style.style (), data->fname));
return 1;
}
@@ -136,14 +136,14 @@ progressfn (debuginfod_client *c, long cur, long total)
unit = "MB";
}
- printf_filtered ("Downloading %.2f %s %s %ps...\n",
- size, unit, data->desc,
- styled_string (file_name_style.style (),
- data->fname));
+ gdb_printf ("Downloading %.2f %s %s %ps...\n",
+ size, unit, data->desc,
+ styled_string (file_name_style.style (),
+ data->fname));
}
else
- printf_filtered ("Downloading %s %ps...\n", data->desc,
- styled_string (file_name_style.style (), data->fname));
+ gdb_printf ("Downloading %s %ps...\n", data->desc,
+ styled_string (file_name_style.style (), data->fname));
data->has_printed = true;
}
@@ -187,16 +187,16 @@ debuginfod_is_enabled ()
urls);
if (!resp)
{
- printf_filtered (_("Debuginfod has been disabled.\nTo make this " \
- "setting permanent, add \'set debuginfod " \
- "enabled off\' to .gdbinit.\n"));
+ gdb_printf (_("Debuginfod has been disabled.\nTo make this " \
+ "setting permanent, add \'set debuginfod " \
+ "enabled off\' to .gdbinit.\n"));
debuginfod_enabled = debuginfod_off;
return false;
}
- printf_filtered (_("Debuginfod has been enabled.\nTo make this " \
- "setting permanent, add \'set debuginfod enabled " \
- "on\' to .gdbinit.\n"));
+ gdb_printf (_("Debuginfod has been enabled.\nTo make this " \
+ "setting permanent, add \'set debuginfod enabled " \
+ "on\' to .gdbinit.\n"));
debuginfod_enabled = debuginfod_on;
}
@@ -238,9 +238,9 @@ debuginfod_source_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
- printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
- safe_strerror (-fd.get ()),
- styled_string (file_name_style.style (), srcpath));
+ gdb_printf (_("Download failed: %s. Continuing without source file %ps.\n"),
+ safe_strerror (-fd.get ()),
+ styled_string (file_name_style.style (), srcpath));
if (fd.get () >= 0)
destname->reset (dname);
@@ -280,9 +280,9 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
- printf_filtered (_("Download failed: %s. Continuing without debug info for %ps.\n"),
- safe_strerror (-fd.get ()),
- styled_string (file_name_style.style (), filename));
+ gdb_printf (_("Download failed: %s. Continuing without debug info for %ps.\n"),
+ safe_strerror (-fd.get ()),
+ styled_string (file_name_style.style (), filename));
if (fd.get () >= 0)
destname->reset (dname);
@@ -321,10 +321,10 @@ debuginfod_exec_query (const unsigned char *build_id,
debuginfod_set_user_data (c, nullptr);
if (debuginfod_verbose > 0 && fd.get () < 0 && fd.get () != -ENOENT)
- printf_filtered (_("Download failed: %s. " \
- "Continuing without executable for %ps.\n"),
- safe_strerror (-fd.get ()),
- styled_string (file_name_style.style (), filename));
+ gdb_printf (_("Download failed: %s. " \
+ "Continuing without executable for %ps.\n"),
+ safe_strerror (-fd.get ()),
+ styled_string (file_name_style.style (), filename));
if (fd.get () >= 0)
destname->reset (dname);
@@ -359,9 +359,9 @@ static void
show_debuginfod_enabled (ui_file *file, int from_tty, cmd_list_element *cmd,
const char *value)
{
- fprintf_filtered (file,
- _("Debuginfod functionality is currently set to "
- "\"%s\".\n"), debuginfod_enabled);
+ gdb_printf (file,
+ _("Debuginfod functionality is currently set to "
+ "\"%s\".\n"), debuginfod_enabled);
}
/* Set callback for "set debuginfod urls". */
@@ -402,10 +402,10 @@ show_debuginfod_urls (ui_file *file, int from_tty, cmd_list_element *cmd,
const char *value)
{
if (value[0] == '\0')
- fprintf_filtered (file, _("Debuginfod URLs have not been set.\n"));
+ gdb_printf (file, _("Debuginfod URLs have not been set.\n"));
else
- fprintf_filtered (file, _("Debuginfod URLs are currently set to:\n%s\n"),
- value);
+ gdb_printf (file, _("Debuginfod URLs are currently set to:\n%s\n"),
+ value);
}
/* Show callback for "set debuginfod verbose". */
@@ -414,8 +414,8 @@ static void
show_debuginfod_verbose_command (ui_file *file, int from_tty,
cmd_list_element *cmd, const char *value)
{
- fprintf_filtered (file, _("Debuginfod verbose output is set to %s.\n"),
- value);
+ gdb_printf (file, _("Debuginfod verbose output is set to %s.\n"),
+ value);
}
/* Register debuginfod commands. */