aboutsummaryrefslogtreecommitdiff
path: root/libctf
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-03-11 00:01:41 +0000
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 18:02:18 +0100
commit19d4b1addcafc786360c31d02d5ef2b44aef3152 (patch)
tree0c5cdf4aff4dd3d75b2bedc6f853dcc69fe0d63c /libctf
parent5f54462c6ab4665adec1f3e4591c095d63eae06a (diff)
downloadgdb-19d4b1addcafc786360c31d02d5ef2b44aef3152.zip
gdb-19d4b1addcafc786360c31d02d5ef2b44aef3152.tar.gz
gdb-19d4b1addcafc786360c31d02d5ef2b44aef3152.tar.bz2
libctf, link: fix spurious conflicts of variables in the variable section
When we link a CTF variable, we check to see if it already exists in the parent dict first: if it does, and it has a type the same as the type we would populate it with, we assume we don't need to do anything: otherwise, we populate it in a per-CU child. Or that's what we should be doing. Instead, we check if the type is the same as the type in *source dict*, which is going to be a completely different value! So we end up concluding all variables are conflicting, bloating up output possibly quite a lot (variables aren't big in and of themselves, but each drags around a strtab entry, and CTF dicts in a CTF archive do not share their strtabs -- one of many problems with CTF archives as presently constituted.) Fix trivial: check the right type. libctf/ * ctf-link.c (ctf_link_one_variable): Check the dst_type for conflicts, not the source type.
Diffstat (limited to 'libctf')
-rw-r--r--libctf/ChangeLog5
-rw-r--r--libctf/ctf-link.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog
index ba6664f..d664998 100644
--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,5 +1,10 @@
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+ * ctf-link.c (ctf_link_one_variable): Check the dst_type for
+ conflicts, not the source type.
+
+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
* ctf-impl.h (ctf_file_t): Improve comments.
<ctf_link_cu_mapping>: Split into...
<ctf_link_in_cu_mapping>: ... this...
diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c
index 3c96604..7b0ac38 100644
--- a/libctf/ctf-link.c
+++ b/libctf/ctf-link.c
@@ -584,7 +584,7 @@ ctf_link_one_variable (const char *name, ctf_id_t type, void *arg_)
}
/* Already present? Nothing to do. */
- if (dvd && dvd->dvd_type == type)
+ if (dvd && dvd->dvd_type == dst_type)
return 0;
}
}