Does anybody has implemented such thing in the past? Any clue would be
helpfull.
Thanks in advance,
Kind regards.
Laurent Mealares.
--
Mit freundlichen Grüßen,
Michael Lawnick
==============================================
SOFTEC GmbH Tel +49-731-96600-0
Promenade 17 Fax +49-731-96600-23
D-89073 Ulm Michael Lawnick
Germany law...@softec.de
==============================================
"Laurent Mealares" <laurent....@csem.ch> schrieb im Newsbeitrag
news:3C762558...@csem.ch...
Danial
Laurent Mealares <laurent....@csem.ch> wrote in message news:<3C762558...@csem.ch>...
> --
yes, you need to cast the char * to whatever you need; in your case a
function pointer.
Further, you may need to change the name of the symbol; e. g. for x86
target, a underscore is prefixed.
See the following function, that actually loads a module and returns the
pointer to the given function name:
(for pc486, VxWorks 5.4)
dl_funcptr GetDynLoadFunc(const char *fqname, const char *shortname,
const char *pathname)
{
char funcname[258];
int fdModule;
MODULE_ID hModule;
STATUS result;
char *pResult;
SYM_TYPE type;
fdModule = open(pathname, O_RDONLY, 0);
if (fdModule == ERROR) return 0;
hModule = loadModule(fdModule, LOAD_GLOBAL_SYMBOLS);
close(fdModule);
if (hModule == NULL) return 0;
sprintf(funcname, "_%.200s", shortname);
result = symFindByNameAndType(sysSymTbl, funcname, &pResult, &type,
SYM_GLOBAL | SYM_TEXT, SYM_GLOBAL | SYM_TEXT);
if (result != OK) return 0;
return (dl_funcptr) pResult;
}
I used symFindByNameAndType in that example, which allows to specify the
desired type as well as the name.
hth
Werner
"Laurent Mealares" <laurent....@csem.ch> wrote in message
news:3C765701...@csem.ch...
Thanks very much for your help Michael but what are the types of fname and
addr?
The prototype of symFindByName requires a char** for parameter3 and you mean
you can use a function pointer?
Thanks,
Laurent Mealares.
Michael Lawnick wrote:
Hi Laurent,try like this:if
((symFindByName(sysSymTbl,fName,&addr,&type)==OK)&&(type==SYM_TEXT)
addr(param1,...);--Mit freundlichen Grüßen,Michael
Lawnick============================================== SOFTEC GmbH
Tel +49-731-96600-0 Promenade 17 Fax +49-731-96600-23
D-89073 Ulm Michael Lawnick Germany
law...@softec.de =============================================="Laurent
Mealares" <laurent....@csem.ch> schrieb im
Newsbeitragnews:3C762558...@csem.ch...
Hello,I am tring to get the entry point of a routine (pointer) in the
symboltable of VxWorks.I am doing this because of dynamically loaded modules
in my system.I do know the name of the function (symbol) and I want to
retrieve itspointer.I have tried the symFindByName() function which returns
me a successfullstatus so it has found the symbol.The problem is: I don't
know where to "jump" to call this function?Does anybody has implemented such
Is this because c2_function1 is in a C++ file and the name has been
encoded by the compiler (name mangling) ? If so, you would have to declare
it extern "C" (or get your code to search for the mangled name".
DaveK
--
moderator of
alt.talk.rec.soc.biz.news.comp.humanities.meow.misc.moderated.meow
Burn your ID card! http://www.optional-identity.org.uk/
Help support the campaign, copy this into your .sig!
Proud Member of the Exclusive "I have been plonked by Davee because he
thinks I'm interesting" List Member #<insert number here>
Master of Many Meowing Minions
Holder of the exhalted PF Chang's Crab Wonton Award for kook spankage above
and beyond the call of hilarity.