358
Appendix E. The GDB Agent Expression Mechanism
If attempting to access memory at
addr
would cause a processor exception of some sort, termi-
nate with an error.
ref_float
(0x1b):
addr
=>
d
ref_double
(0x1c):
addr
=>
d
ref_long_double
(0x1d):
addr
=>
d
l_to_d
(0x1e):
a
=>
d
d_to_l
(0x1f):
d
=>
a
Not implemented yet.
dup
(0x28):
a
=
i
a a
Push another copy of the stack’s top element.
swap
(0x2b):
a b
=
i
b a
Exchange the top two items on the stack.
pop
(0x29):
a
=
i
Discard the top value on the stack.
if_goto
(0x20)
offset
:
a
=>
Pop an integer off the stack; if it is non-zero, branch to the given offset in the bytecode string.
Otherwise, continue to the next instruction in the bytecode stream. In other words, if
a
is non-
zero, set the
pc
register to
start
+
offset
. Thus, an offset of zero denotes the beginning of the
expression.
The
offset
is stored as a sixteen-bit unsigned value, stored immediately following the
if_goto
bytecode. It is always stored most significant byte first, regardless of the target’s normal endian-
ness. The offset is not guaranteed to fall at any particular alignment within the bytecode stream;
thus, on machines where fetching a 16-bit on an unaligned address raises an exception, you
should fetch the offset one byte at a time.
goto
(0x21)
offset
: =>
Branch unconditionally to
offset
; in other words, set the
pc
register to
start
+
offset
.
The offset is stored in the same way as for the
if_goto
bytecode.
const8
(0x22)
n
: =>
n
const16
(0x23)
n
: =>
n
const32
(0x24)
n
: =>
n
const64
(0x25)
n
: =>
n
Push the integer constant
n
on the stack, without sign extension. To produce a small negative
value, push a small twos-complement value, and then sign-extend it using the
ext
bytecode.
The constant
n
is stored in the appropriate number of bytes following the
constb
bytecode.
The constant
n
is always stored most significant byte first, regardless of the target’s normal en-
dianness. The constant is not guaranteed to fall at any particular alignment within the bytecode
stream; thus, on machines where fetching a 16-bit on an unaligned address raises an exception,
you should fetch
n
one byte at a time.
reg
(0x26)
n
: =>
a
Push the value of register number
n
, without sign extension. The registers are numbered follow-
ing GDB’s conventions.
The register number
n
is encoded as a 16-bit unsigned integer immediately following the
reg
bytecode. It is always stored most significant byte first, regardless of the target’s normal endian-
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......