From: Aaron Merey Date: Fri, 21 Feb 2020 01:04:07 +0000 (-0500) Subject: fix line format X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c29562bead03a191bfad3b2143d60d4f9a953d6;p=thirdparty%2Fbinutils-gdb.git fix line format --- diff --git a/gdb/configure b/gdb/configure index cdacc1dd8e4..6286e9ea650 100755 --- a/gdb/configure +++ b/gdb/configure @@ -6897,18 +6897,18 @@ $as_echo "#define HAVE_LIBDEBUGINFOD 1" >>confdefs.h else if test "x$with_debuginfod" = xyes; then - as_fn_error $? "\"--with-debuginfod was given, but libdebuginfod is missing or unusable.\"" "$LINENO" 5 + as_fn_error $? "\"--with-debuginfod was given, but libdebuginfod is missing or unusable.\"" "$LINENO" 5 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&5 $as_echo "$as_me: WARNING: libdebuginfod is missing or unusable; some features may be unavailable." >&2;} fi fi else if test "x$with_debuginfod" = xyes; then - as_fn_error $? "pkg-config missing or unusable; cannot find libdebuginfod" "$LINENO" 5 + as_fn_error $? "--with-debuginfod was given, but pkg-config missing or unusable; cannot find libdebuginfod" "$LINENO" 5 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config missing or unusable; cannot find libdebuginfod" >&5 -$as_echo "$as_me: WARNING: pkg-config missing or unusable; cannot find libdebuginfod" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pkg-config missing or unusable; debuginfod support disabled." >&5 +$as_echo "$as_me: WARNING: pkg-config missing or unusable; debuginfod support disabled." >&2;} fi fi else diff --git a/gdb/configure.ac b/gdb/configure.ac index e9b31339402..dd55f4418b9 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -340,9 +340,9 @@ if test "x$with_debuginfod" != xno; then AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.]) else if test "x$with_debuginfod" = xyes; then - AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."]) + AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."]) else - AC_MSG_WARN([libdebuginfod is missing or unusable; some features may be unavailable.]) + AC_MSG_WARN([libdebuginfod is missing or unusable; some features may be unavailable.]) fi fi else diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index 2c2e7b717ea..7d075e0d4ac 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -24,17 +24,17 @@ #ifndef HAVE_LIBDEBUGINFOD scoped_fd debuginfod_source_query (const unsigned char *build_id __attribute__((unused)), - int build_id_len __attribute__((unused)), - const char *srcpath __attribute__((unused)), - gdb::unique_xmalloc_ptr *filename __attribute__((unused))) + int build_id_len __attribute__((unused)), + const char *srcpath __attribute__((unused)), + gdb::unique_xmalloc_ptr *filename __attribute__((unused))) { return scoped_fd (-ENOSYS); } scoped_fd debuginfod_debuginfo_query (const unsigned char *build_id __attribute__((unused)), - int build_id_len __attribute__((unused)), - gdb::unique_xmalloc_ptr *filename __attribute__((unused))) + int build_id_len __attribute__((unused)), + gdb::unique_xmalloc_ptr *filename __attribute__((unused))) { return scoped_fd (-ENOSYS); } @@ -51,9 +51,9 @@ progressfn (debuginfod_client *c, long cur, long total) } printf_unfiltered ("Downloading... %.0f%% (%ld/%ld)%s", - (cur * 100.0f) / total, - cur, total, - (cur == total) ? "\n" : "\r"); + (cur * 100.0f) / total, + cur, total, + (cur == total) ? "\n" : "\r"); return 0; } @@ -72,9 +72,9 @@ debuginfod_init () scoped_fd debuginfod_source_query (const unsigned char *build_id, - int build_id_len, - const char *srcpath, - gdb::unique_xmalloc_ptr *destname) + int build_id_len, + const char *srcpath, + gdb::unique_xmalloc_ptr *destname) { debuginfod_client *c = debuginfod_init (); @@ -85,18 +85,17 @@ debuginfod_source_query (const unsigned char *build_id, printf_unfiltered ("Attempting to download source file %s\n", srcpath); scoped_fd fd (debuginfod_find_source (c, - build_id, - build_id_len, - srcpath, - &dname)); + build_id, + build_id_len, + srcpath, + &dname)); if (fd.get () < 0) printf_unfiltered ("Download unsuccessful. Continuing without source file %s.\n", - srcpath); + srcpath); else printf_unfiltered ("Download successful.\n"); - destname->reset (dname); debuginfod_end (c); @@ -107,9 +106,9 @@ debuginfod_source_query (const unsigned char *build_id, scoped_fd debuginfod_debuginfo_query (const unsigned char *build_id, - int build_id_len, - const char *filename, - gdb::unique_xmalloc_ptr *destname) + int build_id_len, + const char *filename, + gdb::unique_xmalloc_ptr *destname) { debuginfod_client *c = debuginfod_init (); @@ -123,7 +122,7 @@ debuginfod_debuginfo_query (const unsigned char *build_id, if (fd.get () < 0) printf_unfiltered ("Download unsuccessful. Continuing without debug info for %s.\n", - filename); + filename); else printf_unfiltered ("Download successful.\n"); diff --git a/gdb/debuginfod-support.h b/gdb/debuginfod-support.h index b08dd000bfd..2e500a99f3d 100644 --- a/gdb/debuginfod-support.h +++ b/gdb/debuginfod-support.h @@ -37,9 +37,9 @@ extern scoped_fd debuginfod_source_query (const unsigned char *build_id, - int build_id_len, - const char *src_path, - gdb::unique_xmalloc_ptr *destname); + int build_id_len, + const char *src_path, + gdb::unique_xmalloc_ptr *destname); /* Query debuginfod servers for a debuginfo file with BUILD_ID. BUILD_ID can be given as a binary blob or a null-terminated string. @@ -52,8 +52,8 @@ debuginfod_source_query (const unsigned char *build_id, extern scoped_fd debuginfod_debuginfo_query (const unsigned char *build_id, - int build_id_len, - const char *filename, - gdb::unique_xmalloc_ptr *destname); + int build_id_len, + const char *filename, + gdb::unique_xmalloc_ptr *destname); #endif /* DEBUGINFOD_SUPPORT_H */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 51526bc16de..595e0217011 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2753,19 +2753,19 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) const char *origname = dwarf2_per_objfile->objfile->original_name; scoped_fd fd (debuginfod_debuginfo_query (buildid, - buildid_len, - origname, - &alt_filename)); + buildid_len, + origname, + &alt_filename)); if (fd.get () >= 0) - { - /* File successfully retrieved from server. */ - dwz_bfd = gdb_bfd_open (alt_filename.get (), gnutarget, -1); + { + /* File successfully retrieved from server. */ + dwz_bfd = gdb_bfd_open (alt_filename.get (), gnutarget, -1); - if (dwz_bfd != nullptr - && !build_id_verify (dwz_bfd.get (), buildid_len, buildid)) - dwz_bfd.reset (nullptr); - } + if (dwz_bfd != nullptr + && !build_id_verify (dwz_bfd.get (), buildid_len, buildid)) + dwz_bfd.reset (nullptr); + } } if (dwz_bfd == NULL) diff --git a/gdb/elfread.c b/gdb/elfread.c index 58e259983b0..f86c9548bea 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1319,33 +1319,33 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) symfile_flags, objfile); } else - { - has_dwarf2 = false; - const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd); - - if (build_id != nullptr) - { - gdb::unique_xmalloc_ptr symfile_path; - scoped_fd fd (debuginfod_debuginfo_query (build_id->data, - build_id->size, - objfile->original_name, - &symfile_path)); - - if (fd.get () >= 0) - { - /* File successfully retrieved from server. */ - gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (symfile_path.get ())); - - if (debug_bfd != nullptr - && build_id_verify (debug_bfd.get (), build_id->size, build_id->data)) - { - symbol_file_add_separate (debug_bfd.get (), symfile_path.get (), - symfile_flags, objfile); - has_dwarf2 = true; - } - } - } - } + { + has_dwarf2 = false; + const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd); + + if (build_id != nullptr) + { + gdb::unique_xmalloc_ptr symfile_path; + scoped_fd fd (debuginfod_debuginfo_query (build_id->data, + build_id->size, + objfile->original_name, + &symfile_path)); + + if (fd.get () >= 0) + { + /* File successfully retrieved from server. */ + gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (symfile_path.get ())); + + if (debug_bfd != nullptr + && build_id_verify (debug_bfd.get (), build_id->size, build_id->data)) + { + symbol_file_add_separate (debug_bfd.get (), symfile_path.get (), + symfile_flags, objfile); + has_dwarf2 = true; + } + } + } + } } /* Read the CTF section only if there is no DWARF info. */ diff --git a/gdb/source.c b/gdb/source.c index 77a8f42a820..7f519345bb0 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1159,28 +1159,28 @@ open_source_file (struct symtab *s) if (fd.get () < 0) { if (SYMTAB_COMPUNIT (s) != nullptr) - { - const objfile *ofp = COMPUNIT_OBJFILE (SYMTAB_COMPUNIT (s)); - - std::string srcpath; - if (IS_ABSOLUTE_PATH (s->filename)) - srcpath = s->filename; - else - { - srcpath = SYMTAB_DIRNAME (s); - srcpath += SLASH_STRING; - srcpath += s->filename; - } - - const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd); - - /* Query debuginfod for the source file. */ - if (build_id != nullptr) - fd = debuginfod_source_query (build_id->data, - build_id->size, - srcpath.c_str (), - &fullname); - } + { + const objfile *ofp = COMPUNIT_OBJFILE (SYMTAB_COMPUNIT (s)); + + std::string srcpath; + if (IS_ABSOLUTE_PATH (s->filename)) + srcpath = s->filename; + else + { + srcpath = SYMTAB_DIRNAME (s); + srcpath += SLASH_STRING; + srcpath += s->filename; + } + + const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd); + + /* Query debuginfod for the source file. */ + if (build_id != nullptr) + fd = debuginfod_source_query (build_id->data, + build_id->size, + srcpath.c_str (), + &fullname); + } } s->fullname = fullname.release (); diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp index 0b1fac210d1..0bf18f2d124 100644 --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp @@ -47,7 +47,7 @@ set outputdir [standard_output_file {}] # Make a copy source file that we can move around if { [catch {file copy -force ${srcdir}/${subdir}/${srcfile} \ - [standard_output_file ${sourcetmp}]}] != 0 } { + [standard_output_file ${sourcetmp}]}] != 0 } { error "create temporary file" return -1 } @@ -88,17 +88,17 @@ proc write_just_debugaltlink {filename dwzname buildid} { set asm_file [standard_output_file $filename] Dwarf::assemble $asm_file { - upvar dwzname dwzname - upvar buildid buildid + upvar dwzname dwzname + upvar buildid buildid - gnu_debugaltlink $dwzname $buildid + gnu_debugaltlink $dwzname $buildid - # Only the DWARF reader checks .gnu_debugaltlink, so make sure - # there is a bit of DWARF in here. - cu {} { - compile_unit {{language @DW_LANG_C}} { - } - } + # Only the DWARF reader checks .gnu_debugaltlink, so make sure + # there is a bit of DWARF in here. + cu {} { + compile_unit {{language @DW_LANG_C}} { + } + } } } @@ -108,28 +108,28 @@ proc write_dwarf_file {filename buildid {value 99}} { set asm_file [standard_output_file $filename] Dwarf::assemble $asm_file { - declare_labels int_label int_label2 - - upvar buildid buildid - upvar value value - - build_id $buildid - - cu {} { - compile_unit {{language @DW_LANG_C}} { - int_label2: base_type { - {name int} - {byte_size 4 sdata} - {encoding @DW_ATE_signed} - } - - constant { - {name the_int} - {type :$int_label2} - {const_value $value data1} - } - } - } + declare_labels int_label int_label2 + + upvar buildid buildid + upvar value value + + build_id $buildid + + cu {} { + compile_unit {{language @DW_LANG_C}} { + int_label2: base_type { + {name int} + {byte_size 4 sdata} + {encoding @DW_ATE_signed} + } + + constant { + {name the_int} + {type :$int_label2} + {const_value $value data1} + } + } + } } } @@ -176,9 +176,9 @@ while { ! $found } { } set metrics [list "ready 1" \ - "thread_work_total{role=\"traverse\"} 1" \ - "thread_work_pending{role=\"scan\"} 0" \ - "thread_busy{role=\"scan\"} 0"] + "thread_work_total{role=\"traverse\"} 1" \ + "thread_work_pending{role=\"scan\"} 0" \ + "thread_busy{role=\"scan\"} 0"] # Check server metrics to confirm init has completed. foreach m $metrics {