Foobar2000:Call tracking macros

From Hydrogenaudio Knowledgebase
Revision as of 14:14, 19 November 2009 by DEATH (Talk | contribs)

Jump to: navigation, search

foobar2000 call tracking macros


These macros enable you to store calling context information in crash reports. Such information will be primarily useful to you (the developer) when analyzing user-submitted crash reports, as well as will allow better automated tech support messages when your component crashes (telling the user what the crash cause was etc).

It is particularly useful to use these macros when interfacing with third party code, making it more clear what was being done when the problem occurred, even if it the crash itself is not your concern.


TRACK_CODE("my_code_label", my_code)

Puts my_code inside a call path tracking scope. If my_code crashes, the last segment of logged call path will be my_code_label, eg. entry=>app_mainloop=>my_code_label.


TRACK_CODE("this is myMethod() of myClass", obj->myMethod() );


Typically placed at the beginning of a scope. Puts the following code in a call path tracking scope.


void myFunction() {
    TRACK_CALL_TEXT("this is myFunction()");
    //your code goes here...
        TRACK_CALL_TEXT("myFunction() inner scope");
        //some more code

In this example, if the inner scope code crashes, the call path will end with this is myFunction()=>myFunction() inner scope.