::printf doesn't handle enums
If you want to ::printf an enum member of a structure, you end up with an error. It would make sense if %d and %s both worked on enums (printing the numeric and symbolic values, respectively).
Here's an example of current behavior:
> ::walk spa | ::head -1 | ::printf "%d\\n" spa_t spa_state mdb: expected integer type mdb: failed to print member 'spa_state' > ::walk spa | ::head -1 | ::printf "%s\\n" spa_t spa_state mdb: exepected pointer or array type mdb: failed to print member 'spa_state'
For completeness, ::print works so CTF info is correct:
> ::walk spa | ::head -1 | ::print spa_t spa_state spa_state = 0 (POOL_STATE_ACTIVE)
Updated by Electric Monk almost 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 38ce19d2fe6359bf2fe9536f075f30cc972d2b50 Author: Josef 'Jeff' Sipek <email@example.com> Date: 2014-10-24T23:16:43.000Z 5231 ::printf doesn't handle enums Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Richard Lowe <email@example.com> Reviewed by: Alex Reece <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>