diff options
author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-11-03 18:06:23 +0000 |
---|---|---|
committer | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-11-12 21:15:20 +0000 |
commit | 3dfdac06b0c70e672dbe56a2f38ec05fc0254d07 (patch) | |
tree | 5b5b68bc9c5b7da55d542457fa81a143088e4050 /usr/src/common | |
parent | a676209deb2ce5d0c98f331659de25e2483f8c4c (diff) | |
download | illumos-joyent-3dfdac06b0c70e672dbe56a2f38ec05fc0254d07.tar.gz |
13278 CTF assertion failed cmp->cm_tmap[id].cmt_map == suid
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/common')
-rw-r--r-- | usr/src/common/ctf/ctf_hash.c | 24 | ||||
-rw-r--r-- | usr/src/common/ctf/ctf_impl.h | 1 | ||||
-rw-r--r-- | usr/src/common/ctf/ctf_types.c | 19 |
3 files changed, 43 insertions, 1 deletions
diff --git a/usr/src/common/ctf/ctf_hash.c b/usr/src/common/ctf/ctf_hash.c index 0c5a71a5ac..f97115a791 100644 --- a/usr/src/common/ctf/ctf_hash.c +++ b/usr/src/common/ctf/ctf_hash.c @@ -23,6 +23,8 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ #include <ctf_impl.h> @@ -175,3 +177,25 @@ ctf_hash_destroy(ctf_hash_t *hp) hp->h_chains = NULL; } } + +void +ctf_hash_dump(const char *tag, ctf_hash_t *hp, ctf_file_t *fp) +{ + ctf_dprintf("---------------\nHash dump - %s\n", tag); + + for (ushort_t h = 0; h < hp->h_nbuckets; h++) { + ctf_helem_t *hep; + + for (ushort_t i = hp->h_buckets[h]; i != 0; i = hep->h_next) { + ctf_strs_t *ctsp; + const char *str; + + hep = &hp->h_chains[i]; + ctsp = &fp->ctf_str[CTF_NAME_STID(hep->h_name)]; + str = ctsp->cts_strs + CTF_NAME_OFFSET(hep->h_name); + + ctf_dprintf(" - %3u/%3u - '%s' type %u\n", h, i, str, + hep->h_type); + } + } +} diff --git a/usr/src/common/ctf/ctf_impl.h b/usr/src/common/ctf/ctf_impl.h index d4ab96c4de..b208cfb486 100644 --- a/usr/src/common/ctf/ctf_impl.h +++ b/usr/src/common/ctf/ctf_impl.h @@ -273,6 +273,7 @@ extern ctf_helem_t *ctf_hash_lookup(ctf_hash_t *, ctf_file_t *, const char *, size_t); extern uint_t ctf_hash_size(const ctf_hash_t *); extern void ctf_hash_destroy(ctf_hash_t *); +extern void ctf_hash_dump(const char *, ctf_hash_t *, ctf_file_t *); #define ctf_list_prev(elem) ((void *)(((ctf_list_t *)(elem))->l_prev)) #define ctf_list_next(elem) ((void *)(((ctf_list_t *)(elem))->l_next)) diff --git a/usr/src/common/ctf/ctf_types.c b/usr/src/common/ctf/ctf_types.c index 6456f8a042..1fad60ddd4 100644 --- a/usr/src/common/ctf/ctf_types.c +++ b/usr/src/common/ctf/ctf_types.c @@ -26,6 +26,7 @@ */ /* * Copyright 2020 Joyent, Inc. + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. */ #include <ctf_impl.h> @@ -369,8 +370,24 @@ ctf_type_qlname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len, cdp->cd_type, want_func_args); vname = NULL; break; - case CTF_K_STRUCT: case CTF_K_FORWARD: + switch (tp->ctt_type) { + case CTF_K_UNION: + ctf_decl_sprintf(&cd, "union "); + break; + case CTF_K_ENUM: + ctf_decl_sprintf(&cd, "enum "); + break; + case CTF_K_STRUCT: + default: + ctf_decl_sprintf(&cd, "struct "); + break; + } + if (qname != NULL) + ctf_decl_sprintf(&cd, "%s`", qname); + ctf_decl_sprintf(&cd, "%s", name); + break; + case CTF_K_STRUCT: ctf_decl_sprintf(&cd, "struct "); if (qname != NULL) ctf_decl_sprintf(&cd, "%s`", qname); |