This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Cannot view a structure in the watch window
- From: "Eric de Jong" <list_ericdejong_10 at gmx dot net>
- To: <insight at sources dot redhat dot com>
- Date: Wed, 14 Jan 2004 09:28:00 +0100
- Subject: Cannot view a structure in the watch window
Hello,
I cannot view a structure in the watch window in insight. I use the following
environment:
cygwin 1.5.5
binutils 2.14
gcc 3.3.2
insight 6.0
all compiled for the arm7tdmi target as 'arm-elf'
When I try to watch the structure TextX I get the following result in the watch
window:
" TestX = (<data variable, no debug info>) 1"
The number is the first integer in the TestX structure.
Watching the following does work:
"*(StructTestX*)(&TestX)"
All is caused by the "extern StructTestX TestX" statement. Without it, I can
view the structure without problems. (But then, I cannot use the global variable
in other source modules) There are enough workarounds for this problem, but it
is pretty anoying. Who has a solution?
Below is the sample program: (compiled with "gcc -g testx.cpp").
Eric de Jong.
testx.cpp
--------------------------------------------------------------------------------
----------------
// Example file to show problem, compiled with "arm-elf-gcc -g testx.cpp"
// ----
// This file shows that the structure StructTestX is not visible in the insight
// debugger when the structure definition is followed by an 'extern'
declaration.
// workaround is possible.
// ----
// Included in a header file
typedef struct StructTestX
{
int a;
int b;
};
extern StructTestX TestX;
// The variabele himself
struct StructTestX TestX;
// Insight debugger gives the following result in the watch window:
// " TestX = (<data variable, no debug info>) 1"
// (the debugger gives the first integer from the structure)
// This works: *(StructTestX*)(&TestX)
//
int main()
{
TestX.a = 1;
TestX.b = 334;
TestX;
return -1;
}
--------------------------------------------------------------------------------
--------