3
bt [count] - backtrace (count limits the depth of backtrace)
4
+ printed 'addr' is program counter (pc), not frame
7
info program - Current status and position
8
+ info line *addr - to get line number
9
info frame [#num|addr] - various information on current or selected stack
12
frame(f) <#num> - set current stack fram (doesn't adjust execution
13
position just allows to examine variables, etc.)
14
frame(f) <addr> - select frame at address 'addr'
15
select-frame ... - do it silently (do not print anything)
16
up/down [count] - move up-and-down trough the stack
17
*-silently - do it silently
22
Normally located automatically if '-g' is used
23
dir dirname - Set additional directory to look for sources
26
info sources - Information about known sources
27
info source - Information about current source
28
info functions [regexp] - List all functions matching regexp (by source)
29
info variables [regexp] - List all global variables (by source)
33
list mrandom.c:randomRun
34
list *address - Show function at that address
35
list -/+ - List lines before/after last printed
36
set listsize ### - Number of lines to display
39
search regexp / reverse-search regexp
42
info line <linespec> - Show information (address, etc)
43
info line *addr - Show begining/end address of corespondent code
44
disasm from_add to_addr - Without asterix
46
set disassembly-flavor intel|att - Set assembler syntax
50
* These functions by default are working with currnet stack frame (see section
51
'Navigating Stack' for details.
53
* p 'mrandom.c'::randomRun::ctx - quotes are mandatory
54
+ ::ctx->ictx_complex - works
55
+ 'mrandom.c'::randomRun - address of a function
57
p {type} ptr - Shows value referenced by stored
58
p *ptr@5 - Shows array of 5 elements by addr 5
59
p/# ... - # is number format
60
x (hex), d (dec), u(unsigned), o(oct), t(bin), a(addr), c(char), f(fp)
63
Info on Variables and Types
64
---------------------------
65
whatis [expr] - Outputs type of expression, if 'expr'
66
omitted - last evaluated expression
67
ptype [typename|expr] - Info's on struct, union, enum, class
69
info locals - Print all local variables
70
info args - Print all function arguments
71
info catch - Print all active exception handlers
73
info types [regexp] - Prints all types matching regexp
74
info scope [*addr|func|code-line] - List variables local to paticular
80
p i = 4 - Setting new value to variable 'i'
81
set var i = 4 - Silently set new value of variable
82
+ 'var' could be omited if 'i' is not special
83
command of gdb 'set' statement
86
- It is theoretically possible to call functions from gdb, but this seems
87
doesn't work if gdb is attached to process (threading, or something other
88
also could be a reson, I'm not sure really)
90
p i = fabs(j) - Allowable
91
call fabs(j) - Do not inform about 'void' results
95
set $i = 0 - do not mix with registers, check prior to assignment
101
f - format ( s(str), i(machine instruction), x(hex), ...)
102
u - unit size (b - bytes, h - half word (2bytes), w - word, g - double word)
107
info all-registers - Includes FP registers
108
info registers rax - Shows 'rax' register only
109
p/x $rax - Also show register
110
set $rax += 4 - Adjusting values
112
info float - FP hardware info
113
info vector - Vector Unit Info
117
* Sources should be compiled with gcc4 and flags:
119
* Constructs like ('##', variable arity, ...) are not supported
120
* Do not work for complex cases for me
128
Memory region attributes allow you to describe special handling required by
129
regions of your target's memory. GDB uses attributes to determine whether to
130
allow certain types of memory accesses; whether to use specific width accesses,
131
and whether to cache target memory.
133
mem lower upper attributes
134
delete/disable/enable mem ###
137
* Dump memory region to file
138
dump/append [binary/ihex/srec/tekhex] [memory/value] <filename> start_addr end_addr
141
ihex - Intel hex format
143
memory - dump memory from start_addr to end_addr
144
value - instead of addresses specify expression and dump it's value