-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdb_breakpoints.py
54 lines (45 loc) · 916 Bytes
/
gdb_breakpoints.py
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
#!/usr/bin/env python3
from gdb_main import *
'''
continue and return context
'''
def cont() -> str:
return exc('c')
'''
break at given symbol
'''
def bs(symbol: str) -> None:
exc(f'b {symbol}')
'''
break at given address
'''
def ba(addr: int) -> None:
exc(f'b *{addr}')
'''
hardware breakpoint at given address
'''
def hba(addr: int) -> None:
exc(f'hb *{addr}')
'''
temporary breakpoint at given address
'''
def tb(addr: int) -> None:
exc(f'tbreak *{addr}')
'''
temporary breakpoint at given address and continue
-> useful to set up mutliple bp and comment the useless ones
'''
def tbc(addr: int) -> None:
tb(addr)
cont()
'''
pie breakpoint at given offset from base address
'''
def pba(offset: int) -> None:
exc(f'pie breakpoint *{hex(offset)}')
'''
pie breakpoint at given offset from base address and continue
'''
def pbc(offset: int) -> None:
pba(offset)
cont()