1
Stopping an application
2
-----------------------
4
* WatchPoints - expression value changes
5
* CatchPoints - C++ try/catch/
6
* Signals - Stop/Print/Pass
10
cont(c) [count] - Continue execution (count specifies number of
11
times (+1 - current) to skip breakpoint on
14
jump <linespec|*addr> - Continue execution in the specified place
15
return [expr] - cancels execution of current function,
16
returning specified expression.
18
next(n) [count] - step over
19
step(s) [count] - step into ('count' times)
20
set step-mode on/off - 'off' (default) steps over a functions
21
containing no debug information
23
stepi(si) [count] - executes one machine instruction
24
nexti(ni) [count] - steps over function calls
27
finish - continue until current function returns, outputs
29
advance [loc] - Continue running the program up to the given location
30
or 'finish' ('loc' in break format)
31
until [loc] - continue running until specified location (next line
32
if omited) or 'finish' (used to avoid single stepping
33
a loop more than once).
35
* For breaking executing application from keyboard, see signals.
39
info break/watch - Lists breakpoints/...
41
clear - deletes breakpoints at the next instruction
44
delete [breakpoints] <range>
45
- Deletes breakpoints with specified IDs, example:
46
delete (delete all breakpoints), delete 3, delete 1-5
48
disable [breakpoints] <range>
49
enable [breakpoints] <range>
50
enable [breakpoints] once <range>
51
enable [breakpoints] detele <range> - works once, then deleted
55
break randomRun - break on function call
56
+ Doesn't work with inline functions
57
+ Could be set prior the function is loaded from shared library (plugin)
58
+ Breakpoints should be set prior to program enter block
59
break function(types) - to handle C++ overloaded functions.
60
+ If omited, it is possible to break on whole family.
61
break mrandom.c:235 - break on line number
62
break *address - the command at specified address is executed
64
break ... if <cond> - breaks only if 'cond'ition evaluates true
66
tbreak ... - Temporary. triggers once (then deleted)
67
hbreak ... - Hardware assisted (EPROM/ROM debugging)
68
thbreak ... - Temporary Hardware
70
rbreak <regex> - Set breakpoints on all functions matching regex.
74
watch <expr> - Breaks when epxression is written into by the program
75
and its value is changed (see expecting variables).
76
+ If program left the block where the expression is valid, watchpoint
77
removed (for example 'local variable' expressions on return statement).
78
rwatch <expr> - Breaks when expression is read by program
79
awatch <expr> - Access = Read-or-Write
81
- GDB will not trigger if the expression modified from another thread.
82
- GDB uses hardware for read watch points. Depending on architecture there
83
are certain limitations:
84
+ Hardware watchpoints are not working due to the GCC Optimizations
85
+ Hardware watchpoints are not supported.
86
+ On the size of types for which hardware watchpoitns can be set.
87
+ On the amount of hardware watchpoints.
92
throw - Throwing of a C++ exception
93
catch - Catching C++ exception
96
- To stop just before an exception handler is called, the knowledge of the
97
implementation is required. In the case of GNU C++, exceptions are raised
98
by 'void __raise_exception(void **addr, void *id)'
99
addr - is where the exception identifier is stored
100
id - is the exception identifier
101
With a conditional breakpoint that depends on the value of id, it is
102
possible to stop program when a specific exception is raised.