Determining to which function a pointer is pointing in C?

后端 未结 9 990
情话喂你
情话喂你 2021-02-01 12:25

I have a pointer to function, assume any signature. And I have 5 different functions with same signature.

At run time one of them gets assigned to the pointer, and that

9条回答
  •  深忆病人
    2021-02-01 13:11

    1. set your linker to output a MAP file.
    2. pause the program
    3. inspect the address contained in the pointer.
    4. look up the address in the MAP file to find out which function is being pointed to.

提交回复
热议问题