3
- gdbserver localhost:port --attach <pid>
4
+ Imideatly attaches to process and stops execution
5
+ Do not need sources, debugging information, it should resist on client
11
file <executable name> - mandatory
12
target remote host:port - connecting
13
detach - disconnecting (terminates server)
14
disconnect - disconnecting (keeping server)
18
- shipped "bin/gdb" is 32bit executable and should be replaced by system
19
64bit version (otherwise complains on unreckognized executable format)
20
- Debug/Attach Debugger/Attach to Remote Process
21
+ Set appropriate executable - mandatory!!
22
+ In Remote Options set "address size" to 64 bit
27
The remote stubs allowing to compile gdbserver protocol support into the
28
existing application. The stubs are specific to architecture, stubs for
29
some architectures are shiped with gdb. Other should be implemented starting
30
from 'sparc-stub.c' as an example.
32
The following stub functions should be called from main program:
33
+ set_debug_traps - Should be called in the beginning of the program, in
34
order to arrange calling of 'handle_exception' function when the program
36
+ breakpoint - artificial breakpoint in application. May be required if there
37
no other ways of making applications stop (on certain architectures this is
38
achieved by sending character to UART which generates interruput, or by
39
special interrupt button )
41
The following functions should be implemented by application
43
+ void putDebugChar(int)
44
+ void exceptionHandler (int exception_number, void *exception_address)
45
Installs exception_address in the exception handling tables.
46
+ void flush_i_cache() [ On SPARC only ]
50
For real-time applications it is important debugging will not prevent app from
51
meeting deadlines. Using tracepoints it possible to evaluate and store
52
arbitrary expressions when those tracepoints are reached.
53
- Only supports on remote targets
54
- Not supported on x86/amd64
55
- Even not supported by any of gdb shipped stubs
60
delete / enable / disable <#tpnum>
61
passcount 5 <#tpnum> - Stop on the every 5th execution
62
actions <#tpnum> ... end
63
- collect <expr1>, <expr2>, ...
64
+ $regs [ all registers ]
65
+ $args [ all function arguments ]
66
+ $locals [ all local variables ]
67
- while-stepping #n ... end
68
Perform n single-step traces after the tracepoint, collecting new
69
data at each step. The command is followed by the list of what to
70
collect while stepping.
71
tsart / tstop / tstatus - Starting / Stopping collection
73
start - first snapshot
74
no argument - next snapshot
76
tracepoint <#tpnum> - next associated with specified tracenum
77
tfind line [file:]n - next associated with specified linespec
78
tfind pc <addr> - next taken on the specified address
79
tfind range <addr1>, <addr2> - Within range
80
tfind outside <addr1>, <addr2> - Outside of the range
81
none / end - stop tracing, resume live debugging
82
tdump - Dump found snapshot
83
save-tracepoints filename