-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdebug
57 lines (43 loc) · 1.37 KB
/
debug
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
file ./build/librcd.self-test
echo Welcome to librcd debugging mode!\n
# Enables GDB to detect threads as they are started.
break lwt_physical_executor_thread if 0
# We use SIGUSR1 to detect new threads.
handle SIGUSR1 nostop print pass
# Realtime signal 33 is used for canceling threads - don't catch it.
handle SIG33 nostop noprint pass
# Stop if the application throws SIGABRT (e.g. in abort())
handle SIGABRT stop print nopass
# Following the __releasestack logic when stepping out of a function is rarely interesting. This quickly skips over that part.
define bs
tbreak setjmp.s:113
commands
silent
step
end
cont
end
# Replacement for printing backtraces in segmented stack contexts as gdb does not understand those at all.
define bt
echo
set $_backtrace_rbp = $rbp
call lwt_debug_dump_backtrace($_backtrace_rbp, $rip)
end
# Shorter command for dumping all fibers.
define bf
echo
call lwt_debug_dump_all_fibers()
end
# Break on assert failure.
break __assert_fail
# For disabling parallelism:
## break __lwthreads_main
## commands
## silent
## call lwt_debug_choke_fibers(1)
## printf "NOTICE: Choking all but a single thread to not confuse gdb. To enable multi threaded execution, enter: call lwt_debug_choke_fibers(0)\n"
## cont
## end
###### ADDITIONAL DEBUG COMMANDS START ######
###### ADDITIONAL DEBUG COMMANDS STOP ######
run