summaryrefslogtreecommitdiff
path: root/tools/g-ir-scanner.in
diff options
context:
space:
mode:
Diffstat (limited to 'tools/g-ir-scanner.in')
-rwxr-xr-xtools/g-ir-scanner.in21
1 files changed, 15 insertions, 6 deletions
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')