Hi everyone,
I'm trying to display the information from a custom matrix class in Visual Studio 2008's debugger by enhancing/modifying the file autoexp.dat. The custom class goes as follow :
LVSN::Matrix<T> {
... functions ...
struct base_mat
{
T **Val;
size_t Row, Col, RowSiz, ColSiz;
int Refcnt;
T Err;
base_mat (size_t row, size_t col, T** v)
{
Row = row; RowSiz = row;
Col = col; ColSiz = col;
Refcnt = 1;
Err = 0;
Val = new T* [row];
size_t rowlen = col * sizeof(T);
for (size_t i=0; i < row; i++)
{
Val[i] = new T [col];
if (v) memcpy( Val[i], v[i], rowlen);
}
}
~base_mat ()
{
for (size_t i=0; i < RowSiz; i++)
delete [] Val[i];
delete [] Val;
}
};
base_mat *_m;
} // end of matrix class
So I am basically accessing the base_mat _m in autoexp.dat.. What I have so far is this :
;------------------------------------------------------------------------------
; LVSN::Matrix
;------------------------------------------------------------------------------
LVSN::Matrix<double>{
preview
(
#( "[", [(int)$c._m->Row], ",", [(int)$c._m->Col], "]")
)
children
(
#(
#array
(
expr : $c._m->Val[$i],
size : ((unsigned int*)(&($c._m->Row)))[$r],
rank : 2
)
)
)
}
This is able to display the preview properly, but I am unable to access the inner values of my matrix since it is an array of pointers to arrays of doubles. Rank will generate indexes as if it was one contiguous space in memory [col + row*rowsize]... and What I need is a double access [row][col]. If I understood correctly, autoexp does not allow for #if statements inside of #array, so I cannot rely on them.. I tried but I got an error message.
Has anyone toyed with autoexp.dat ? Do you see any way to do what I'm looking to do (apart from modifying the base class, hehe!) ?
thanks ! JC