📄 wdbgexpr.gml
字号:
.ix 'expressions' 'complex constant'
A
.us complex constant
consists of a left parenthesis, followed by a real or integer constant
representing the real part of the complex constant, followed by a
comma, followed by a real or integer constant representing the
imaginary part of the complex constant, followed by a right
parenthesis.
.np
The following are examples of complex constants.
.millust begin
( 1423.34E12, 3 )
( +345, 4 )
.millust end
.np
Complex constants will be accepted when the debugger's currently
established language is FORTRAN.
The language currently selected can be determined using the
.kw SHow Set LAnguage
command.
.*
.section Character Constant (C Only)
.*
.np
.ix 'expressions' 'character constant'
In the C and C++ programming languages, a
.us character constant
consists of an apostrophe followed by a single character
followed by an apostrophe.
The apostrophes are not part of the datum.
An apostrophe in a character datum represents one character,
namely the apostrophe.
A character constant must have length 1.
.np
The following are examples of character constants.
.millust begin
'A'
'e'
'''
.millust end
.np
The C/C++ form of a character constant will be accepted when
the debugger's currently established language is C or C++.
The language currently selected can be determined using the
.kw SHow Set LAnguage
command.
.*
.section Character String Constant (FORTRAN Only)
.*
.np
.ix 'expressions' 'character constant'
In the FORTRAN 77 programming language, a
.us character constant
consists of an apostrophe followed by any string of characters
followed by an apostrophe. The apostrophes are not part of the
datum. If an apostrophe is to appear as part of the datum it must
be followed immediately by another apostrophe. Note that blanks
are significant. The length of the character constant is the
number of characters appearing between the delimiting apostrophes.
Consecutive apostrophes in a character datum represent one
character, namely the apostrophe. A character constant must not
have length 0.
.np
The following are examples of character constants.
.millust begin
'ABCDEFG1234567'
'There''s always tomorrow'
.millust end
.np
The FORTRAN form of a character constant will be accepted when
the debugger's currently established language is FORTRAN.
.endlevel
.*
.section Memory References
.*
.np
.ix 'expressions' 'memory references'
.ix 'expressions' 'referencing memory'
.ix 'expressions' 'segment'
.ix 'expressions' 'offset'
In addition to referring to memory locations by symbolic name or line
number, you can also refer to them using a combination of constants,
register names, and symbol names.
In the Intel 80x86 architecture, a memory reference requires a segment
and offset specification.
When symbol names are used, these are implicit.
The general form of a memory reference is:
.syntax
[segment:]offset
.esyntax
.np
When an offset is specified alone, the default segment value is taken
from the CS, DS or SS register depending on the circumstances.
.*
.section Predefined Debugger Variables
.*
.np
The debugger defines a number of symbols which have special meaning.
These symbols are used to refer to the computer's registers and other
special variables.
.begnote $break
.note General Purpose Registers
.ix 'expressions' 'registers'
.us eax, ax, al, ah,
.us ebx, bx, bl, bh,
.us ecx, cx, cl, ch,
.us edx, dx, dl, dh
.note Index Registers
.us esi, si,
.us edi, di
.note Base Registers
.us esp, sp,
.us ebp, bp
.note Instruction Pointer
.ix 'expressions' 'instruction pointer'
.us eip, ip
.note Segmentation Registers
.ix 'expressions' 'segment registers'
.us cs, ds, es, fs, gs, ss
.note Flags Registers
.ix 'expressions' 'flags'
.ix 'expressions' 'flags register'
.us fl,
.us fl.o, fl.d, fl.i, fl.s,
.us fl.z, fl.a, fl.p, fl.c,
.us efl,
.us efl.o, efl.d, efl.i, efl.s,
.us efl.z, efl.a, efl.p, efl.c
.note 8087 Registers
.ix 'expressions' 'floating point registers'
.us st0, st1, st2, st3, st4, st5, st6, st7
.note 8087 Control Word
.ix 'expressions' 'control word register'
.us cw,
.us cw.ic, cw.rc, cw.pc, cw.iem, cw.pm,
.us cw.um, cw.om, cw.zm, cw.dm, cw.im
.note 8087 Status Word
.ix 'expressions' 'status word register'
.us sw,
.us sw.b, sw.c3, sw.st, sw.c2, sw.c1, sw.c0,
.us sw.es, sw.sf, sw.pe, sw.ue, sw.oe,
.us sw.ze, sw.de, sw.ie
.note Miscellaneous Variables
.ix 'expressions' 'pre-defined variables'
.us dbg$32, dbg$bottom, dbg$bp, dbg$code,
.us dbg$cpu, dbg$ctid, dbg$data, dbg$etid,
.us dbg$fpu, dbg$ip, dbg$left, dbg$monitor,
.us dbg$ntid, dbg$os, dbg$pid, dbg$psp,
.us dbg$radix, dbg$remote, dbg$right, dbg$sp,
.us dbg$top, dbg$nil, dbg$src, dbg$loaded
.endnote
.np
The debugger permits the manipulation of register contents and special
debugger variables (e.g., dbg$32) using any of the operators described
in this chapter.
By default, these predefined names are accessed just like any other
variables defined by the user or the application.
.ix 'expressions' '_dbg module'
Should the situation ever arise where the application defines a
variable whose name conflicts with that of one of these debugger
variables, the module specifier
.id _dbg
may be used to resolve the ambiguity.
.ix 'expressions' '_dbg@cs'
For example, if the application defines a variable called
.id cs
then
.id _dbg@cs
can be specified to resolve the ambiguity.
The "_dbg@" prefix indicates that we are referring to a debugger
defined symbol rather than an application defined symbol.
.refalso vidsymb
.*
.section Register Aggregates
.*
.np
.ix 'expressions' 'register aggregate'
.ix 'expressions' 'aggregate'
There are times when a value may be stored in more than one register.
For example, a 32-bit "long" integer value may be stored in the
register pair DX:AX.
We require a mechanism for grouping registers to represent a single
quantity for use in expressions.
.np
We define the term "register aggregate" as any grouping of registers
to form a single unit.
An aggregate is specified by placing register names in brackets in
order from most significant to least significant.
Any aggregate may be specified as long as it forms an 8, 16, 32 or
64-bit quantity.
The following are examples of some of the many aggregates that can be
formed.
.exam begin 10
8-bit [al]
16-bit [ah al]
16-bit [bl ah]
16-bit [ax]
32-bit [dx ax]
32-bit [dh dl ax]
32-bit [dh dl ah al]
32-bit [ds di]
64-bit [ax bx cx dx]
64-bit [edx eax] (386/486/Pentium only)
.exam end
.np
In some cases, the specified aggregate may be equivalent to a
register.
For example, the aggregates "[ah al]" and "[ax]" are equivalent to
"ax".
.np
.ix 'expressions' 'coercing types'
.ix 'expressions' 'type enforcement'
The default type for 8-bit, 16-bit, and 32-bit aggregates is integer.
The default type for 64-bit aggregates is double-precision
floating-point.
To force the debugger into treating a 32-bit aggregate as
single-precision floating-point, the type coercion operator "[float]"
may be used.
.endlevel
.*
.section *refid=videxpc Operators for the C Grammar
.*
.np
.ix 'expressions' 'C operators'
The debugger supports most C operators and includes an additional set
of operators for convenience.
The
.us &company C Language Reference
manual describes many of these operators.
.np
The syntax for debugger expressions is similar to that of the C
programming language.
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
||
&&
Bit Operators
|
^
&
Relational Operators
== !=
< <= < >=
Shift Operators
<< >>
Arithmetic Operators
+ -
* / %
Unary Operators
+ - ~~ ! ++ -- & * %
sizeof unary_expr
sizeof(type_name)
(type_name) unary_expr
[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
.mnote ()
function call
.mnote .
field selection
.mnote ->
field selection using a pointer
.endnote
.np
The following sections describe the operators presented above.
.beglevel
.*
.keep
.section Assignment Operators for the C Grammar
.*
.begnote
.mnote =
Assignment:
The value on the right is assigned to the object on the left.
.mnote +=
Additive assignment:
The value of the object on the left is augmented by the value on the
right.
.mnote -=
Subtractive assignment:
The value of the object on the left is reduced by the value on the
right.
.mnote *=
Multiplicative assignment:
The value of the object on the left is multiplied by the value on the
right.
.mnote /=
Division assignment:
The value of 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 C Grammar
.*
.begnote
.mnote &&
Logical conjunction:
The logical AND of the value on the left and the value on the right is
produced.
If either of the values on the left or right is equal to 0 then the
result is 0; otherwise the result is 1.
.mnote ||
Logical inclusive disjunction:
The logical OR of the value on the left and the value on the right is
produced.
If either of the values on the left or right is not equal to 0 then
the result is 1; otherwise the result is 0.
If the value on the left is not equal to 0 then the expression on the
right is not evaluated (this is known as short-circuit expression
evaluation).
.endnote
.*
.section Bit Operators for the C Grammar
.*
.begnote
.mnote &
Bit-wise AND:
The bits of the value on the left and the value on the right are
ANDed.
.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.
.endnote
.*
.section Relational Operators for the C Grammar
.*
.begnote
.mnote ==
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 !=
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 <
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 <=
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 >
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 >=
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 C 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 Binary Arithmetic Operators for the C 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 /
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -