public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: "Eric de Jong" <list_ericdejong_10@gmx.net>
To: <insight@sources.redhat.com>
Subject: Cannot view a structure in the watch window
Date: Wed, 14 Jan 2004 08:28:00 -0000	[thread overview]
Message-ID: <000901c3da78$61ac0520$e33922c7@ericnt> (raw)

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


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

                 reply	other threads:[~2004-01-14  8:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000901c3da78$61ac0520$e33922c7@ericnt' \
    --to=list_ericdejong_10@gmx.net \
    --cc=insight@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).