This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
}


--------------------------------------------------------------------------------
--------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]