Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.buildout
Commits
c8fb8711
Commit
c8fb8711
authored
Feb 15, 2018
by
André Anjos
💬
Browse files
Merge branch 'lldb' into 'master'
Implement C/C++ debugging with lldb See merge request
!26
parents
39189967
b6678cdc
Pipeline
#16680
passed with stages
in 4 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/buildout/
g
dbpy.py
→
bob/buildout/dbpy.py
View file @
c8fb8711
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.
dos.
anjos@
gmail.com
>
#
Mon
4
Feb 1
4:1
2:2
4
201
3
# Andre Anjos <andre.anjos@
idiap.ch
>
#
Wed
7
Feb 1
2:0
2:2
2
201
8 CET
"""Builds a custom python script interpreter that is executed inside gdb
"""Builds a custom python script interpreter that is executed inside gdb
/lldb
"""
import
platform
from
.python
import
Recipe
as
Script
# Python interpreter script template
class
Recipe
(
Script
):
"""Just creates a gdb executable running a python interpreter with the
"""Just creates a gdb
/lldb
executable running a python interpreter with the
"correct" paths
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
# Preprocess some variables
self
.
interpreter
=
options
.
setdefault
(
'interpreter'
,
'gdb-python'
)
if
platform
.
system
()
!=
'Darwin'
:
self
.
interpreter
=
options
.
setdefault
(
'interpreter'
,
'gdb-python'
)
else
:
self
.
interpreter
=
options
.
setdefault
(
'interpreter'
,
'lldb-python'
)
# initializes the script infrastructure
super
(
Recipe
,
self
).
__init__
(
buildout
,
name
,
options
)
self
.
set_template
(
"""#!%(interpreter)s
if
platform
.
system
()
!=
'Darwin'
:
self
.
set_template
(
"""#!%(interpreter)s
# %(date)s
'''Dummy program - only starts a new one with a proper environment'''
...
...
@@ -35,8 +39,27 @@ os.environ["PYTHONPATH"] = os.environ["PYTHONPATH"].strip(os.pathsep)
import sys
if sys.argv[1] in ('-?', '-h', '--help'):
os.execvp(
"
gdb
"
, sys.argv)
os.execvp(
'
gdb
'
, sys.argv)
else:
args = [sys.argv[0], "--ex", "r", "--args", "%(interpreter)s"] + sys.argv[1:]
os.execvp("gdb", args)
args = [sys.argv[0], 'gdb', '--args', "%(interpreter)s"] + sys.argv[1:]
os.execvp('gdb', args)
"""
)
else
:
self
.
set_template
(
"""#!%(interpreter)s
# %(date)s
'''Dummy program - only starts a new one with a proper environment'''
import os
existing = os.environ.get("PYTHONPATH", "")
os.environ["PYTHONPATH"] = "%(paths)s" + os.pathsep + existing
os.environ["PYTHONPATH"] = os.environ["PYTHONPATH"].strip(os.pathsep)
import sys
if sys.argv[1] in ('-?', '-h', '--help'):
os.execvp('lldb', sys.argv)
else:
args = [sys.argv[0], 'lldb', '--', "%(interpreter)s"] + sys.argv[1:]
os.execvp('lldb', args)
"""
)
bob/buildout/scripts.py
View file @
c8fb8711
...
...
@@ -14,7 +14,7 @@ import zc.buildout
from
.
import
tools
from
.script
import
Recipe
as
Script
from
.python
import
Recipe
as
PythonInterpreter
from
.
g
dbpy
import
Recipe
as
Gdb
PythonInterpreter
from
.dbpy
import
Recipe
as
Debugger
PythonInterpreter
from
.envwrapper
import
EnvironmentWrapper
def
version_is_lessthan
(
name
,
version
):
...
...
@@ -228,7 +228,8 @@ class Recipe(object):
self
.
python
=
PythonInterpreter
(
buildout
,
'Python'
,
options
.
copy
())
#self.ipython = IPythonInterpreter(buildout, 'IPython', options.copy())
self
.
gdbpy
=
GdbPythonInterpreter
(
buildout
,
'GdbPython'
,
options
.
copy
())
self
.
dbpy
=
DebuggerPythonInterpreter
(
buildout
,
'DebugPython'
,
options
.
copy
())
self
.
scripts
=
UserScripts
(
buildout
,
'Scripts'
,
options
.
copy
())
self
.
nose
=
NoseTests
(
buildout
,
'Nose'
,
options
.
copy
())
self
.
coverage
=
Coverage
(
buildout
,
'Coverage'
,
options
.
copy
())
...
...
@@ -238,7 +239,7 @@ class Recipe(object):
with
self
.
envwrapper
as
ew
:
return
\
self
.
python
.
install_on_wrapped_env
()
+
\
self
.
g
dbpy
.
install_on_wrapped_env
()
+
\
self
.
dbpy
.
install_on_wrapped_env
()
+
\
self
.
scripts
.
install_on_wrapped_env
()
+
\
self
.
nose
.
install_on_wrapped_env
()
+
\
self
.
coverage
.
install_on_wrapped_env
()
+
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment