aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-serialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/ctf-serialize.c')
-rw-r--r--libctf/ctf-serialize.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libctf/ctf-serialize.c b/libctf/ctf-serialize.c
index 60a6332..94f40a7 100644
--- a/libctf/ctf-serialize.c
+++ b/libctf/ctf-serialize.c
@@ -773,7 +773,7 @@ ctf_write_suppress_kind (ctf_dict_t *fp, int kind, int prohibited)
if (!set)
{
- set = ctf_dynset_create (ctf_hash_integer, ctf_hash_eq_integer, NULL);
+ set = ctf_dynset_create (htab_hash_pointer, htab_eq_pointer, NULL);
if (!set)
return (ctf_set_errno (fp, errno));
@@ -936,7 +936,7 @@ ctf_type_sect_size (ctf_dict_t *fp)
if ((kind != CTF_K_BIG) || tp->ctt_size != 0
|| LCTF_INFO_UNPREFIXED_VLEN (fp, tp->ctt_info) != 0)
if (ctf_dynset_lookup (fp->ctf_write_suppressions,
- (const void *) (uintptr_t) kind) == NULL)
+ (const void *) (uintptr_t) kind) != NULL)
{
type_size += sizeof (ctf_type_t);
suppress = 1;
@@ -982,10 +982,10 @@ ctf_emit_type_sect (ctf_dict_t *fp, unsigned char **tptr)
ctf_dtdef_t *dtd;
ctf_id_t id;
- if (!(fp->ctf_flags & LCTF_CHILD))
- id = fp->ctf_stypes + 1;
- else
- id = fp->ctf_header->cth_parent_ntypes + 1;
+ id = fp->ctf_stypes + 1;
+
+ if (fp->ctf_flags & LCTF_CHILD)
+ id += fp->ctf_parent->ctf_typemax;
for (dtd = ctf_list_next (&fp->ctf_dtdefs);
dtd != NULL; dtd = ctf_list_next (dtd), id++)
@@ -1248,8 +1248,9 @@ ctf_emit_type_sect (ctf_dict_t *fp, unsigned char **tptr)
}
#ifdef ENABLE_LIBCTF_HASH_DEBUGGING
- ctf_dprintf ("%p: provisional ID assignment: %lx -> %lx\n", (void *) fp,
- dtd->dtd_type, id);
+ if (dtd->dtd_type != id)
+ ctf_dprintf ("%p: provisional ID assignment: %lx -> %lx\n", (void *) fp,
+ dtd->dtd_type, id);
#endif
t += dtd->dtd_vlen_size;
@@ -1321,8 +1322,7 @@ ctf_serialize_output_format (ctf_dict_t *fp, int force_ctf)
machinery.)
If FORCE_CTF is enabled, always emit CTF in LIBCTF_BTM_POSSIBLE mode, and
- error in LIBCTF_BTM_BTF mode.
-*/
+ error in LIBCTF_BTM_BTF mode. */
int
ctf_preserialize (ctf_dict_t *fp, int force_ctf)