public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: dodji@redhat.com
To: libabigail@sourceware.org
Cc: dodji@redhat.com
Subject: [PATCH 04/17] corpus: Support adding translation units with empty path
Date: Tue, 16 Jul 2024 16:55:15 +0200	[thread overview]
Message-ID: <20240716145541.473065-5-dodji@redhat.com> (raw)
In-Reply-To: <20240716145541.473065-1-dodji@redhat.com>

From: Dodji Seketeli <dodji@redhat.com>

The CTF front-end produces an artificial translation unit with an
empty path for all the types in a given ABI corpus.  Adding such a
translation unit to its corpus is conditioned on it having a non-empty
path.  Oops.  Fixed thus.

	* src/abg-corpus.cc (corpus::add): Do not require that the path of
	the translation unit be non-empty.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-corpus.cc | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc
index 1239deb0..994307fb 100644
--- a/src/abg-corpus.cc
+++ b/src/abg-corpus.cc
@@ -14,6 +14,7 @@
 #include <stdexcept>
 #include <unordered_map>
 #include <set>
+#include <memory>
 
 #include "abg-internal.h"
 
@@ -724,14 +725,11 @@ corpus::add(const translation_unit_sptr& tu)
 {
   ABG_ASSERT(priv_->members.insert(tu).second);
 
-  if (!tu->get_absolute_path().empty())
-    {
-      // Update the path -> translation_unit map.
-      string_tu_map_type::const_iterator i =
-	priv_->path_tu_map.find(tu->get_absolute_path());
-      ABG_ASSERT(i == priv_->path_tu_map.end());
-      priv_->path_tu_map[tu->get_absolute_path()] = tu;
-    }
+  // Update the path -> translation_unit map.
+  string_tu_map_type::const_iterator i =
+    priv_->path_tu_map.find(tu->get_absolute_path());
+  ABG_ASSERT(i == priv_->path_tu_map.end());
+  priv_->path_tu_map[tu->get_absolute_path()] = tu;
 
   tu->set_corpus(this);
 }
-- 
2.43.5


  parent reply	other threads:[~2024-07-16 14:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 14:55 [PATCH 00/17] Support self comparison of vmlinux & modules using BTF/CTF dodji
2024-07-16 14:55 ` [PATCH 01/17] ir: Fix a potential crash in canonicalize_types dodji
2024-07-16 14:55 ` [PATCH 02/17] elf-based-reader: Clean up logic of elf_based_reader::read_and_add_corpus_to_group dodji
2024-07-16 14:55 ` [PATCH 03/17] tools-utils,btf-reader: Take modules into account for corpus group dodji
2024-07-16 14:55 ` dodji [this message]
2024-07-16 14:55 ` [PATCH 05/17] ctf-reader: Do not set data member offsets for unions dodji
2024-07-16 14:55 ` [PATCH 06/17] ctf-reader: During re-initialization, only clear canonicalize-able types dodji
2024-07-16 14:55 ` [PATCH 07/17] ctf-reader: Fix analyzing single kernel binaries dodji
2024-07-16 14:55 ` [PATCH 08/17] reader: Fix corpus group reading dodji
2024-07-16 14:55 ` [PATCH 09/17] reader: Simplify type canonicalization invocation dodji
2024-07-16 14:55 ` [PATCH 10/17] reader: Simplify logic of get_or_read_and_add_translation_unit dodji
2024-07-16 14:55 ` [PATCH 11/17] reader: Fix building of void and void pointer types dodji
2024-07-16 14:55 ` [PATCH 12/17] reader: Fix building of variadic parameter type dodji
2024-07-16 14:55 ` [PATCH 13/17] ir: Don't strip typedefs from parms and return type when comparing fns dodji
2024-07-16 14:55 ` [PATCH 14/17] ir: Rename integral_type into real_type dodji
2024-07-16 14:55 ` [PATCH 15/17] ir,comparison,default-reporter: Consider sub-ranges in array diffs dodji
2024-07-16 14:55 ` [PATCH 16/17] abidw: Support the --abidiff option for Linux Kernel trees dodji
2024-07-16 14:55 ` [PATCH 17/17] configure: Support the optional 'big-tests' sub-directory dodji

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=20240716145541.473065-5-dodji@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).