Pergunta

I am trying to visualize my matrix class in a more readable way than array of arrays using text visualizer. However even simplest rules won't work. Here is my rule for autoexp.dat:

; Custom visualizers for RTSG data types.
RTSG::Matrix44<float> {
  preview(
    #(
      "foo", "bar"
    )
  )
  stringview(
    #(
      "foo", "bar"
    )
  )
}

Here is the class definition:

template <class T> class Matrix44
{
public:
    T       x[4][4];

    // omitted methods, no other data members are declared
}

However VS still displays it as following in the watch window:

{x=0x0283e530 }

and there is no magnifying glass to start text visualizer. What am I doing wrong?

OS: Win 7 64-bit, VS: 2008 v3.5 SP1

Update: I have also noticed that VS was not always reacting to whatever changes in autoexp.dat, but would take them into account with some delay or after the debugger was restarted several times. As described in most of the places one only needs to restart debugger once and changes should be taken into account as debugger reads this file every time it starts. This doesn't seem to be the case on my machine.

Foi útil?

Solução

Did you try the more generic rule :

RTSG::Matrix44<*> {
  preview(
    #(
      "foo", "bar"
    )
  )
  stringview(
    #(
      "foo", "bar"
    )
  )
}

Try to put it also in the beginning of the autoexp.dat file.

If this one didn't work, you can effectively say that simplest rule doesn't work :p Cheers

Outras dicas

This is final visualizer for my 4x4 matrix class:

RTSG::Matrix44<*> {
  stringview(
    #(
      "'",
      [$e.x[0][0]], ['\t'], [$e.x[0][1]], ['\t'], [$e.x[0][2]], ['\t'], [$e.x[0][3]], ['\n'],
      [$e.x[1][0]], ['\t'], [$e.x[1][1]], ['\t'], [$e.x[1][2]], ['\t'], [$e.x[1][3]], ['\n'],
      [$e.x[2][0]], ['\t'], [$e.x[2][1]], ['\t'], [$e.x[2][2]], ['\t'], [$e.x[2][3]], ['\n'],
      [$e.x[3][0]], ['\t'], [$e.x[3][1]], ['\t'], [$e.x[3][2]], ['\t'], [$e.x[3][3]],
      "'"
    )
  )
}

Use with text visualizer. Produces many single quotes, but still better than 16 values in a column. This matrix uses column-major storage, flip indices for row-major.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top