-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gdbinit
136 lines (109 loc) · 2.34 KB
/
.gdbinit
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
set disassembly-flavor intel
set disassembler-options priv-spec=1.12
set print asm-demangle on
set print pretty on
set print array on
set print symbol on
set tui active-border-mode normal
set tui compact-source on
set max-value-size unlimited
set pagination off
set confirm off
set disassemble-next-line on
set step-mode on
define regs
info registers
info registers mscratch
info registers sscratch
info registers mtvec
info registers stvec
info registers mepc
info registers sepc
info registers mtval
info registers stval
info registers mcause
info registers scause
info registers satp
info registers mhartid
info registers mstatus
info registers priv
end
document regs
Print relevant RISC-V registers and CSR's
end
define qa
kill
exit
end
document qa
Kill the attached process and exit gdb
end
# Comparing definition arguments as strings unfortunately doesnt work on platforms without `malloc`.
# We have to work around this by defining multiple functions, really just as verbose as it gets :/
define physmem
if $argc != 0
help physmem
return
end
echo 0 = virtual, 1 = physical\n\n
maintenance packet qqemu.PhyMemMode
end
document physmem
Print the memory protection mode, where 1 is physical and 0 is virtual.
end
define physmem_on
if $argc != 0
help physmem_on
return
end
maintenance packet Qqemu.PhyMemMode:1
end
document physmem_on
Turn on memory protection.
end
define physmem_off
if $argc != 0
help physmem_off
return
end
maintenance packet Qqemu.PhyMemMode:0
end
document physmem_on
Turn off memory protection.
end
define sstep
if $argc != 0
help sstep
return
end
maintenance packet qqemu.sstepbits
echo \n
maintenance packet qqemu.sstep
end
document sstep
Print the single-step behaviour bits.
end
define sstep_set
if $argc != 1
help sstep_set
return
end
maintenance packet Qqemu.sstep=$arg0
end
document sstep_set
Set the single-step behaviour bits.
end
tui new-layout full {-horizontal asm 1 src 1} 2 status 0 cmd 1
tui new-layout asm {-horizontal asm 1 regs 1} 2 status 0 cmd 1
define lfull
layout full
end
define lempty
tui disable
end
define lsrc
layout src
end
define lasm
layout asm
end