Opened 13 days ago
Last modified 7 hours ago
#398 new enhancement
Install new token command/active function — at Version 1
| Reported by: | Gary Dixon | Owned by: | Eric Swenson |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Tools | Version: | MR12.9 |
| Keywords: | Cc: |
Description (last modified by )
token is a new command/active function which captures the output returned by a command (like dump_segment or ring_zero_dump), parses it into tokens, then uses specifications (rules) to select desired information from that output. The command displays the selected tokens; the active function returns value items (numbers, pointer values, etc) to the caller.
token is designed to be used in an exec_com script to select specific information from a data segment (using dump_segment's structure display interface to select the particular items), and save that data as an exec_com variable for eventual display to the user. A given data item can be acquired and saved in a single exec_com &set statement.
For example, the following &set statement dumps the first 1200_o words of the stack_header structure and selects the stack_header.ect_ptr pointer value as the return string from the token active function. vptr uses that pointer to locate the Event Channel Table for the given ring (whose stack_header is being displayed), and assigns that location to the ectP exec_com variable. The rules for selecting the return string are tailored to dump_segment structure output strings. The -dump_segment_as_value (-dsav) control_arg selects those canned rules as -match values.
&set ectP &[vptr ||[token -cmd "rzd &(stackP) +0 1200 -as stack_header.ect_ptr" -dsav] -null]
The calling sequence for the proposed token command/AF is shown below.
2026-08-10 token Syntax as a command: token -control_args Syntax as an active function: [token -control_args] Control arguments (input): -input TOKEN_STRING, -command COMMAND_LINE, -in TOKEN_STRING -cmd COMMAND_LINE Control arguments (specifications): -match SPECIFICATION, -dump_segment_as_value, -m SPECIFICATION -dsav Control arguments (debugging): -mode MODE_STRING, -md MODE_STRING List of matching specifiers: <element_name> <value> <array_index> <value: if <element_name>> <entrypoint_name> <value: if <element_name> returns "1"b> <skip> <value: if <element_name> returns "0"b> <skip: N> <value: if <entrypoint_name>> List of mode names: args input, in specifications, specs, sp match, mh, m
