dladdr() returns garbage for nearest symbol name
dladdr() returns garbage for nearest symbol name
- Subject: dladdr() returns garbage for nearest symbol name
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Tue, 3 Feb 2009 09:37:00 -0500
- Thread-topic: dladdr() returns garbage for nearest symbol name
I've finally gotten my -finstrument-functions hack working with dladdr(), but I've noticed that I'm getting a fair amount of garbage out of it. Basically, I'm calling it like so:
void __cyg_profile_func_enter(void *this_fn, void *call_site)
{
Dl_info functionInfo;
dladdr(this_fn, &functionInfo;
Dl_info call_siteInfo;
dladdr(call_site, &callsiteInfo);
syslog(LOG_INFO, "%s got called from within %s",
call_siteInfo.dli_sname,
functionInfo.dli_sname);
}
The problem is that although the function name is always good, the call site info is often bad. I'll get output like "???^H?^C?^XG??^A???", without the quotes. This isn't very useful. Any ideas on what I'm seeing and what I need to do to correct this?
Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden