summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2020-02-25 16:42:55 -0500
committerAaron Merey <amerey@redhat.com>2020-02-25 16:42:55 -0500
commit638d40988aee874dae7e45a961773df2a34dc8f4 (patch)
treef1381c866f6bb75e59ffdf73699bd685c296d597
parent02b0255c7dcb271469312c46a875ec9b7cc5fc2b (diff)
downloadbinutils-gdb-users/amerey/debuginfod.tar.gz
Print downloading notification only when file is found on serverusers/amerey/debuginfod
-rw-r--r--gdb/debuginfod-support.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
index 7bb1207c0b9..53e3a50d31f 100644
--- a/gdb/debuginfod-support.c
+++ b/gdb/debuginfod-support.c
@@ -43,7 +43,7 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
#else
#include <elfutils/debuginfod.h>
-/* TODO: Use debuginfod API extensions to print filename from progressfn. */
+/* TODO: Use debuginfod API extensions instead of these globals. */
static const char *fname;
static bool has_printed;
@@ -52,17 +52,17 @@ progressfn (debuginfod_client *c, long cur, long total)
{
if (check_quit_flag ())
{
- printf_filtered ("Cancelling download of %ps...\n",
- styled_string (file_name_style.style (), fname));
+ printf_unfiltered ("Cancelling download of %ps...\n",
+ styled_string (file_name_style.style (), fname));
return 1;
}
- if (!has_printed)
+ if (!has_printed && total != 0)
{
/* Print this message only once. */
has_printed = true;
printf_unfiltered ("Debuginfod downloading %ps...\n",
- styled_string (file_name_style.style (), fname));
+ styled_string (file_name_style.style (), fname));
}
return 0;
@@ -106,11 +106,9 @@ debuginfod_source_query (const unsigned char *build_id,
/* TODO: Add 'set debug debuginfod' command to control when error messages are shown. */
if (fd.get () < 0 && fd.get () != -ENOENT)
- {
- printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
- strerror (-fd.get ()),
- styled_string (file_name_style.style (), srcpath));
- }
+ printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"),
+ strerror (-fd.get ()),
+ styled_string (file_name_style.style (), srcpath));
else
destname->reset (xstrdup (srcpath));