- To: gcc-help@xxxxxxxxxxx
- Subject: How to access initialized values of global variables
- From: Swati <swatirathi@xxxxxxxxxxxxxx>
- Date: Wed, 09 May 2012 20:22:50 +0530
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110805 Thunderbird/3.1.12
Hello,
I am trying to fetch the initialized values of global variables.
For eg : int i = 10;
I am able to extract the value using DECL_INITIAL.
But when I have a case like below,
struct node
{
int x;
int y;
};
struct node n1=
{
99,
88,
};
I get value as {.x=99, .y=88}
How should I iterate to fetch 99 and 88 individually?
In a way I want to access individual variables initialized values.
Can someone tell me the way to do it.
Thanks in advance.
Regards,
Swati
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]