diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/debuginfod-support.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3d516df..47c68cb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-11-23 Tom de Vries <tdevries@suse.de> + + * debuginfod-support.c (debuginfod_source_query) + (debuginfod_debuginfo_query): Only set DESTNAME if successful. + 2020-11-21 Tom Tromey <tom@tromey.com> * breakpoint.c (watchpoint_exp_is_const): Return bool. diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index a7c76ab..e21b2f4 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -134,7 +134,8 @@ debuginfod_source_query (const unsigned char *build_id, printf_filtered (_("Download failed: %s. Continuing without source file %ps.\n"), safe_strerror (-fd.get ()), styled_string (file_name_style.style (), srcpath)); - else + + if (fd.get () >= 0) *destname = make_unique_xstrdup (srcpath); return fd; @@ -169,7 +170,8 @@ debuginfod_debuginfo_query (const unsigned char *build_id, safe_strerror (-fd.get ()), styled_string (file_name_style.style (), filename)); - destname->reset (dname); + if (fd.get () >= 0) + destname->reset (dname); return fd; } |