Jonathan Adams wrote: > On Fri, Oct 10, 2008 at 03:03:57PM -0400, Girish Moodalbail wrote: > >> Hello folks, >> >> I have a quick question on how to obtain the name of the function given >> that you have a function pointer to that function? MDB's >> *mdb_lookup_by_addr() *doesn't seem to work. >> > > mdb_lookup_by_addr() should be what you want; something like: > > GElf_Sym sym; > char buf[MDB_SYM_NAMELEN]; > > if (mdb_lookup_by_addr(addr, MDB_SYM_FUZZY, buf, MDB_SYM_NAMELEN, > &sym) == -1) > // failed > > is the standard invocation. What, exactly, are you trying? > > Hello Jonathan,
Thanks for the quick reply. There was a small bug in my code. I had to invoke mdb_vread() on the function pointer and then use that address in mdb_lookup_by_addr(). It now works fine. thanks ~Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/mdb-discuss/attachments/20081010/5c7565df/attachment.html>