dependency analysis in XCode
dependency analysis in XCode
- Subject: dependency analysis in XCode
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Tue, 15 Feb 2005 10:47:09 -0500
- Thread-topic: dependency analysis in XCode
This is a general question, thrown out there for any Apple people, gcc
people, etc. to ponder.
I have been spending the past while unraveling a large ball of C code
(true C99 code, no GNU extensions) that a) has little or no proper
documentation and b) tends to use terse, and sometimes misleading, names
for variables and functions. In addition, the functions are not
separated according to use very well (they're tossed into files
haphazardly), and they tend to have large chunks of repitious code in
them (someone copied & pasted multiple places, and then changed a single
variable here or there, rather than making a new function, with an extra
parameter).
I know that many are probably thinking "throw it out and rewrite it!",
which is what I plan on doing, but I can't do so until I understand what
the heck it is doing (see part a above).
I have managed to get a bit of a handle of where to start by compiling
everything without linking, running each of the .o files through nm
-ago, and then running that through a python script that attempts to
convert the whole thing into something that graphviz
(http://www.pixelglow.com/graphviz/) can turn into a dependency graph.
I also tried to use gcc -MM to figure out the include graph, but that
just tells me what files are being included, not what are needed.
The problems with these methods are that I lose all of the proprocessor
options (they are compiled out, and since one function can have multiple
possible dependencies depending on what is defined...), and I can't
really tell what _functions_ are calling the other functions. What I
would like is some way of throwing the whole godawful ball of code at
something, and have it spit back at me a dependency graph so that I can
work from the bottom up and figure out what the heck is going on.
Basically, I need a good, CHEAP refactoring tool.
Now the reason that I'm asking this on this list, is because I've seen
that XCode 2.0 is supposed to the ability to model the data and class
hierarchies; will it also be able to handle what I'm talking about
above?
If it can't, is there anything out there that CAN do what I want done?
Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden