|
GEOS SDK TechDocs
|
|
_print ...
|
alias ...
addr-parse
addr-parse <addr> [<addr-only>]
Examples:
-
"addr-parse *ds:si"
-
Parse the address "*ds:si" into its handle, offset and data-type components. In this case, the data-type will be "nil".
-
"addr-parse ILLEGAL_HANDLE 0"
-
Figures the value for the enumerated constant "ILLEGAL_HANDLE". The handle for this non-address will be "value".
This command parses the address expression into its components, returning a list {<handle> <offset> <type> } as its value.
-
This will generate an error if there's an error parsing the <addr>
-
<handle> is the token for the handle in which the address resides, or "nil" if the address is absolute. This token can be given to the "handle" command for further processing.
-
<offset> is a decimal number and is the offset of the address within the block indicated by the <handle> token. If <handle> is "nil", this can be a 32-bit linear address.
-
<type> is a type token for the data at the given address, if any could be determined. For example the address "ds:bx" has no type, as it's just a memory reference, but "ds:bx.VDE_extraData" will have whatever type the structure field "VDE_extraData" possesses. This token can be passed to the "type" or "value" commands for further processing.
-
If the expression doesn't refer to data that can be fetched from the patient (e.g. "foo*3") <handle> will be returned as the string "value" instead of a normal handle token. <offset> is then a value-list for the resulting value, and <type> is the type description by means of which the value list can be interpreted.
-
The optional <addr-only> argument is zero or non-zero to indicate the willingness or unwillingness, respectively, of the caller to receive a value list in return. If <addr-only> is absent or non-zero, any expression that can only be expressed as a value will generate an error. The single exception to this is if the expression involves pointer arithmetic. For example "pself+1" normally would be returned as a value list for a far pointer, as the result cannot be fetched from the PC. When <addr-only> is absent or non-zero, "addr-parse" pretends the expression was "*(pself+1)", allowing simple specification of an address by the user for those commands that just address memory.
-
The <offset> element of the returned list is very useful when you want to allow the user to give you anything, be it a register or a number or an enumerated constant or whatever. You can pass the argument you were given to [index [addr-parse $arg] 1] and end up with an appropriate decimal number. Be sure to pass <addr-only> as 0, however, or else you'll generate an error.
See Also: value,
handle,
type.
addr-preprocess
addr-preprocess <addr> <seg-var> <off-var>
Examples:
-
"addr-preprocess $args s o"
-
Parse the address expression in $args, storing the segment portion in $s and the offset portion in $o in the current scope.
Preprocesses an address expression into a form that is easier to manipulate and faster to reparse.
-
<seg-var> is the name of a variable in the caller's scope in which the segment of the address is stored. It should be treated as opaque, as it may or may not be numeric.
-
<off-var> is the name of a variable in the caller's scope in which the offset of the address is stored. This will always be numeric.
-
Returns the 3-list returned by addr-parse, in case you have a use for the type token stored in the list.
See Also: addr-parse.
addr-with-obj-flag
addr-with-obj-flag
Examples:
-
"var addr [addr-with-obj-flag $addr]"
-
If $addr is "-i", returns the address of the current implied grab.
This is a utility routine that can be used by any command that deals with objects where the user may reasonably want to operate on the leaf object of one of the hierarchies, or the windowed object under the mouse. It can be given one of a set of flags that indicate where to find the address of the object on which to operate.
-
Special values accepted for <address>:
-
-a
-
the current patient's application object
-
-i
-
the current "implied grab": the windowed object over which the mouse is currently located
-
-f
-
the leaf of the keyboard-focus hierarchy
-
-t
-
the leaf of the target hierarchy
-
-m
-
the leaf of the model hierarchy
-
-c
-
the content for the view over which the mouse is currently located
-
-kg
-
the leaf of the keyboard-grab hierarchy
-
-mg
-
the leaf of the mouse-grab hierarchy
-
If <address> is empty, this will return the contents of the local variable "oself" within the current frame, if it has one, or *ds:si
-
If <address> isn't one of the above, this just returns <address>.
See Also: impliedgrab,
content,
focusobj,
targetobj,
modelobj,
keyboardobj,
mouseobj.
|
GEOS SDK TechDocs
|
|
_print ...
|
alias ...