Solved

replacement for vmunix

Posted on 1998-04-28
7
220 Views
Last Modified: 2010-04-21
I am porting an application from solaris1 to solaris2.  The application has the following command:

nm /vmunix | grep -w _msg | cut -c1-8

how do I obtain this address from solaris2?

Thanks in Advance
Eric
0
Comment
Question by:ethornsb
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:jos010697
ID: 2006496
Try /kernel/unix instead of /vmunix ...

kind regards,

Jos aka jos@and.nl
0
 

Author Comment

by:ethornsb
ID: 2006497
In my environment I have no /kernel/unix but instead genunix.  But it does not return the address as solaris1 does.  Here is what solaris1 does

nm /vmunix | grep -w _msg

returns

f01fa758 B _msg

solaris2 does this

nm genunix | grep -w msg

[2875]  |    4|    4|OBJT   |GLOB |0   |COMMON|msg

the address on solaris 1 is what I need?
0
 
LVL 4

Expert Comment

by:jos010697
ID: 2006498
This shows that the output format of 'nm' differs on your Solaris2 box ...
first try to find the symbol using 'nm' and 'grep'; if found, pipe it
through 'cut' using the appropriate -c#-# flags ...

kind regards,

Jos aka jos@and.nl
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:ethornsb
ID: 2006499
Yes, I understand that the output format differs.  That is why I have been unable to obtain the address.  My questions is how do I obtain the address from what the output shows on Solaris2 (in previous comment)?

my unix is not all that great - sorry if you've already said this but I need you to dumb it down a little

the points are yours with a grade A if you can provide anymore assistance.
0
 
LVL 2

Expert Comment

by:seedy
ID: 2006500
Use the '-P' option of nm.  This produces a portable output
format.
"nm -P genunix | grep -w msg" gives, in my machine,
     msg        D 00000004 00000004
The output is name, type, value(address) and the size.
So,
     nm -P genunix | grep -w msg | awk '{ print $3 }'
will get you the address of msg symbol.
PS:  Out of curiosity, why do you want to do this?
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 100 total points
ID: 2006501
or use 'sed' instead of 'cut'. Here's a way to do it:

   nm /vmunix | grep -w _msg | sed -f scriptfile

where 'scriptfile' contains the following little monster:

   s/\[\([0-9A-Za-z]*\)\].*/\1/

Basically, this reads: s/pattern/substitute/

where 'pattern' must match a left square bracket, a bunch of hexadecimal digits
and a right square bracket again. Everything between those square brackets
is pumped to standard output ...

instead of using the 'sed -f scriptfile' syntax, you could type in pass horrible
sed command to sed by putting it on the command line. The trouble is, that
your shell gobbles up all those nasty slashes, brackets etc. ...

kind regards,

Jos aka jos@and.nl

0
 

Author Comment

by:ethornsb
ID: 2006502
Thanks for all the help.  The reason I wanted to do this was because I am trying to port a network communication services pacakge from sol1 and sol2.  When starting the program 2 of the parameters required are the addresses of these two elements.

Thanks Again
Eric
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question