13 messages in org.opensolaris.mdb-discuss[mdb-discuss] how to dump a array and...
FromSent OnAttachments
zhijunAug 23, 2007 7:15 am 
Alexandre ChartreAug 23, 2007 7:56 am 
zhijunAug 23, 2007 8:33 am 
Alexandre ChartreAug 23, 2007 8:36 am 
Eric SchrockAug 23, 2007 8:36 am 
zhijunAug 23, 2007 9:27 am 
Eric SchrockAug 23, 2007 9:36 am 
zhijunAug 24, 2007 8:28 am 
Eric SchrockAug 24, 2007 10:38 am 
zhijunAug 24, 2007 7:44 pm 
Jonathan AdamsAug 25, 2007 12:11 am 
Eric SchrockAug 25, 2007 8:37 am 
zhijunAug 26, 2007 6:00 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[mdb-discuss] how to dump a array and find which slots are non zero?Actions...
From:Eric Schrock (eric@Sun.COM)
Date:Aug 25, 2007 8:37:40 am
List:org.opensolaris.mdb-discuss

On Sat, Aug 25, 2007 at 10:45:10AM +0800, zhijun wrote:

I really appreciate your kindness to explain this for me.

::array ... p | ::eval '<p/Kn | =Kn' gives pure uintptr_t's so it works well with mdb pipeline. What I am suprized is that ::array ... p | /Kn *doesn't* give pure uintptr_t's, as its output has an address in the first line, so I expect it will break the mdb pipeline, but instead it works. Am I missing anything here?

As mentioned in the original mail, dcmds have a way of 'knowing' when they are in pipe context (DCMD_PIPE_OUT) and can alter their output based on this. For the '/' operator, you can find this check in print_arglist():

if (DCMD_HDRSPEC(flags) && (flags & DCMD_PIPE_OUT) == 0) {

Are you just curious, or are you trying to solve a particular problem? As Jonathan mentioned, there are more efficient ways to accomplish what you have demonstrated thus far.

- Eric