Project

General

Profile

Feature #3535

mdb ::print should pretty-print ipaddr_t and friends

Added by Christopher Siden over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
mdb - modular debugger
Start date:
2013-02-07
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

From Sebastien Roy's initial bug report at Delphix:

The mdb ::print dcmd should print ipaddr_t, in_addr_t, "struct in_addr",
in6_addr_t, and "struct in6_addr" as human-readable ascii representations of IP
addresses.  This would also allow us to take a random memory location and print
it as a legible IP address using <addr>::print <ip-address-type>.

Today, here's what we get.

Default output for ipaddr_t:

> ffffff01cab81010::print ire_t ire_u.ire4_u.ire4_addr
ire_u.ire4_u.ire4_addr = 0x5c810ac

This would be more legible as "172.16.200.5".

For in6_addr_t:

> ffffff01dfed2dd8::print ire_t ire_u.ire6_u.ire6_addr
ire_u.ire6_u.ire6_addr = {
    ire_u.ire6_u.ire6_addr._S6_un = {
        _S6_u32 = [ 0x80fe, 0, 0xff290c02, 0xdd925dfe ]
        _S6_u8 = [ 0xfe, 0x80, 0, 0, 0, 0, 0, 0, 0x2, 0xc, 0x29, 0xff, 0xfe,
0x5d, 0x92, 0xdd ]
        __S6_align = 0x80fe
    }
}

This would be more legible as "fe80::20c:29ff:fe5d:92dd".

History

#1

Updated by Christopher Siden over 7 years ago

  • Status changed from In Progress to Closed
commit 838d717
Author: Sebastien Roy <seb@delphix.com>
Date:   Thu Feb 7 14:42:52 2013

    3535 mdb ::print should pretty-print ipaddr_t and friends
    Reviewed by: Adam Leventhal <ahl@delphix.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Marcel Telka <marcel@telka.sk>
    Reviewed by: Dan McDonald <danmcd@nexenta.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF