public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] abipkgdiff: Emit error when no vmlinux is found in debug package
@ 2023-02-28 11:32 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-02-28 11:32 UTC (permalink / raw)
  To: libabigail

Hello,

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 <dodji@redhat.com>
---
 tools/abipkgdiff.cc | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

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();
-- 
2.39.2


-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-28 11:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 11:32 [PATCH, applied] abipkgdiff: Emit error when no vmlinux is found in debug package Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).