10-14-2010 02:35 AM
Hello,
I want to know if it's possible to change the settings of the debugger, especially the display settings of the "view variable values" in labwindows cvi 9.0.
My problem is that in my project it is crucial to be able to debug and I came across some difficulities using array of structs containig pointers to structs. So I made a demo project to demonstrate:
typedef struct {
short sVar1;
short sVar2;
char cVar1[512];
}MyStruct2;
typedef struct {
MyStruct2 ReadMyS2;
MyStruct2 WriteMyS2;
MyStruct2* pReadMyS2;
MyStruct2* pWriteMyS2;
}MyStruct1;
int main()
{
MyStruct1 MyS1_Phis[3]={0};
int i = 0;
// init
for(i=0;i<3;i++)
{
MyS1_Phis[i].pReadMyS2 = &MyS1_Phis[i].ReadMyS2;
MyS1_Phis[i].pWriteMyS2 = &MyS1_Phis[i].WriteMyS2;
}
}
Most unfortunately the debugger handles the MyS1_Phis[0].pReadMyS2 pointer as if it's pointing to an array of 10 MyStruct2 type elements.
Does anyone know the reason for that?
Thanks in advance,
Laszlo Nagy
Solved! Go to Solution.
10-14-2010 02:18 PM
Hi Laszlo,
Yes, this is a known issue in CVI. This can happen because of the way the CVI user protection is implemented. It's definitely undesirable, but we probably won't be able to change this for at least another year or two.
One workaround you have is to disable user protection and then rebuild your program (Options>>Build Options>>Debugging Level: No run-time checking)
Luis
10-15-2010 02:45 AM
Hello Luis,
Thanks for the solution.
Best regards,
Laszlo