Page 1 of 1

Watcom __PRO,__EPI and program profile

Posted: Wed Jun 27, 2012 3:18 am
by steph
Hello.

I'm trying to get program call tree for code analys (something like):
main
--->func1
--------->func2
--->func3

In gcc there are great funtions as backtrace,backtrace_symbols,etc.
In windows stackwalk64.
I mentioned both of them for regular systems.

I've tried to found something like them in watcom (10.6 QNX4.25), but (for now) got nothing. After reading manual for wcc I get next two options for compilier
-ee - add __EPI to end of each function
-ep - add __PRO to start of each function
It seems that after building app and running it, I will get necessary profile "tree", but wlink refuse to link object file, printing "undifined symbol __PRO,__EPI".
In manual for wlink there are no any data about __PRO,__EPI.
So is it possible to use them? Are there any other functions that can help me to get function call depth?

Re: Watcom __PRO,__EPI and program profile

Posted: Wed Jun 27, 2012 5:04 am
by JamesM
That's not doing what you think it's doing.

What it's doing is the equivalent of -finstrument-functions - it expects you to define two functions __PRO and __EPI (prologue and epilogue) - these will get prepended/appended to every function.

You'd need to provide your own code as part of these functions to create your tree.