forked from vadimcn/codelldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_debuggee.py
executable file
·34 lines (27 loc) · 986 Bytes
/
build_debuggee.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
#!/usr/bin/python
import subprocess as sp
import os
import sys
try:
os.makedirs('out/debuggee')
except Exception:
pass
if sys.platform == 'win32':
dll = '.dll'
dll_flags = []
exe_flags = []
else:
dll = '.so'
dll_flags = ['-fPIC']
exe_flags = ['-ldl']
try:
# Make a shared library
sp.check_call(['c++', 'debuggee/cpp/libdebuggee/libmain.cpp', '-std=c++11', '-shared',
'-g', '-o', 'out/debuggee/libdebuggee' + dll] + dll_flags)
# Compile without debug info
sp.check_call(['c++', '-c', 'debuggee/cpp/no_line_info.cpp', '-std=c++11', '-o', 'out/debuggee/no_line_info.o'])
# Intentionally use unnormalized path to source, so we can test breakpoint location filtering.
sp.check_call(['c++', 'debuggee/cpp/../cpp/./debuggee.cpp', 'out/debuggee/no_line_info.o',
'-pthread', '-std=c++11', '-g', '-o', 'out/debuggee/debuggee'] + exe_flags)
except sp.CalledProcessError as e:
print(e.output)