Hello,
I am trying to see the first ten values of a particular memory space pointed by a pointer. I can do it by evaluating an expression on Locals and Expressions window. Simply, hover on an expression and right-click "Evaluate Expression". Identifier will be shown on the window split down. In order to monitor first ten values, put " @10 " at the end of the identifier. It works properly for the local pointers in my program.
However, the problem arises when I use a library of which I have the source code. When I try to see the first ten values of an array passed to a method which I call from the library.dll, debugger shows some nonsense numbers
Such that,
ble *vector1;double *vector2;...
double aa = m_MyModul->m_pMyAPI->My_GetDistance(vector1,vector2);
ble *vector1;double *vector2;...
double aa = m_MyModul->m_pMyAPI->My_GetDistance(vector1,vector2);
To copy to clipboard, switch view to plain text mode
In the code above, the values of vector1 and vector2 are different from the ones below.
The following method is in my API.
double My_GetDistance(double* x_bins, double* y_bins)
{ return theFex->GetDist(x_bins, y_bins);
}
double My_GetDistance(double* x_bins, double* y_bins)
{ return theFex->GetDist(x_bins, y_bins);
}
To copy to clipboard, switch view to plain text mode
In the code above, vector1 and x_bins must be the same. But debugger shows something completely different.
Oddly enough, if I put this code into the library source code
for(int i=0;i<9;i++)
qDebug()<<x_bins[i];
for(int i=0;i<9;i++)
qDebug()<<x_bins[i];
To copy to clipboard, switch view to plain text mode
I am getting the first ten values on Terminal and they seem to be what I would normally expect.
The values are different from the ones in the Locals and Expressions window. More specifically, the values in the Locals and Expressions windows are not meaningful at all.
I presume it's a problem related to gdb but I am not sure.
Is there anyone who can give me any advice or who encountered such a problem before?
Thanks
Bookmarks