summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJason King <jason.king@joyent.com>2019-04-01 15:53:09 +0000
committerJason King <jason.king@joyent.com>2019-04-01 21:41:20 +0000
commit8b607fd2753baed9c70e65eeda8ca3935dbe6077 (patch)
tree6b91aa08e84102bf589e5bf7998c0471b3dc8f69 /usr/src
parentc248e2484c2c0a42913ce48e21031d119c63fe45 (diff)
downloadillumos-joyent-8b607fd2753baed9c70e65eeda8ca3935dbe6077.tar.gz
OS-7695 mdb_dem_process should handle ENOTSUP
Reviewed by: John Levon <john.levon@joyent.com> Approved by: John Levon <john.levon@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_demangle.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_demangle.c b/usr/src/cmd/mdb/common/mdb/mdb_demangle.c
index b016297b31..94386d5f66 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_demangle.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_demangle.c
@@ -27,7 +27,7 @@
*/
/*
- * Copyright (c) 2018, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2019, Joyent, Inc. All rights reserved.
*/
#include <mdb/mdb_modapi.h>
@@ -210,7 +210,20 @@ mdb_dem_process(mdb_demangler_t *dmp, const char *name)
res = sysdemangle(name + prefixlen, dmp->dm_lang, &mdb_dem_demops);
if (res == NULL) {
- if (errno != EINVAL)
+ /*
+ * EINVAL indicates the name is not a properly mangled name
+ * (or perhaps is truncated so it cannot be correctly
+ * demangled) while ENOTSUP means sysdemangle could not
+ * determine which language was used to mangle the name when
+ * SYSDEM_LANG_AUTO is used (the name might not be mangled,
+ * the name could be truncated enough to prevent determination
+ * of the name, etc).
+ *
+ * Both are allowed/expected failure modes, so in both cases
+ * do not emit a warning -- let the caller display the
+ * original name.
+ */
+ if (errno != EINVAL && errno != ENOTSUP)
mdb_warn("Error while demangling");
return (-1);
}