Mailinglist Archive: opensuse-programming (84 mails)

< Previous Next >
Re: [suse-programming-e] VxWorks to Linux
  • From: Jerry Feldman <gaf@xxxxxxx>
  • Date: Wed, 25 Aug 2004 15:47:48 -0400
  • Message-id: <20040825154748.05ac5d11@xxxxxxxxxxx>
On Wed, 25 Aug 2004 16:00:16 +0100
expatriate <lbox@xxxxxxxxxxxxxxx> wrote:

> 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 <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
< Previous Next >
Follow Ups
References