Mercurial > hg > truffle
comparison mx/commands.py @ 5875:000fb0550afe
Add an option to launch the vm from a debugger in mx's commands
Differentiate between, 32 and 64 bits BSR
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 25 Jul 2012 13:06:52 +0200 |
parents | 576460f7e740 |
children | 0e54d9bb922d |
comparison
equal
deleted
inserted
replaced
5874:f0d4304243ff | 5875:000fb0550afe |
---|---|
46 """ The VM build that will be run by the 'vm' command: product(default), fastdebug or debug. | 46 """ The VM build that will be run by the 'vm' command: product(default), fastdebug or debug. |
47 This can be set via the global '--fastdebug' and '--debug' options. """ | 47 This can be set via the global '--fastdebug' and '--debug' options. """ |
48 _vmbuild = 'product' | 48 _vmbuild = 'product' |
49 | 49 |
50 _jacoco = 'off' | 50 _jacoco = 'off' |
51 | |
52 _native_dbg = None | |
51 | 53 |
52 _make_eclipse_launch = False | 54 _make_eclipse_launch = False |
53 | 55 |
54 _copyrightTemplate = """/* | 56 _copyrightTemplate = """/* |
55 * Copyright (c) {0}, Oracle and/or its affiliates. All rights reserved. | 57 * Copyright (c) {0}, Oracle and/or its affiliates. All rights reserved. |
586 'includes' : 'com.oracle.*', | 588 'includes' : 'com.oracle.*', |
587 'excludes' : ':'.join(excludes) | 589 'excludes' : ':'.join(excludes) |
588 } | 590 } |
589 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args | 591 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args |
590 exe = join(jdk, 'bin', mx.exe_suffix('java')) | 592 exe = join(jdk, 'bin', mx.exe_suffix('java')) |
591 return mx.run([exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) | 593 dbg = _native_dbg.split() if _native_dbg is not None else [] |
594 return mx.run(dbg + [exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) | |
592 | 595 |
593 def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): | 596 def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): |
594 """ | 597 """ |
595 Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' | 598 Scan the sources of project 'p' for Java source files containing a line starting with 'annotation' |
596 (ignoring preceding whitespace) and return the fully qualified class name for each Java | 599 (ignoring preceding whitespace) and return the fully qualified class name for each Java |
1004 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)') | 1007 mx.add_argument('--vm', action='store', dest='vm', default='graal', choices=['graal', 'server', 'client'], help='the VM to build/run (default: graal)') |
1005 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM') | 1008 mx.add_argument('--product', action='store_const', dest='vmbuild', const='product', help='select the product build of the VM') |
1006 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM') | 1009 mx.add_argument('--debug', action='store_const', dest='vmbuild', const='debug', help='select the debug build of the VM') |
1007 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug build of the VM') | 1010 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug build of the VM') |
1008 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') | 1011 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') |
1012 mx.add_argument('--native-dbg', action='store', dest='native_dbg', help='Start the vm inside a debugger', metavar='<debugger>') | |
1013 mx.add_argument('--gdb', action='store_const', const='/usr/bin/gdb --args', dest='native_dbg', help='alias for --native-dbg /usr/bin/gdb -- args') | |
1014 | |
1009 | 1015 |
1010 commands.update({ | 1016 commands.update({ |
1011 'export': [export, '[-options] [zipfile]'], | 1017 'export': [export, '[-options] [zipfile]'], |
1012 'build': [build, '[-options] [product|debug|fastdebug]...'] | 1018 'build': [build, '[-options] [product|debug|fastdebug]...'] |
1013 }) | 1019 }) |
1032 _vmbuild = opts.vmbuild | 1038 _vmbuild = opts.vmbuild |
1033 global _make_eclipse_launch | 1039 global _make_eclipse_launch |
1034 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) | 1040 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) |
1035 global _jacoco | 1041 global _jacoco |
1036 _jacoco = opts.jacoco | 1042 _jacoco = opts.jacoco |
1043 global _native_dbg | |
1044 _native_dbg = opts.native_dbg |