This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Extracting Function Pointer Information??
- From: Seema Ravandale <ravandaless at gmail dot com>
- To: gcc <gcc at gcc dot gnu dot org>, gcc at gnu dot org
- Date: Tue, 3 Mar 2009 15:00:07 +0530
- Subject: Extracting Function Pointer Information??
Hi.
Given a function pointer in GIMPLE IR, is there any way to find
address/offset to which function pointd to?
e.g. I have written a code,
/** C code **/
void foo()
{
. . . .
}
void (*fptr)(void) = foo;
int main()
{
. . . . .
}
GIMPLE tree node for fptr would be, VAR_DECL--*-->
POINTER_TYPE--*-->FUNCTION_TYPE ---*-->
(Star specifies that, deferencing few more fields inside a tree_node)
In Gimple code, I wont see any assignment statement for fptr=foo, as
its a globally initialized.
I was trying to trace GIMPLE data structure where possibly the
information that, fptr points to foo would be stored.
Is there any way to find it out?
- Seema Ravandale
Note: I am working on GCC-4.3.0