cbuildbot: Add --debug-cidb.

Add a new command line option to force a build to use the Debug
instance of CIDB. It's intended for advanced build infrastructure
testing that could otherwise interfere with production builds.

BUG=chromium:817546
TEST=run_tests

Change-Id: I6977128010cf175841c1cbf7329841fc0d2be5aa
Reviewed-on: https://chromium-review.googlesource.com/942096
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Jacob Kopczynski <jkop@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index a8f0230..abc5076 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -477,6 +477,8 @@
                           default=False, dest='sanity_check_build',
                           api=constants.REEXEC_API_SANITY_CHECK_BUILD,
                           help='Run the build as a sanity check build.')
+  group.add_remote_option('--debug-cidb', action='store_true', default=False,
+                          help='Force Debug CIDB to be used.')
 
   parser.add_argument_group(group)
 
@@ -758,6 +760,9 @@
 
 def _GetRunEnvironment(options, build_config):
   """Determine whether this is a prod/debug/standalone run."""
+  if options.debug_cidb:
+    return _ENVIRONMENT_DEBUG
+
   # Look up the buildbot waterfall.
   wfall = os.environ.get('BUILDBOT_MASTERNAME', '')