Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 0
^done,asm_insns=[
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"},
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}]
(gdb)
Disassemble 3 instructions from the start of main in mixed mode:
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 1
^done,asm_insns=[
src_and_asm_line={line="31",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn=[
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"}]},
src_and_asm_line={line="32",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn=[
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}]}]
(gdb)
The -data-evaluate-expression command
Synopsis
-data-evaluate-expression expr
Evaluate expr as an expression. The expression could contain an inferior function call.
The function call will execute synchronously. If the expression contains spaces, it must
be enclosed in double quotes.
GDB command
The corresponding GDB commands are 'print', 'output', and 'call'. In gdbtk only,
there is a corresponding 'gdb_eval' command.
Example
In the following example, the numbers that precede the commands are the tokens
described in GDB/MI Command Syntax” (page 306). Notice how GDB/MI returns the
same tokens in its output.
211-data-evaluate-expression A
211^done,value="1"
21.6 GDB/MI Data manipulation 321