Google Answers Logo
View Question
 
Q: Finding out which struct and struct members are used in a C program ( No Answer,   0 Comments )
Question  
Subject: Finding out which struct and struct members are used in a C program
Category: Computers > Programming
Asked by: gnurou-ga
List Price: $10.00
Posted: 06 Jun 2005 14:06 PDT
Expires: 06 Jun 2005 23:09 PDT
Question ID: 530046
Hello everyone,

I'm looking for a quick and easy way to figure out which structs and
members of structs are used by simply parsing a C program. For
instance, consider the following code:

void func(struct mystruct * arg)
{
   struct myotherstruct local;

   arg->member1 = 10;
   local.member1 = arg->member2;
}

Here the parser program should detect that members 'member1' and
'member2' of the struct 'mystruct', and member 'member1' of struct
'myotherstruct' are in use. Of course, it has be to region-aware: that
is, the 'arg' variable shouldn't be considered out of its scope.

I'd consider a tool doing this task as a valid answer, provided it is
lightweight and open-source available. Scripting à la sed, or anything
is also valid. I'm attempting to integrate that into a Java program,
so any Java-based solution is preffered.

Thanks!
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy