From: | Rudi Chiarito |
Date: | 20 Sep 2000 at 16:34:34 |
Subject: | Re: AMIOPEN: Dev Questions |
On Mon, Sep 18, 2000 at 10:49:01AM +0200, Aaron Optimizer Digulla wrote:
> On Fri, Sep 15, 2000 at 02:41:04PM -0500, Rudi Chiarito wrote:
>
> > > Q: How can shell commands be launched with options a from primary
> > > tool if shell environment doesn't exist?
> >
> > You can use the kernel process management tools directly. See
> > <sys/kn/proc/api.html>. Aaron Digulla's ixemulng ixemul_exec.c uses
> > these tools to provide a *nix like exec replacement:
> > http://www.amigadev.net/cgi-bin/cvsweb.cgi/~checkout~/ixemulng/ixemul_exec.c?rev=1.3&content-type=text/plain
>
> The problem is that the code still doesn't work and I have no idea
> why. The problem is splitUnixSearchPath(): When I call it in
> the test code (ie. as a local function), then it works. When I
> call it as a tool, then it doesn't (even tracef() doesn't work
> anymore, ie. the tracef's inside splitUnixSearchPath() don't
> print anything). Can you have a look, please ? To check the code,
> check out the code and then run "make check".
It looks like your tool entry point for splitunixsearchpath.00 is
strndup() rather than splitUnixSearchPath().
As it says in lang/cc/doc/tool.html:
The tool's entry point is determined by the first function linked
in. In the case of a single C file, it will be the first function
listed in that file.
You need to either move strndup() to below splitUnixSearchPath() in
splitunixsearchpath.c, or explicitly specify the entry point using
the -e option.
lang/cc/doc/vpcc.html:
-e <entry-point>
Use the specified procedure as the entry point for the linked tool.
This will override any explicit or default entry point e.g. main.
This must be used if -T is specified and there is more than one
procedure as optimisation may reorder the procedures.
Top tips for debugging:
You'd have figured this out in a second if you'd run the command
"dfa -dm ixemulng/tests/texec.00" (from /).
This would also have been caught by intent_shell_debug:
20000807:/ixemulng/tests$ ./texec
Create pipes
Calling splitUnixSearchPath...
Hard coded breakpoint
Elate parameter check:
subroutine expecting p0 i0 :p0
caller gave p0 :p0