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
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
#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<char> *filename __attribute__((unused)))
+ int build_id_len __attribute__((unused)),
+ const char *srcpath __attribute__((unused)),
+ gdb::unique_xmalloc_ptr<char> *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<char> *filename __attribute__((unused)))
+ int build_id_len __attribute__((unused)),
+ gdb::unique_xmalloc_ptr<char> *filename __attribute__((unused)))
{
return scoped_fd (-ENOSYS);
}
}
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;
}
scoped_fd
debuginfod_source_query (const unsigned char *build_id,
- int build_id_len,
- const char *srcpath,
- gdb::unique_xmalloc_ptr<char> *destname)
+ int build_id_len,
+ const char *srcpath,
+ gdb::unique_xmalloc_ptr<char> *destname)
{
debuginfod_client *c = debuginfod_init ();
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);
scoped_fd
debuginfod_debuginfo_query (const unsigned char *build_id,
- int build_id_len,
- const char *filename,
- gdb::unique_xmalloc_ptr<char> *destname)
+ int build_id_len,
+ const char *filename,
+ gdb::unique_xmalloc_ptr<char> *destname)
{
debuginfod_client *c = debuginfod_init ();
if (fd.get () < 0)
printf_unfiltered ("Download unsuccessful. Continuing without debug info for %s.\n",
- filename);
+ filename);
else
printf_unfiltered ("Download successful.\n");
extern scoped_fd
debuginfod_source_query (const unsigned char *build_id,
- int build_id_len,
- const char *src_path,
- gdb::unique_xmalloc_ptr<char> *destname);
+ int build_id_len,
+ const char *src_path,
+ gdb::unique_xmalloc_ptr<char> *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.
extern scoped_fd
debuginfod_debuginfo_query (const unsigned char *build_id,
- int build_id_len,
- const char *filename,
- gdb::unique_xmalloc_ptr<char> *destname);
+ int build_id_len,
+ const char *filename,
+ gdb::unique_xmalloc_ptr<char> *destname);
#endif /* DEBUGINFOD_SUPPORT_H */
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)
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<char> 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<char> 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. */
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 ();
# 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
}
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}} {
+ }
+ }
}
}
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}
+ }
+ }
+ }
}
}
}
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 {