224
26.9.1.2. Result
The output for each instruction is composed of four fields:
Address
•
Func-name
•
Offset
•
Instruction
•
Note that whatever included in the instruction field, is not manipulated directely by gdb/mi, that is, it
is not possible to adjust its format.
26.9.1.3. gdb Command
There's no direct mapping from this command to the CLI.
26.9.1.4. Example
Disassemble from the current value of
(gdb)
-data-disassemble -s $pc -e "$pc + 20" -- 0
^done,
asm_insns=[
{address="0x000107c0",func-name="main",offset="4",
inst="mov
2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi
%hi(0x11800), %o2"},
{address="0x000107c8",func-name="main",offset="12",
inst="or
%o2, 0x140, %o1\t! 0x11940
{address="0x000107cc",func-name="main",offset="16",
inst="sethi
%hi(0x11800), %o2"},
{address="0x000107d0",func-name="main",offset="20",
inst="or
%o2, 0x168, %o4\t! 0x11968
(gdb)
Disassemble the whole
-data-disassemble -f basics.c -l 32 -- 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"},
[...]
{address="0x0001081c",func-name="main",offset="96",inst="ret "},
{address="0x00010820",func-name="main",offset="100",inst="restore "}]
(gdb)
Disassemble 3 instructions from the start of
to
$pc
function. Line 32 is part of
main
main
Chapter 26. The gdb/mi Interface
:
$pc + 20
_lib_version+8 "},
_lib_version+48 "}]
.
main
:
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - DEBUGGING WITH GDB and is the answer not in the manual?
Questions and answers