-
Notifications
You must be signed in to change notification settings - Fork 1
/
dotgdbinit
75 lines (62 loc) · 1.27 KB
/
dotgdbinit
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# -*- mode: gdb-script; -*-
#
# My .gdbinit
#
# Always have history
set history filename ~/.gdb_history
set history save on
set history expansion on
set history size 1000
# I have tmux to deal with pagination
set pagination off
# enable debug symbol server
set debuginfod enabled on
# disable some signal handlers I hit a lot in QEMU
handle SIGUSR1 nostop noprint
#
# A simple instruction stepping macro that steps and then dumps the
# next few instructions
#
define i
si
x/3i $pc
end
#
# Alias for register information
#
define regs
info registers
end
#
# Mono Debugger Helpers
#
define mono_backtrace
select-frame 0
set $i = 0
while ($i < $arg0)
# set $foo = mono_pmip ($pc)
set $foo = print_method_from_ip ($pc)
if ($foo == 0x00)
frame
else
printf "#%d %p in %s\n", $i, $pc, $foo
end
up-silently
set $i = $i + 1
end
end
define mono_stack
set $mono_thread = mono_thread_current ()
if ($mono_thread == 0x00)
printf "No mono thread associated with this thread\n"
else
set $ucp = malloc (sizeof (ucontext_t))
call (void) getcontext ($ucp)
call (void) mono_print_thread_dump ($ucp)
call (void) free ($ucp)
end
end
# Enable auto-loading for work stuff
set auto-load safe-path /usr/share/gdb:~/lsrc
echo Executed .gdbinit
echo \n