-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_gdbinit.py
executable file
·31 lines (24 loc) · 1.08 KB
/
install_gdbinit.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
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import os
import shutil
import sys
from install_lib import *
def install_gdbinit():
environ = get_environ()
# ####################################################################################################
# Generate a gdbinit file that sources the config ones
# ####################################################################################################
GDBINIT_FILE_NAME = os.path.expanduser("~/.gdbinit")
gdbinit_config = os.path.join(environ["KONIX_CONFIG_DIR"],
"gdbinit").replace(" ", r"\ ")
gdbinit_stl_views = os.path.join(environ["KONIX_CONFIG_DIR"],
"stl-views.gdb").replace(" ", r"\ ")
if os.path.exists(GDBINIT_FILE_NAME):
os.remove(GDBINIT_FILE_NAME)
with open(GDBINIT_FILE_NAME, "w") as gdbinitfile:
gdbinitfile.write('source %s\nsource %s\n' %
(gdbinit_stl_views, gdbinit_config))
print("Successful installed gdbinit config")
if __name__ == '__main__':
install_gdbinit()