* Cannot view a structure in the watch window
@ 2004-01-14 8:28 Eric de Jong
0 siblings, 0 replies; only message in thread
From: Eric de Jong @ 2004-01-14 8:28 UTC (permalink / raw)
To: insight
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;
}
--------------------------------------------------------------------------------
--------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-01-14 8:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 8:28 Cannot view a structure in the watch window Eric de Jong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).