+2018-12-26 Simon Marchi <simon.marchi@ericsson.com>
+
+ * build-id.c (build_id_to_debug_bfd): Enhance debug output.
+ * symfile.c (separate_debug_file_exists): Likewise.
+
2018-12-24 Andrew Burgess <andrew.burgess@embecosm.com>
* c-exp.y (field_name): Allow DOUBLE_KEYWORD, INT_KEYWORD, LONG,
link += ".debug";
if (separate_debug_file_debug)
- printf_unfiltered (_(" Trying %s\n"), link.c_str ());
+ {
+ printf_unfiltered (_(" Trying %s..."), link.c_str ());
+ gdb_flush (gdb_stdout);
+ }
/* lrealpath() is expensive even for the usually non-existent files. */
gdb::unique_xmalloc_ptr<char> filename;
filename.reset (lrealpath (link.c_str ()));
if (filename == NULL)
- continue;
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, unable to compute real path\n"));
+
+ continue;
+ }
/* We expect to be silent on the non-existing files. */
abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
if (abfd == NULL)
- continue;
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, unable to open.\n"));
+
+ continue;
+ }
if (build_id_verify (abfd.get(), build_id_len, build_id))
- break;
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" yes!\n"));
+
+ break;
+ }
+ else
+ {
+ if (separate_debug_file_debug)
+ printf_unfiltered (_(" no, build-id does not match.\n"));
+ }
abfd.release ();
}
return 0;
if (separate_debug_file_debug)
- printf_filtered (_(" Trying %s\n"), name.c_str ());
+ {
+ printf_filtered (_(" Trying %s..."), name.c_str ());
+ gdb_flush (gdb_stdout);
+ }
gdb_bfd_ref_ptr abfd (gdb_bfd_open (name.c_str (), gnutarget, -1));
if (abfd == NULL)
- return 0;
+ {
+ if (separate_debug_file_debug)
+ printf_filtered (_(" no, unable to open.\n"));
+
+ return 0;
+ }
/* Verify symlinks were not the cause of filename_cmp name difference above.
{
if (abfd_stat.st_dev == parent_stat.st_dev
&& abfd_stat.st_ino == parent_stat.st_ino)
- return 0;
+ {
+ if (separate_debug_file_debug)
+ printf_filtered (_(" no, same file as the objfile.\n"));
+
+ return 0;
+ }
verified_as_different = 1;
}
else
file_crc_p = gdb_bfd_crc (abfd.get (), &file_crc);
if (!file_crc_p)
- return 0;
+ {
+ if (separate_debug_file_debug)
+ printf_filtered (_(" no, error computing CRC.\n"));
+
+ return 0;
+ }
if (crc != file_crc)
{
if (!verified_as_different)
{
if (!gdb_bfd_crc (parent_objfile->obfd, &parent_crc))
- return 0;
+ {
+ if (separate_debug_file_debug)
+ printf_filtered (_(" no, error computing CRC.\n"));
+
+ return 0;
+ }
}
if (verified_as_different || parent_crc != file_crc)
" does not match \"%s\" (CRC mismatch).\n"),
name.c_str (), objfile_name (parent_objfile));
+ if (separate_debug_file_debug)
+ printf_filtered (_(" no, CRC doesn't match.\n"));
+
return 0;
}
+ if (separate_debug_file_debug)
+ printf_filtered (_(" yes!\n"));
+
return 1;
}