msDebug Cannot Print Tensor Variables, Prompting "Unavailable" or "Memory Read Failed"

Symptom

The message "unavailable" or "Failed to dereference pointer from xxx for DW_OP_deref: memory read failed for xxx" is displayed.

Solution

This problem occurs when the printed object a is of the Tensor type and the value is passed as the input parameter of the function.

1
void Foo(const LocalTensor<float> a); // The variable a fails to be printed.

To print the variable, modify the code so that object a is passed by reference as the input parameter of the function.

1
void Foo(const LocalTensor<float> &a); // The variable a can be printed.