Project

General

Profile

Bug #7066

::dump uses incredibly annoying syntax for specifying length

Added by Igor Kozhukhov over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2016-06-06
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

upstream:
DLPX-40441 ::dump uses incredibly annoying syntax for specifying length
https://github.com/delphix/delphix-os/commit/e7af87cfc4c0f80585724d648e5bed7871c3cfdb

History

#1

Updated by Josef Sipek over 3 years ago

Can you include more info about the change here? I'd be nice not having to go to downstream repos for change details.

#2

Updated by Igor Kozhukhov over 3 years ago

  • Description updated (diff)
#3

Updated by Josef Sipek over 3 years ago

Thanks, I was hoping there would be more information about the change in the Delphix commit. Oh well.

#4

Updated by Matthew Ahrens over 3 years ago

When I'm debugging something with mdb, I spend a lot of time inspecting structs to see if they make sense, and sometimes I need to dump out the contents of some memory buffer to see what's stored there:

[0]> ffffff0264b15ef0::print arc_buf_t b_hdr | ::print arc_buf_hdr_t
b_l1hdr.b_pabd | ::print abd_t abd_buf | ::dump
                   \/ 1 2 3  4 5 6 7  8 9 a b  c d e f  v123456789abcdef
ffffff0264dac000:  00000000 00000000 00000000 00000000  ................
[0]> 


If I want more than the first 16 bytes, there is only one way to tell ::dump how many bytes to dump:
[0]> ffffff0264b15ef0::print arc_buf_t b_hdr | ::print arc_buf_hdr_t
b_l1hdr.b_pabd | ::print abd_t abd_buf         
abd_buf = 0xffffff0264dac000
[0]> 0xffffff0264dac000,256::dump -g8 
                   \/ 1 2 3 4 5 6 7  8 9 a b c d e f  v123456789abcdef
ffffff0264dac000:  0000000000000000 0000000000000000  ................
ffffff0264dac010:  0000000000000000 0000000000000000  ................
ffffff0264dac020:  0000000000000000 0000000000000000  ................
...


Having to supply an argument after a comma before the ::dump command is both inconsistent with every other command in mdb (they take arguments with options like "-x 100") and unbelievably annoying (because you can't pipe an address to it). We should add a "-l" length argument to ::dump which tells it how many bytes to dump.
#5

Updated by Electric Monk over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit f11ba53f80410731989b127bc0e36a178773e84a

commit  f11ba53f80410731989b127bc0e36a178773e84a
Author: Dan Kimmel <dan.kimmel@delphix.com>
Date:   2016-06-08T16:33:05.000Z

    7066 ::dump uses incredibly annoying syntax for specifying length
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
    Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
    Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF