On Wed, 25 Aug 2004 16:00:16 +0100
expatriate
Hello VxWorks literati
We're considering moving to Linux and one of the questions that was asked is: How do you emulate what's best of the VxWorks shell?
In VxWorks, the shell interpreter can call any library function currently loaded and execute it on the spot. For example, one can type
at the shell:
printf("Val = %d\n",x)
and the library function printf will be executed and the current value of x will be searched in the symbol table and passed on to the printf function.
Although this is a trivial example, perhaps the intended use would be more appropriate. Suppose a function called "foo(int a, double b)"
exists in a shared library used by a currently executing process. Is there an "easy" way to ask the process to search its symbol table and execute foo(a,b) for us?
Perhaps there's no easy way and each process now needs some form of IPC glued to it so we can funnel a command into it. Is there a Linux command to get the function pointer from a symbol table search?
Am I making any sense? I think I understand what you want, but I don't know VxWorks. The gdb debugger allows you to examine any value and call any function. It also allows you to examine any variable in your code. You can use the GDB call command to call any function in any library loaded with your program. (gdb) display x 1: x = 5 (gdb) call time(0) $2 = 1093463095
There are several very good IDEs for Linux. I like DDD which is layered
on gdb. I'm not sure this is what you want, but you might take a look at
IDEs such as Kdevelop.
--
Jerry Feldman