Re: [DynInst_API:] std::cout calls resolved as dynamic calls


Date: Thu, 18 Aug 2016 19:11:22 +0000
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] std::cout calls resolved as dynamic calls
Sorry for the delay on this, Manoj; my mail client was misbehaving and not updating the folder for the list.

All virtual functions are indirect at the binary level. That's almost certainly the issue here; the binary is doing counterintuitive things.

________________________________________
From: Dyninst-api <dyninst-api-bounces@xxxxxxxxxxx> on behalf of Manoj Kumar <kumar140976@xxxxxxxxx>
Sent: Wednesday, August 17, 2016 12:32 PM
To: dyninst-api@xxxxxxxxxxx
Subject: [DynInst_API:] std::cout calls resolved as dynamic calls

Hello,

I have created the binary file for the below test function on windows platform using VC12 compiler. I am using Dyninst 9.0.3 release to analyze the call points of the test function and checking for the dynamic call site.  Below is the test function used for binary analysis and BPatch_point class APIs used for call point filterting.

void test_func()
{
     std::cout << "Test";

    std::cout << 10;

     int x = 15;
     std::cout << x;

     std::string str = "Test Func Called";
     std::cout << str;
}

BPatch_function* func = point->getCalledFunction();
bool dyn_site = point->isDynamic();

While iterating through the call points of the test function 'test_func()'. I observed strange behavior for the call points std::cout << 10; and std::cout << x;

Both the call points returns NULL function object for the API call point->getCalledFunction() while 'isDynamic' call returns true for these
call points. I believe this is the wrong behaviour for these call points as std::cout calls are not function pointer calls.

Could you pls. elaborate on this behaviour. Is there a way to detect both the std::cout calls as normal function calls.

Thanks
Kumar

[← Prev in Thread] Current Thread [Next in Thread→]