From: Dodji Seketeli Date: Mon, 27 Feb 2023 17:38:26 +0000 (+0100) Subject: abipkgdiff: Emit error when no vmlinux is found in debug package X-Git-Tag: upstream/2.3~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=416b85333b9c7369c1b5d3e1b0e420d5c2158fa2;p=platform%2Fupstream%2Flibabigail.git abipkgdiff: Emit error when no vmlinux is found in debug package When given linux kernel packages to analyze using DWARF, the tool expects the (uncompressed) vmlinux binary to be found in the debug info package. This patch emits an error message when no vmlinux binary is found in the debug info package in that case. * tools/abipkgdiff.cc (compare_prepared_linux_kernel_packages): When no vmlinux binary is found in the debug info package, emit an error message. Signed-off-by: Dodji Seketeli --- diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 8383ae98..a4b4f1a1 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -3107,11 +3107,25 @@ compare_prepared_linux_kernel_packages(package& first_package, string vmlinux_path1, vmlinux_path2; - if (!get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) - return abigail::tools_utils::ABIDIFF_ERROR; + if (!vmlinux_path1.empty() + && !get_vmlinux_path_from_kernel_dist(debug_dir1, vmlinux_path1)) + { + emit_prefix("abipkgdiff", cerr) + << "Could not find vmlinux in debuginfo package '" + << first_package.path() + << "\n"; + return abigail::tools_utils::ABIDIFF_ERROR; + } - if (!get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) - return abigail::tools_utils::ABIDIFF_ERROR; + if (!vmlinux_path2.empty() + && !get_vmlinux_path_from_kernel_dist(debug_dir2, vmlinux_path2)) + { + emit_prefix("abipkgdiff", cerr) + << "Could not find vmlinux in debuginfo package '" + << second_package.path() + << "\n"; + return abigail::tools_utils::ABIDIFF_ERROR; + } string dist_root1 = first_package.extracted_dir_path(); string dist_root2 = second_package.extracted_dir_path();