Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - _cmdname: (5 Items)
   
_cmdname  
I want to acheive the same thing that _cmdname does but remotely.    

I looked at _cmdname() but apparently the information is stuffed when the process starts.

To give a little more background, under QNX4 if you do sin the process name you'd see included the path from where the 
executable was started from, not sure exaclty but we'd see the whole path and not just the executable name. Under QNX6 
what I see is the name it was build under as given by the -o option at link time.

Some of our script/programs need the ability to tell were the program was started from or its current directory.

Suggestions?

Re: _cmdname  
Colin had fixed a "bug" in this area a few month ago, it should be in the
head branch, just
not in the released version (it is probably in a recent milestone build).
There was an intention
in the loader of maintaining the debug path information so that debug
clients could more
intelligently locate the source that they were debugging ... unfortunately
what it actually ended
up being used for 99% of the time was to get the process name of the running
process
(ever wonder why it was called DCMD_PROC_MAPDEBUG to get the process name?).

So after a group pow wow .. the functionality was changed to match what it
was being
used for vs its mostly theoretical used.

As a side note, this also fixed the problem where binaries build with
windows names
would end up not being recognized by utilities like pidin and slay.

Now ... I don't recall if the fullpath is maintained, enough that the node
information
is also present or not, but there is time yet to patch that.

Hope this helps,
 Thomas

On Fri, Mar 28, 2008 at 5:00 PM, Mario Charest <mcharest@zinformatic.com>
wrote:

>
> I want to acheive the same thing that _cmdname does but remotely.
>
> I looked at _cmdname() but apparently the information is stuffed when the
> process starts.
>
> To give a little more background, under QNX4 if you do sin the process
> name you'd see included the path from where the executable was started from,
> not sure exaclty but we'd see the whole path and not just the executable
> name. Under QNX6 what I see is the name it was build under as given by the
> -o option at link time.
>
> Some of our script/programs need the ability to tell were the program was
> started from or its current directory.
>
> Suggestions?
>
>
>
> _______________________________________________
> OSMeta
> http://community.qnx.com/sf/go/post6263
>
>
Re: _cmdname  
Unfortunaltely this is for 6.3.2.

> Colin had fixed a "bug" in this area a few month ago, it should be in the
> head branch, just
> not in the released version (it is probably in a recent milestone build).
> There was an intention
> in the loader of maintaining the debug path information so that debug
> clients could more
> intelligently locate the source that they were debugging ... unfortunately
> what it actually ended
> up being used for 99% of the time was to get the process name of the running
> process
> (ever wonder why it was called DCMD_PROC_MAPDEBUG to get the process name?).
> 
> So after a group pow wow .. the functionality was changed to match what it
> was being
> used for vs its mostly theoretical used.
> 
> As a side note, this also fixed the problem where binaries build with
> windows names
> would end up not being recognized by utilities like pidin and slay.
> 
> Now ... I don't recall if the fullpath is maintained, enough that the node
> information
> is also present or not, but there is time yet to patch that.
> 
> Hope this helps,
>  Thomas
> 
> On Fri, Mar 28, 2008 at 5:00 PM, Mario Charest <mcharest@zinformatic.com>
> wrote:
> 
> >
> > I want to acheive the same thing that _cmdname does but remotely.
> >
> > I looked at _cmdname() but apparently the information is stuffed when the
> > process starts.
> >
> > To give a little more background, under QNX4 if you do sin the process
> > name you'd see included the path from where the executable was started from,
> 
> > not sure exaclty but we'd see the whole path and not just the executable
> > name. Under QNX6 what I see is the name it was build under as given by the
> > -o option at link time.
> >
> > Some of our script/programs need the ability to tell were the program was
> > started from or its current directory.
> >
> > Suggestions?
> >
> >
> >
> > _______________________________________________
> > OSMeta
> > http://community.qnx.com/sf/go/post6263
> >
> >


Re: _cmdname  
> Unfortunaltely this is for 6.3.2

I think I found a way.  I can look at each program environment variable and figure it out.  We use script to start 
programs and I can create a variable in these scripts that will point to the directory.  

Now on the find how to read the environment variable of another process and I don't have Rob's Cookbook with me ;-(

> 
> > Colin had fixed a "bug" in this area a few month ago, it should be in the
> > head branch, just
> > not in the released version (it is probably in a recent milestone build).
> > There was an intention
> > in the loader of maintaining the debug path information so that debug
> > clients could more
> > intelligently locate the source that they were debugging ... unfortunately
> > what it actually ended
> > up being used for 99% of the time was to get the process name of the running
> 
> > process
> > (ever wonder why it was called DCMD_PROC_MAPDEBUG to get the process name?).
> 
> > 
> > So after a group pow wow .. the functionality was changed to match what it
> > was being
> > used for vs its mostly theoretical used.
> > 
> > As a side note, this also fixed the problem where binaries build with
> > windows names
> > would end up not being recognized by utilities like pidin and slay.
> > 
> > Now ... I don't recall if the fullpath is maintained, enough that the node
> > information
> > is also present or not, but there is time yet to patch that.
> > 
> > Hope this helps,
> >  Thomas
> > 
> > On Fri, Mar 28, 2008 at 5:00 PM, Mario Charest <mcharest@zinformatic.com>
> > wrote:
> > 
> > >
> > > I want to acheive the same thing that _cmdname does but remotely.
> > >
> > > I looked at _cmdname() but apparently the information is stuffed when the
> > > process starts.
> > >
> > > To give a little more background, under QNX4 if you do sin the process
> > > name you'd see included the path from where the executable was started 
> from,
> > 
> > > not sure exaclty but we'd see the whole path and not just the executable
> > > name. Under QNX6 what I see is the name it was build under as given by the
> 
> > > -o option at link time.
> > >
> > > Some of our script/programs need the ability to tell were the program was
> > > started from or its current directory.
> > >
> > > Suggestions?
> > >
> > >
> > >
> > > _______________________________________________
> > > OSMeta
> > > http://community.qnx.com/sf/go/post6263
> > >
> > >
> 
> 


Re: _cmdname  
> Now on the find how to read the environment variable of another process and I 
> don't have Rob's Cookbook with me ;-(

Duh, before anybody says anything, I know "Look into The Source Code" (tm)

- Mario