📄 wdbgexpr.gml
字号:
function
.id foo
in the class
.id BASE.
.millust begin
virtual void foo()
{
a = 1;
}
.millust end
.np
Here are some more interesting examples:
.millust begin
derived::foo
derived::operator =
.millust end
.np
The first of these two examples contains an ambiguous reference so a
prompt window is displayed to resolve the ambiguity.
.*
.section Constructor/Destructor Functions in the C++ Grammar
.*
.np
We can also examine the constructor/destructor functions of
an object or class.
Continuing with the example of the previous sections, we can enter
expressions like:
.exam begin 2
base::base
base::~~base
.exam end
.np
The examples above permit us to reference the source code for the
constructor and destructor functions in the class
.id BASE.
.*
.endlevel
.*
.section Operators for the FORTRAN Grammar
.*
.np
.ix 'expressions' 'FORTRAN operators'
The debugger supports most FORTRAN 77 operators and includes an
additional set of operators for convenience.
The additional operators are patterned after those available in the C
programming language.
.np
The grammar that the debugger supports is close to that of the FORTRAN 77
language but there are a few instances where space characters must be
used to clear up any ambiguities.
For example, the expression
.millust begin
1.eq.x
.millust end
.pc
will result in an error since the debugger will form a floating-point
constant from the "1." leaving the string "eq.x".
If we introduce a space character after the "1" then we clear up the
ambiguity.
.millust begin
1 .eq.x
.millust end
.np
Unlike FORTRAN, the parser in the debugger treats spaces as significant
characters.
Thus spaces must not be introduced in the middle of symbol names,
constants, multi-character operators like .EQ. or //, etc.
.np
Operators are presented in order of precedence, from lowest to
highest.
Operators on the same line have the same priority.
.millust begin
Lowest Priority
Assignment Operators
= += -= *= /= %= &= |= ^= <<= >>=
Logical Operators
.EQV. .NEQV.
.OR.
.AND.
.NOT.
Bit Operators
|
^
&
Relational Operators
.EQ. .NE. .LT. .LE. .GT. .GE.
Shift and Concatenation Operators
<< >> //
Arithmetic Operators
+ -
* / %
** (unsupported)
Unary Operators
+ -
~~ ++ -- & * %
[type_name] unary_expr
?
Binary Address Operator
:
Highest Priority
.millust end
.np
Parentheses can be used to order the evaluation of an expression.
.np
In addition to the operators listed above, a number of primary
expression operators are supported.
These operators are used in identifying the object to be operated
upon.
.begnote
.mnote ()
subscripting, substringing, or function call
.mnote .
field selection
.mnote ->
field selection using a pointer
.endnote
.np
The following built-in functions may be used to convert the specified
argument to a particular type.
.millust begin
INT( ) conversion to integer
REAL( ) conversion to real
DBLE( ) conversion to double-precision
CMPLX( ) conversion to complex
DCMPLX( ) conversion to double-precision complex
.millust end
.np
The following sections describe the operators presented above.
.beglevel
.*
.section Assignment Operators for the FORTRAN Grammar
.*
.begnote
.mnote =
Assignment:
The value on the right is assigned to the object on the left.
.mnote +=
Additive assignment:
The object on the left is augmented by the value on the right.
.mnote -=
Subtractive assignment:
The object on the left is reduced by the value on the right.
.mnote *=
Multiplicative assignment:
The object on the left is multiplied by the value on the right.
.mnote /=
Division assignment:
The object on the left is divided by the value on the right.
.mnote %=
Modulus assignment:
The object on the left is updated with MOD(left,right).
The result is the remainder when the value of the object on the left
is divided by the value on the right.
.mnote &=
Bit-wise AND:
The bits in the object on the left are ANDed with the bits of the
value on the right.
.mnote |=
Bit-wise inclusive OR:
The bits in the object on the left are ORed with the bits of the
value on the right.
.mnote ^=
Bit-wise exclusive OR:
The bits in the object on the left are exclusively ORed with the bits
of the value on the right.
.mnote <<=
Left shift:
The bits in the object on the left are shifted to the left by the
amount of the value on the right.
.mnote >>=
Right shift:
The bits in the object on the left are shifted to the right by the
amount of the value on the right.
If the object on the left is described as unsigned, the vacated
high-order bits are zeroed.
If the object on the left is described as signed, the sign bit is
propagated through the vacated high-order bits.
The debugger treats registers as unsigned items.
.endnote
.*
.section Logical Operators for the FORTRAN Grammar
.*
.begnote
.mnote .EQV.
Logical equivalence:
The logical equivalence of the value on the left and the value on the
right is produced.
.mnote .NEQV.
Logical non-equivalence:
The logical non-equivalence of the value on the left and the value on
the right is produced.
.mnote .OR.
Logical inclusive disjunction:
The logical OR of the value on the left and the value on the right is
produced.
.mnote .AND.
Logical conjunction:
The logical AND of the value on the left and the value on the right is
produced.
.mnote .NOT.
Logical negation:
The logical complement of the value on the right is produced.
.endnote
.*
.section Bit Operators for the FORTRAN Grammar
.*
.begnote
.mnote |
Bit-wise OR:
The bits of the value on the left and the value on the right are ORed.
.mnote ^
Bit-wise exclusive OR:
The bits of the value on the left and the value on the right are
exclusively ORed.
.mnote &
Bit-wise AND:
The bits of the value on the left and the value on the right are
ANDed.
.endnote
.*
.section Relational Operators for the FORTRAN Grammar
.*
.begnote
.mnote .EQ.
Equal:
If the value on the left is equal to the value on the right then the
result is 1; otherwise the result is 0.
.mnote .NE.
Not equal:
If the value on the left is not equal to the value on the right then
the result is 1; otherwise the result is 0.
.mnote .LT.
Less than:
If the value on the left is less than the value on the right then the
result is 1; otherwise the result is 0.
.mnote .LE.
Less than or equal:
If the value on the left is less than or equal to the value on the
right then the result is 1; otherwise the result is 0.
.mnote .GT.
Greater than:
If the value on the left is greater than the value on the right then
the result is 1; otherwise the result is 0.
.mnote .GE.
Greater than or equal:
If the value on the left is greater than or equal to the value on the
right then the result is 1; otherwise the result is 0.
.endnote
.*
.section Arithmetic/Logical Shift Operators for the FORTRAN Grammar
.*
.begnote
.mnote <<
Left shift:
The bits of the value on the left are shifted to the left by the
amount described by the value on the right.
.mnote >>
Right shift:
The bits of the value on the left are shifted to the right by the
amount described by the value on the right.
If the object on the left is described as unsigned, the vacated
high-order bits are zeroed.
If the object on the left is described as signed, the sign bit is
propagated through the vacated high-order bits.
The debugger treats registers as unsigned items.
.endnote
.*
.section Concatenation Operator for the FORTRAN Grammar
.*
.begnote
.mnote //
String concatenation:
The concatenation of the character string value on the left and right
is formed.
.endnote
.*
.section Binary Arithmetic Operators for the FORTRAN Grammar
.*
.begnote
.mnote +
Addition:
The value on the right is added to the value on the left.
.mnote ~_
Subtraction:
The value on the right is subtracted from the value on the left.
.mnote *
Multiplication:
The value on the left is multiplied by the value on the right.
.mnote /
Division:
The value on the left is divided by the value on the right.
.mnote %
Modulus:
The modulus of the value on the left with respect to the value on the
right is produced.
The result is the remainder when the value on the left is divided by
the value on the right.
.mnote **
Exponentiation:
This operation is not supported by the debugger.
.endnote
.*
.section Unary Arithmetic Operators for the FORTRAN Grammar
.*
.begnote
.mnote +
Plus:
The result is the value on the right.
.mnote ~_
Minus:
The result is the negation of the value on the right.
.mnote ~~
Bit-wise complement:
The result is the bit-wise complement of the value on the right.
.mnote ++
Increment:
Both prefix and postfix operators are supported.
If the object is on the right, it is pre-incremented by 1 (e.g., ++x).
If the object is on the left, it is post-incremented by 1 (e.g., x++).
.mnote ~_ ~_
Decrement:
Both prefix and postfix operators are supported.
If the object is on the right, it is pre-decremented by 1 (e.g., --x).
If the object is on the left, it is post-decremented by 1 (e.g., x--).
.mnote &
Address of:
The result is the address (segment:offset) of the object on the right
(e.g., &main).
.mnote *
Points:
The result is the value stored at the location addressed by the value
on the right (e.g., *(ds:100), *string.loc).
In the absence of typing information, the value on the right is
treated as a pointer into the default data segment (DGROUP)
and a near pointer is
produced.
.code begin
(SS:00FE) = FFFF
var: (SS:0100) = 0152
(SS:0102) = 1240
(SS:0104) = EEEE
.code end
.mnote %
Value at address:
The result is the value stored at the location addressed by the value
on the right (e.g., %(ds:100), %string.loc).
In the absence of typing information, the value on the right is
treated as a pointer into the default data segment (DGROUP)
and a far pointer is produced.
.code begin
(SS:00FE) = FFFF
var: (SS:0100) = 0152
(SS:0102) = 1240
(SS:0104) = EEEE
.code end
.np
Note that this operator is not found in the FORTRAN 77 programming
language.
.endnote
.*
.section Special Unary Operators for the FORTRAN Grammar
.*
.begnote
.mnote ?
Existence test:
The "?" unary operator may be used to test for the existence of
a symbol.
.millust begin
?id
.millust end
.pc
The result of this expression is 1 if "id" is a symbol known to
the debugger and 0 otherwise.
If the symbol does not exist in the current scope then it must
be qualified with its module name.
Automatic symbols exist only in the current subprogram.
.endnote
.*
.section Binary Address Operator for the FORTRAN Grammar
.*
.begnote
.mnote :
Memory locations can be referenced by using the binary ":" operator
and a combination of constants, register names, and symbol names.
In the Intel 80x86 architecture, a memory reference requires a segment
and offset specification.
A memory reference using the ":" operator takes the following form:
.syntax
segment:offset
.esyntax
.pc
The elements
.sy segment
and
.sy offset
can be expressions.
.exam begin 2
(ES):(DI+100)
(SS):(SP-20)
.exam end
.endnote
.*
.section Primary Expression Operators for the FORTRAN Grammar
.*
.begnote
.mnote ()
Elements of an array can be identified using subscript expressions.
.mnote .
The "." operator indicates field selection in a structure.
This operator is useful in mixed language applications where part of
the application is written in the C or C++ programming language.
In the following example,
.id tyme2
is a structure and
.id tm_year
is a field in the structure.
.millust begin
tyme2.tm_year
.millust end
.mnote ->
The "->" operator indicates field selection when using a pointer
to a structure.
This operator is useful in mixed language applications where part of
the application is written in the C or C++ programming language.
In the following example,
.id tyme
is the pointer and
.id tm_year
is a field in the structure to which it points.
.millust begin
tyme->tm_year
.millust end
.endnote
.endlevel
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -