开发者

Tracing source to binary

I'm trying to understand the way a particular package fits into a project I'm working on. I believe only a portion of this package actually makes it into the binary of the project, and I need to find out exactly which parts. Library functions from this package are called from many other places (i.e. several other packages depend on it).

I plan to build the project and distribute it. Is the only way to determine which source->binary files I'll distribute by looking at all of the headers in my dependent packages? Or is th开发者_开发技巧ere a more clever way to approach this?

Thanks in advance,


You haven't given us much information to go on, but here's a method that will work: remove parts of the package and see if the project will still compile.


Use nm to unpack a static lib. This will list all the files and methods included in the lib.

You could also try using strings. This displays strings that are defined in the binary.

Look through your source and see if the strings you define are in the library.

Something like gprof could also be used to see which methods are called by your executable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜