purpose
I want to be able to extract some information from a collection of C ++ source files, partially compiling them. I say that we are partially compiling, because I do not have access to all the shared libraries with which it should link. The exact situation will be explained below.
In pseudo code, I have (roughly) the following structure:
class AParent : public AClassFromSharedLib {
...
void setup(void);
void otherThings(void);
...
}
class AChild : public AParent {
...
void setup(void);
void moreStuff(void);
...
}
...
AParent::setup(void)
{
interestingFunction("foo");
interestingFunction("bar");
interestingFunction("baz");
somethingElse("cafe");
}
...
AChild::setup(void)
{
super::setup();
interestingFunction("dead");
interestingFunction("beef");
somethingElse("babe");
}
...
REGISTER_CLASS("SomeName", AChild);
All I want to do is print the arguments interestingFunction
from the method invocation path setup()
for AChild
(and other objects registered through REGISTER_CLASS
).
SomeName:
"foo"
"bar"
"baz"
"dead"
"beef"
I do not care. Just a hierarchy of objects and a method setup
is all I really need to accomplish what I want.
: " , setup
, ". ? RedHat 5 g++ 4.4.x.
.so
, , , .so
. , . , . , , .
, , , .so
, , , . , , .
, , , , . , , , .., . - .
, gcc . , , , . , -Os -fdata-sections -ffunction-sections -Wl,--gc-sections
- . -flto
, , .
-Wl,--unresolved-symbols=ignore-in-object-files
, segfault , undefined main()
.
, . - grep ( , ..), . , .