![]() |
![]() |
|
|
![]() |
![]() |
MPE/iX System Utilities Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 22 SOMPATCH![]() Operation |
|
The MPE/iX command interpreter includes the implied RUN concept, which allows the user to invoke a program merely by naming it. For the SOMPATCH utility, type sompatch[.group[.account and then specify a string of parameters (enclosed in quotes) before typing Return. The program file is searched according to the CI variable HPPATH. Currently, the SOMPATCH utility is stored in PUB.SYS. You may specify the following parameters on the command line:
The last two files can be specified in one of two ways. To use the C-shell indirection syntax, enter:
Or, to specify the files either positionally or by using the key words USE and LIST, respectively, enter:
If you use a patch file as is shown in the example, SOMPATCH executes all commands in the patch file and returns you to the MPE prompt. The following example shows how to patch a file that has been linked with a ypatch file. Using a text editor, create a patch file that has the following four lines:
In this command:
The file to be patched is nl.abuild00.official. When using a patch file, specify a list file, so that if the JCW is FATAL after the SOMPATCH utility executes, the list file can be examined to determine the problem. In the following examples, the patch file is pat0511 and the list file is lpat0511.
OR
Normally, the LOG command is used with all of the required parameters specified, just as in the example above; however, the SOMPATCH utility also provides user prompting for the log command.
This command describes the reason that a patch is being applied. It indicates problem symptoms and a fix description. A minimum of one line of comment text is required for each set of modify instructions composing a patch. You should describe the symptoms of the problem in detail, with an explanation when you anticipate a fix in source. Syntax
Parameters
Example
This command returns a file previously patched to an unmodified state. It is possible to undo a patch if the patch ID given in the LOG command used to apply the patch is known. This number can be seen in the output of the SHOW [BACKOUTS] command. The patch file name also can be used to back out the set of patches applied with the patch file. Backout commands are preserved in the ypatch information area. They can be also seen when using the [BACKOUTS] option on the SHOW command. All backouts are displayed as they are done (at program exit).
Syntax
Parameters
Example
This example shows 12 as the patch ID specified with the LOG command.
This example shows that all patches applied under patchfle.pub are to be removed. No patchfile as given.
No patchid as given.
This command displays the value(s) at a location. Syntax
Parameters
The values for mode are:
The display is sent to $STDLIST. The parameter symbolname may be entered in uppercase or lowercase or mixed case, unless it is defined in a C procedure, in which case it must be entered in the specific case in which it is listed out from the linker. If the symbol starts with an underbar, that should be entered as the first character. If the values to be displayed are the result of modifications made earlier in the SOMPATCH utility session, then the oldvalue|newvalue convention of the MODIFY command is used to indicate it. In the example below, only the word at iobuf+10 has been modified since the user invoked the SOMPATCH utility. (It is currently 1234ABCD in the file and will be 200 if the program is terminated with an EXIT command or a SAVE command.)
Symbol symbolname not found.
This command is used to exit the program and save the modifications made to the primary input file. To obtain a backup copy, make one before running the SOMPATCH utility. If the SOMPATCH utility is being run interactively and patch xx had an error, the following message is printed:
Syntax
Parameters None This command displays the following information about a symbol:
This command can also be used to look for a symbol when its name is not known. Syntax
Parameters
The "at" symbol (@) may be used as a leading or trailing mask, as shown in the example below. Example The following example displays `trap_handler$248$set_up_user_trap
This command displays a summary of commands, including syntax and options. Syntax
Parameters None This command causes the SOMPATCH utility to open an output list file. Syntax
Parameters
SOMPATCH uses the output list file to record all commands it encountered, all old values that were modified, and any errors that occurred. Example To append output to an existing file, use the C-shell redirection feature. For example:
If for some reason the file cannot be opened, an error message is generated and the JCWs are set to WARN status. Reissue the LIST command and enter a legal output file name. This command records important information about the specified patch. Syntax
Parameters
Every patch made on a shared file should have associated with it, at a minimum, the patch ID. The other parameters to this command are also important, but they may not be known at the time that the patch is applied. Always build the file with one of the ypatch files so that this information is saved. Use the LOG command before the first MODIFY command and before each subsequent patch, where each patch is composed of a set of one or more functionally connected modify commands. If you do not enter any parameters, LOG will prompt you for them. Refer to the "Operation" section. Example
No username given.
No patchid given.
File not built with ypatch.
This command modifies the value(s) at a specified location. Syntax
Parameters
All modifications are made in a buffer. However, if you issue a DISPLAY command following a MODIFY command and reference the same location, you will see the oldvalue|newvalue pair. Multi-SOM patches If a MODIFY command belongs to a symbol in a different SOM from the last symbol encountered, and there is no new LOG command, and the relevant SOMs have been built with a ypatch file, then the following action is taken:
Error handling If there is an error in a MODIFY command, the SOMPATCH utility takes one of the following actions, depending on its state:
Example
Also refer to the "Operation" section for an example of this command. Symbol symbolname not found.
Old value is not as specified.
Illegal syntax--use help.
This command searches for a set of numbers in a range around a specified symbol. Syntax
Parameters
This command is used mainly in relocating a patch. When an NL is relinked, all those patches that were not bound to their own entry-level procedure (refer to the SYMBOL command) move around. The OFFSET command can be used to find their new location. This command causes a patch to open a new file for patching or query. It specifies the input file to be patched. If a file is already open and patches have been made to it, the SOMPATCH utility reminds the user that a SAVE command is necessary to save changes before opening the new file. If the file you specified cannot be opened for read/write, an error message is generated, and the JCWs are set to their respective FATAL conditions. Syntax
Parameters
This command causes the SOMPATCH utility to generate a patch file from the patches in the main input file. It generates a patch file from the patch information in the ypatch areas in the SOM(s) in the main input file. If there are no patches, a file containing a few lines of header is generated. If there are no ypatch areas, an error message is generated. Syntax
Parameters
This command quits the program without changing the input file. If no modifications were made to the primary input file, the program exits and returns the user to the colon prompt. If you have made modifications, you will see following prompt:
If the user returns an uppercase or lowercase "y" or "yes," there is an immediate exit to the MPE colon prompt, with no changes made to the file to be patched; otherwise, the sp> prompt is displayed, and the SOMPATCH utility continues to operate. In either case, if there is a list file open, it is closed and saved. Syntax
Parameters None Use this command to save the modifications made to the primary input file without exiting the program. The section entitled "Input Files" in the "Overview" section on page 9-1 explains how to recover from a system malfunction in the middle of a SAVE command. Syntax
Parameters None Function This command shows information about any patches that have been applied to the input file. If only SHOW is typed, the most recent patch applied is displayed. In pre-releases of MPE XL, the installation procedures may not clearly define the proper use of the CLKUTIL utility. In this case, the system clock may not be correctly set, and the time of patch shown may be the Greenwich Mean Time, rather than the local time. Syntax
Parameters
No query available--file not linked with ypatch.
Illegal date specified--syntax YYMMDD.
Symbol not found.
This command causes the SOMPATCH utility to look only in the specified SOM for symbols. There are no SOM errors when parameters are entered as specified. Remember to start indexing from zero. If a name is given, it is a SOM not in the file. Try SOM @ to see what SOMs are in the file. Syntax
Parameters
This command finds the next level 1 procedure after the symbol+offset specified. Syntax
Parameters
This command is used in generating level 1 patches for multi-SOM libraries. For a very large file, such as the native mode system library, there may be a five-second to ten-second delay for symbol lookup. In this case, the message searching... is displayed every 15,000 symbols. For Pascal level 2 procedures, the code being patched is represented as a positive offset from the last level 1 procedure; however, this level 1 procedure is often in a different relocatable object file from the level 2 procedure being patched. This is because of the way that Pascal code is generated:
When the multi-SOM NL is linked, the two relocatable object files are sometimes no longer congruent. If they are not congruent, the positive offset from the first level 1 procedure is no longer valid. There are different ways of dealing with this problem. The easiest way is to specify a patch as a negative offset from the level 1 procedure that owns the level 2 procedure being patched ( 2) in the example above). The SOMPATCH utility contains the SYMBOL command, which determines the procedure name of the level 1 procedure that owns the level 2 procedure containing the patched instruction, plus the negative offset of the patch from the level 1 procedure entry point. No such symbol
This command causes a patch to read an input file of patch instructions, and to implement the instructions. If there is an error such as an undefined symbol in a MODIFY command, an error message is generated, and the program continues to execute. If the file specified is not present, an error message is generated, and the JCWs are set to their respective FATAL status. When the end of the patch file is reached, the program returns to the MPE/iX CI. Syntax
Parameters
This command gives the current SOMPATCH utility version. It is used to show the version of the SOMPATCH utility that is being run. The version is also printed on the list file and as part of each patch written to the ypatch area. Syntax
Parameters None Example
|
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|