public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] abipkgdiff: Emit error when no vmlinux is found in debug package
Date: Tue, 28 Feb 2023 12:32:03 +0100	[thread overview]
Message-ID: <87fsaqrpos.fsf@redhat.com> (raw)

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


                 reply	other threads:[~2023-02-28 11:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsaqrpos.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).