Re: Function pointers in C ( standard tool)
Re: Function pointers in C ( standard tool)
- Subject: Re: Function pointers in C ( standard tool)
- From: Jens Ayton <email@hidden>
- Date: Fri, 04 May 2007 22:50:07 +0200
- Openpgp: id=84FF254B
Michael:
>
> Once a pointer is initialized to point to a function, and that pointer
> is used as an argument to a sub-routine, can one see the name of the
> function in that subroutine, or for that matter, anything else about
> that function in the debugger? ( for example, a value of an array in
> that function?)
> thanks in advance.
Hack solution (prefer non-hack solution if anyone has one to suggest): add a
function to your tool which compares a function pointer to each function that
might be used and prints or returns the name:
char *MyFunctionToName(void *func)
{
if (func == (void *)Function1) return "Function1()";
if (func == (void *)Function2) return "Function2()";
else return "unknown function!";
}
If you don't dead-strip your tool, you can then call this from within the
debugger. You can also make Xcode call it automatically for your variables
(click the summary field in the debugger’s variable pane and enter something
like "{(char *)MyFunctionToName($VAR)}:s").
--
Jens Ayton
Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden