Sun Studio 12 Update 1:使用 dbx 调试程序

print 表达式

可使用 print 命令对函数实例或类模板的成员函数求值:


(dbx) print iarray.getlength()
iarray.getlength() = 5

使用 printthis 指针求值。


(dbx) whatis this
class Array<int> *this;
(dbx) print *this
*this = {
    length = 5
    array   = 0x21608
}

有关更多信息,请参见print 命令