-
Notifications
You must be signed in to change notification settings - Fork 68
/
ExampleCommands.txt
57 lines (44 loc) · 1.18 KB
/
ExampleCommands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
https://lldb.llvm.org/lldb-gdb.html
1. examine registers
(gdb) info registers
(lldb) register read --all
2. examine a specific register
(gdb) print/x $eax
(lldb) register read eax
(lldb) register read --format decimal eax
3. examine memory
(gdb) x/8xw 0x80490b4
(gdb) x/8dw 0x80490b4
(lldb) x/8dw 0x2000
(lldb) memory read/4xw 0xbffff3c0
(lldb) x/4xw 0xbffff3c0
4. examine a function
(gdb) disassemble _main
(lldb) disassemble --name main
5. examine memory where a register is pointing
(gdb) x/8xw $esp
(lldb) x/8xw $esp
6. next instruction
(gdb) nexti
(lldb) nexti
7. examine a variable
(gdb) p value
(lldb) p/d value
8. examine a string (character array)
(gdb) x/14cb 0x80490a4
(lldb) memory read --size 1 --format c --count 14 0x2000
9. examine an integer array
(gdb) x/6dw 0x80490b4
(lldb) memory read --size 4 --format h --count 6 0x2014
10. examine a floating point array
(gdb) x/4f &floats
(gdb) p (double[4])vector1
(lldb) x/4f &floats
11. examine a specific element in an array
(gdb) x/f &floats+1
(lldb) x/f &floats+1
12. examine a floating point register
(gdb) print $xmm0
(gdb) p/f $xmm0.v4_float
(gdb) p/f $xmm0.v4_float[1]
(lldb) po (float __attribute__((ext_vector_type(4)))) $xmm0