summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2012-03-19 08:29:28 +0100
committerDieter Verfaillie <dieterv@optionexplicit.be>2015-06-29 16:54:29 +0200
commitaf97f472b16ceef6c33b8fd6b9f36eef0e60c7cb (patch)
treeaffe66aba4d95112aebbc8ad3b0b2ecbb3ab1665 /tools
parentfb9dd21303254c01a0b150f02b17697d53b43669 (diff)
downloadgobject-introspection-af97f472b16ceef6c33b8fd6b9f36eef0e60c7cb.tar.gz
tools: add support for PyDev remote debugger.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/g-ir-annotation-tool.in21
-rw-r--r--tools/g-ir-doc-tool.in21
-rwxr-xr-xtools/g-ir-scanner.in21
3 files changed, 45 insertions, 18 deletions
diff --git a/tools/g-ir-annotation-tool.in b/tools/g-ir-annotation-tool.in
index 811e9153..cf17a235 100755
--- a/tools/g-ir-annotation-tool.in
+++ b/tools/g-ir-annotation-tool.in
@@ -24,12 +24,21 @@ import sys
import __builtin__
-if 'GI_SCANNER_DEBUG' in os.environ:
- def on_exception(exctype, value, tb):
- print "Caught exception: %r %r" % (exctype, value)
- import pdb
- pdb.pm()
- sys.excepthook = on_exception
+debug = os.getenv('GI_SCANNER_DEBUG', '').split(',')
+if debug:
+ if 'pydevd' in debug:
+ # http://pydev.org/manual_adv_remote_debugger.html
+ pydevdpath = os.getenv('PYDEVDPATH', None)
+ if pydevdpath is not None and os.path.isdir(pydevdpath):
+ sys.path.insert(0, pydevdpath)
+ import pydevd
+ pydevd.settrace()
+ else:
+ def on_exception(exctype, value, tb):
+ print "Caught exception: %r %r" % (exctype, value)
+ import pdb
+ pdb.pm()
+ sys.excepthook = on_exception
if os.name == 'nt':
datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
diff --git a/tools/g-ir-doc-tool.in b/tools/g-ir-doc-tool.in
index db389ba9..e3bf8a34 100644
--- a/tools/g-ir-doc-tool.in
+++ b/tools/g-ir-doc-tool.in
@@ -24,12 +24,21 @@ import sys
import __builtin__
-if 'GI_SCANNER_DEBUG' in os.environ:
- def on_exception(exctype, value, tb):
- print "Caught exception: %r %r" % (exctype, value)
- import pdb
- pdb.pm()
- sys.excepthook = on_exception
+debug = os.getenv('GI_SCANNER_DEBUG', '').split(',')
+if debug:
+ if 'pydevd' in debug:
+ # http://pydev.org/manual_adv_remote_debugger.html
+ pydevdpath = os.getenv('PYDEVDPATH', None)
+ if pydevdpath is not None and os.path.isdir(pydevdpath):
+ sys.path.insert(0, pydevdpath)
+ import pydevd
+ pydevd.settrace()
+ else:
+ def on_exception(exctype, value, tb):
+ print "Caught exception: %r %r" % (exctype, value)
+ import pdb
+ pdb.pm()
+ sys.excepthook = on_exception
if os.name == 'nt':
datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
diff --git a/tools/g-ir-scanner.in b/tools/g-ir-scanner.in
index 420d435b..7b2c5687 100755
--- a/tools/g-ir-scanner.in
+++ b/tools/g-ir-scanner.in
@@ -24,12 +24,21 @@ import sys
import __builtin__
-if 'GI_SCANNER_DEBUG' in os.environ:
- def on_exception(exctype, value, tb):
- print "Caught exception: %r %r" % (exctype, value)
- import pdb
- pdb.pm()
- sys.excepthook = on_exception
+debug = os.getenv('GI_SCANNER_DEBUG', '').split(',')
+if debug:
+ if 'pydevd' in debug:
+ # http://pydev.org/manual_adv_remote_debugger.html
+ pydevdpath = os.getenv('PYDEVDPATH', None)
+ if pydevdpath is not None and os.path.isdir(pydevdpath):
+ sys.path.insert(0, pydevdpath)
+ import pydevd
+ pydevd.settrace()
+ else:
+ def on_exception(exctype, value, tb):
+ print "Caught exception: %r %r" % (exctype, value)
+ import pdb
+ pdb.pm()
+ sys.excepthook = on_exception
if os.name == 'nt':
datadir = os.path.join(os.path.dirname(__file__), '..', 'share')