Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find implementation of function pointer

I am wondering how to locate the implementation of which the function pointer points to:

eg. I am navigating through chrome source code and want to see the definition of SwapBuffers: return get_interface<PPB_Graphics3D_1_0>()->SwapBuffers( pp_resource(), cc.pp_completion_callback()); clicking into the SwapBuffers symbol lead me to the function pointer declaration:

int32_t (*SwapBuffers)(PP_Resource context, struct PP_CompletionCallback callback); I am stuck here. how to track down the the real implementation of SwapBuffers?

like image 441
znosaj88 Avatar asked Mar 10 '26 12:03

znosaj88


1 Answers

I know this is an old question, but this is how I did it.

  1. Put the function pointer (or std::function<> or folly::Function<> or what-have you) in the watch window.
  2. Drill down in the data until you find something of type pointer-to-function. In my case, I'm looking at member folly::Function::call_ which has type void(*)(folly::detail::function::Data&)
  3. Right-click value -> go to disassembly. In my case it looked like jmp foo::FunctionTraits<foofoo<<lambda_foofoo> > (07FF604306B20h)
  4. Paste that address into the disassembly window's "Address" field. Repeat until you're at your code.
like image 86
Paul Du Bois Avatar answered Mar 13 '26 02:03

Paul Du Bois