char * find_separate_debug_file_by_buildid (struct objfile *objfile) { const struct bfd_build_id *build_id; build_id = build_id_bfd_get (objfile->obfd); if (build_id != NULL) { if (separate_debug_file_debug) printf_unfiltered (_("\nLooking for separate debug info (build-id) for " "%s\n"), objfile_name (objfile)); gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, build_id->data)); /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), objfile_name (objfile)) == 0) warning (_("\"%s\": separate debug info file has no debug info"), bfd_get_filename (abfd.get ())); else if (abfd != NULL) return xstrdup (bfd_get_filename (abfd.get ())); } return NULL; }
char * find_separate_debug_file_by_buildid (struct objfile *objfile) { const struct elf_build_id *build_id; build_id = build_id_bfd_get (objfile->obfd); if (build_id != NULL) { bfd *abfd; abfd = build_id_to_debug_bfd (build_id->size, build_id->data); /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd), objfile_name (objfile)) == 0) { warning (_("\"%s\": separate debug info file has no debug info"), bfd_get_filename (abfd)); gdb_bfd_unref (abfd); } else if (abfd != NULL) { char *result = xstrdup (bfd_get_filename (abfd)); gdb_bfd_unref (abfd); return result; } } return NULL; }