From 31595a3e1c090e304f386d3a2a1571e0222284b8 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 13 Mar 2019 12:54:57 -0700 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Cfull-dart-debug=E2=80=9D=20that?= =?UTF-8?q?=20disabled=20optimizations=20in=20the=20Dart=20VM.=20(flutter/?= =?UTF-8?q?engine#8147)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/src/flutter/tools/gn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index ee784e5300..16bdcf034b 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -139,6 +139,10 @@ def to_gn_args(args): if args.dart_debug: gn_args['dart_debug'] = True + if args.full_dart_debug: + gn_args['dart_debug'] = True + gn_args['dart_debug_optimization_level'] = '0' + if args.target_os == 'android': gn_args['target_cpu'] = args.android_cpu elif args.target_os == 'ios': @@ -247,7 +251,10 @@ def parse_args(args): parser.add_argument('--runtime-mode', type=str, choices=['debug', 'profile', 'release'], default='debug') parser.add_argument('--dynamic', default=False, action='store_true') parser.add_argument('--interpreter', default=False, action='store_true') - parser.add_argument('--dart-debug', default=False, action='store_true') + parser.add_argument('--dart-debug', default=False, action='store_true', help='Enables assertsion in the Dart VM. ' + + 'Does not affect affect optimization levels. If you need to disable optimizations in Dart, use --full-dart-debug') + parser.add_argument('--full-dart-debug', default=False, action='store_true', help='Implies --dart-debug ' + + 'and also disables optimizations in the Dart VM making it easier to step through VM code in the debugger.') parser.add_argument('--target-os', type=str, choices=['android', 'ios', 'linux']) parser.add_argument('--android', dest='target_os', action='store_const', const='android')