-
Notifications
You must be signed in to change notification settings - Fork 0
/
janitor.gdb
35 lines (30 loc) · 872 Bytes
/
janitor.gdb
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
if ! $janitor_alias_set
alias jau = janitor disassemble
alias jad = janitor dump
alias jar = info janitor registers
alias jaf = info janitor cpu-flags
alias jas = janitor raw-stack
set $janitor_alias_set = 1
end
define i8086
set arch i8086
set disassembly-flavor intel
set janitor i8086 on
set janitor word-width 2
end
define i386
set arch i386
set disassembly-flavor intel
set janitor i8086 off
set janitor word-width 4
end
set janitor registers-save on
set janitor registers-on-stop on
set janitor disassemble-next-instr on
# python3 will moan if we compare ${fn} None to number
# show: thread number, frame number (if not top frame) and pc (cs:ip on i8086)
set janitor prompt \
${?${tn}:${[33}*${tn}${[} }\
${?${fn} and ${fn}>0:\#${fn} }\
${?${f}:${[36}${?${p:arch}=="i8086":${r:cs|%04X}\:${f:pc|%04X}:${f:pc|%08X}}:\
${[33}gdb}${[}->