public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com>
To: libabigail@sourceware.org
Cc: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com>
Subject: [PATCH] tools-utils: Looks for vmlinux binary in RPM debug package
Date: Mon,  6 Mar 2023 09:50:38 -0600	[thread overview]
Message-ID: <20230306155038.3316079-1-guillermo.e.martinez@oracle.com> (raw)

When Libabigail tools work with a `kernel' package, it looks for
`vmlinux' file in release RPM uncompress directory, if it is not
found, then try find it in `debug_info_root' directory.

	* src/abg-tools-utils.cc
	(get_binary_paths_from_kernel_dist): Add `debug_info_root' if
	`vmlinux' file is not found in `dist_root' directory.

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
 src/abg-tools-utils.cc | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 94dd8d05..8493ae90 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -2572,20 +2572,16 @@ get_binary_paths_from_kernel_dist(const string&	dist_root,
   string kernel_modules_root;
   string debug_info_root;
   if (dir_exists(dist_root + "/lib/modules"))
-    {
-      dist_root + "/lib/modules";
       debug_info_root = debug_info_root_path.empty()
-	? dist_root
+	? dist_root + "/usr/lib/debug"
 	: debug_info_root_path;
-      debug_info_root += "/usr/lib/debug";
-    }
 
   if (dir_is_empty(debug_info_root))
     debug_info_root.clear();
 
   bool found = false;
-  string from = dist_root;
-  if (find_vmlinux_and_module_paths(from, vmlinux_path, module_paths))
+  if (find_vmlinux_and_module_paths(dist_root, vmlinux_path, module_paths) ||
+      find_vmlinux_and_module_paths(debug_info_root, vmlinux_path, module_paths))
     found = true;
 
   std::sort(module_paths.begin(), module_paths.end());
-- 
2.39.1


             reply	other threads:[~2023-03-06 15:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 15:50 Guillermo E. Martinez [this message]
2023-03-07 18:57 ` [PATCH v2] abipkgdiff: Remove useless code to process kernel RPM packages Guillermo E. Martinez
2023-03-08 14:34 ` [PATCH] tools-utils: Looks for vmlinux binary in RPM debug package Dodji Seketeli
2023-03-09 23:31   ` Guillermo E. Martinez
2023-03-10  7:49   ` Dodji Seketeli

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=20230306155038.3316079-1-guillermo.e.martinez@oracle.com \
    --to=guillermo.e.martinez@oracle.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).