-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgdbout_prep.py
More file actions
20 lines (17 loc) · 847 Bytes
/
Copy pathgdbout_prep.py
File metadata and controls
20 lines (17 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python
import sys, os, re
for o in sys.stdin:
if not o.startswith('(gdb) '):
cdir = os.path.dirname(os.path.realpath(__file__))
o = re.sub(r'(=.*) 0x[0-9a-f]+', r'\1 0xXXXXX', o)
o = re.sub(r'Temporary breakpoint 1 at .*\n', '', o)
o = re.sub(r'Breakpoint [0-9]+ at 0x[0-9a-f]+:', 'Breakpoint:', o)
o = re.sub(r'Breakpoint [0-9]+, main \(argc=1, argv=0x[0-9a-f]+\) at', 'Breakpoint 1, main at', o)
o = re.sub(r'[0-9]+[ \t]+return 0;', '', o)
o = re.sub(r'0x[0-9a-f]*[1-9a-f]+[0-9a-f]*', '0xHEX', o)
o = re.sub(r'std::__cxx11::', 'std::', o)
o = re.sub(r'capacity:\d+ ', 'capacity:N ', o)
o = re.sub(r'(\d+)ul>', r'\1>', o)
o = re.sub(r'std::__shared_ptr<int, \.\.>::element_type', 'int', o)
o = re.sub(cdir, '', o)
sys.stdout.write(o)