From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30870 invoked by alias); 14 Jan 2004 08:28:12 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 30839 invoked from network); 14 Jan 2004 08:28:00 -0000 Received: from unknown (HELO mail.gmx.net) (213.165.64.20) by sources.redhat.com with SMTP; 14 Jan 2004 08:28:00 -0000 Received: (qmail 16350 invoked by uid 65534); 14 Jan 2004 08:27:59 -0000 Received: from 1Cust153.tnt37.rtm1.nld.da.uu.net (EHLO ericnt) (213.116.168.153) by mail.gmx.net (mp009) with SMTP; 14 Jan 2004 09:27:59 +0100 X-Authenticated: #14554654 Message-ID: <000901c3da78$61ac0520$e33922c7@ericnt> From: "Eric de Jong" To: Subject: Cannot view a structure in the watch window Date: Wed, 14 Jan 2004 08:28:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2004-q1/txt/msg00008.txt.bz2 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 = () 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 = () 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; } -------------------------------------------------------------------------------- --------