Hi Mike,

You should be able to use the oft forgotten $[<expression>] syntax:

> 2>mtypes
> page_freelists::array uintptr_t $[<mtypes]
fffffffffbc607e0
fffffffffbc607e8

For anyone who's writen a dcmd, that's how you get an argument of type
MDB_TYPE_IMMEDIATE rather than MDB_TYPE_STRING.

Adam

On Fri, Nov 04, 2005 at 05:56:40PM -0800, Michael E. Corcoran wrote:
> I'm trying to dump out the freelists and would like to make it a bit more 
> generic as different platforms have different numbers of page colors, 
> memnodes, ... but can't figure out how to do this.  What I would like would 
> be something similar to the following:
> 
> 2>mtypes
> 8>mnodes
> 0t1024>colors
> page_freelists+0::array uintptr_t <mtypes | :: print uintptr_t | ::array 
> uintptr_t <mnodes | :: print uintptr_t | ::array uintptr_t <colors | :: print 
> uintptr_t | ::grep ".!=0" | ::list page_t p_next
> 
> (note the interpreter of this post is doing a fairly bad job as only mtypes 
> above is printed right, whereas mnodes and colors have an extra greater than 
> sign in front of them for some reason)
> 
> however, when I run this, I get:
> mdb: digit 'm' is invalid in current base
> 
> Is there a way to make use of these varialbes within mdb dcmds?  If not, 
> anyone know a different way to do this.  Essentially I want to parameterize 
> my dcmd string.  In the past, I've had to resort to writing adb macros to do 
> something like this, but for now it's easier to just replace the numbers 
> manually in my big dcmd.
> In addition, I was wondering if there was a better way to do the above as I 
> don't like all the uintptr_t's increasing the length of the dcmd :)
> 
> Thanks,
> 
> Mike
> 
> PS, the space between ':' and 'p' in :: print is due to ::print having a 
> smiley in it  :)
> This message posted from opensolaris.org
> _______________________________________________
> mdb-discuss mailing list
> mdb-discuss at opensolaris.org

-- 
Adam Leventhal, Solaris Kernel Development       http://blogs.sun.com/ahl

Reply via email to