Project

General

Profile

Actions

Bug #4948

closed

mdb does not print enums correctly in a pipeline

Added by Alex Reece almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
mdb - modular debugger
Start date:
2014-06-30
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

When printing enums in a pipeline, mdb gets type errors. For example:

    > ::walk spa | ::walk metaslab | ::print metaslab_t ms_loaded
    ms_loaded = 0 (0)
    ms_loaded = 0 (0)
    ms_loaded = 0x1 (B_TRUE)
    ms_loaded = 0 (0)
    ms_loaded = 0 (0)

Works as expected, but

    > ::walk spa | ::walk metaslab | ::print metaslab_t ms_loaded | ::eval
'.=D'
    mdb: failed to print type: Type is not an integer or float
    mdb: failed to print type: Type is not an integer or float
    mdb: failed to print type: Type is not an integer or float
    mdb: failed to print type: Type is not an integer or float
    mdb: failed to print type: Type is not an integer or float

Produces the above type errors.

cmd_print is correctly acknowledging the DCMD_PIPE_OUT flag and calling a
special pipe_print function to output the result. The following excerpt from
pipe_print (in mdb_print.c) is troubling though:

    case CTF_K_INTEGER:
    case CTF_K_ENUM:
        if (mdb_ctf_type_encoding(base, &e) != 0) {
            mdb_printf("could not get type encoding\\n");
            return (-1);
        }

The issue is that mdb_ctf_type_encoding is a wrapper for ctf_type_encoding,
which is only valid to call for INTEGER or FLOATs.

Actions

Also available in: Atom PDF