diff options
author | Alex Reece <alex@delphix.com> | 2014-07-02 15:20:41 -0800 |
---|---|---|
committer | Christopher Siden <chris@delphix.com> | 2014-07-02 16:20:41 -0700 |
commit | e9f82d69e04fa1b2246da55152ef2e746284078d (patch) | |
tree | 08da318dcd0b3e91561f17b233953debfa0b143c /usr/src | |
parent | a97d4a16317db7306cf947e1fccba57d895df625 (diff) | |
download | illumos-gate-e9f82d69e04fa1b2246da55152ef2e746284078d.tar.gz |
4948 mdb does not print enums correctly in a pipeline
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_print.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_print.c b/usr/src/cmd/mdb/common/mdb/mdb_print.c index e715b81d7d..02ee13abd9 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_print.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_print.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2012 Joyent, Inc. All rights reserved. */ @@ -1731,6 +1731,7 @@ pipe_print(mdb_ctf_id_t id, ulong_t off, void *data) uintptr_t value; uintptr_t addr = pap->pa_addr + off / NBBY; mdb_ctf_id_t base; + int enum_value; ctf_encoding_t e; union { @@ -1765,10 +1766,18 @@ again: mdb_printf("%#lr\n", value); break; - case CTF_K_INTEGER: case CTF_K_ENUM: + if (mdb_tgt_aread(pap->pa_tgt, pap->pa_as, &enum_value, + sizeof (enum_value), addr) != sizeof (enum_value)) { + mdb_warn("failed to read enum at %llx", addr); + return (-1); + } + mdb_printf("%#r\n", enum_value); + break; + + case CTF_K_INTEGER: if (mdb_ctf_type_encoding(base, &e) != 0) { - mdb_printf("could not get type encoding\n"); + mdb_warn("could not get type encoding\n"); return (-1); } |