[18/27] {dwarf,btf,ctf}-reader: Set the origin of the corpus group

Message ID 874j73l3e3.fsf@seketeli.org
State New
Headers
Series Implement type hashing & fix self-comparing gcc-gnat in fc37 |

Commit Message

Dodji Seketeli Aug. 29, 2024, 4:06 p.m. UTC
  Hello,

Apart from the ABIXML reader, readers don't set the origin of a corpus
group when its read.  Oops.  Fixed thus.

	* src/abg-btf-reader.cc (reader::read_corpus): Set the origin of
	the corpus group being read.
	* src/abg-ctf-reader.cc (reader::read_corpus): Likewise.
	* src/abg-dwarf-reader.cc (reader::read_debug_info_into_corpus):
	Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-btf-reader.cc   | 5 +++++
 src/abg-ctf-reader.cc   | 5 +++++
 src/abg-dwarf-reader.cc | 5 +++++
 3 files changed, 15 insertions(+)
  

Patch

diff --git a/src/abg-btf-reader.cc b/src/abg-btf-reader.cc
index 32aa74fd..5ca1f2db 100644
--- a/src/abg-btf-reader.cc
+++ b/src/abg-btf-reader.cc
@@ -515,6 +515,11 @@  public:
     corpus::origin origin = corpus()->get_origin();
     origin |= corpus::BTF_ORIGIN;
     corpus()->set_origin(origin);
+    if (corpus_group())
+      {
+	origin |= corpus_group()->get_origin();
+	corpus_group()->set_origin(origin);
+      }
 
     if ((status & STATUS_NO_SYMBOLS_FOUND)
 	|| !(status & STATUS_OK))
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 5fc66dfe..7a92ecee 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -693,6 +693,11 @@  public:
     corpus::origin origin = corpus()->get_origin();
     origin |= corpus::CTF_ORIGIN;
     corp->set_origin(origin);
+    if (corpus_group())
+      {
+	origin |= corpus_group()->get_origin();
+	corpus_group()->set_origin(origin);
+      }
 
     slurp_elf_info(status);
     if (status & fe_iface::STATUS_NO_SYMBOLS_FOUND)
diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index bf33dc7c..5ce68ab1 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -2262,6 +2262,11 @@  public:
     corpus::origin origin = corpus()->get_origin();
     origin |= corpus::DWARF_ORIGIN;
     corpus()->set_origin(origin);
+    if (corpus_group())
+      {
+	origin |= corpus_group()->get_origin();
+	corpus_group()->set_origin(origin);
+      }
 
     if (origin & corpus::LINUX_KERNEL_BINARY_ORIGIN
 	&& !env().user_set_analyze_exported_interfaces_only())