Add support for selecting alternate JDWP implementations

Change JDWP options parsing to take place later and add a
-XjdwpProvider:_ option that can be used by the runtime to select an
appropriate JDWP provider. The argument is a string.

If 'none' is given JDWP will be totally disabled.

If 'internal' is given the current internal JDWP implementation is
used.

If 'default' is given the 'internal' JDWP implementation will
currently be used.

Other values will be added in the future.

Also adds a runtime callback that will be invoked when the runtime
wants to start or stop the debugger (namely at the post-zygote fork
and just before exit) and check if a debugger is availible.

Also add '-XjdwpOptions:_' in preparation for the eventual removal of
the existing -Xrunjdwp=_ and -Xagentlib:jdwp=_ as top-level options.
All of these options now store their arguments as a std::string to be
interpreted by the JDWP implementation as it sees fit. Also change the
jdwpOptions to default to transport=dt_android_adb if there is not one
specified and it is available. This will make changing the default
transport based on the JDWP provider easier.

These new options are needed to allow us to support both the old,
internal, JDWP implementation as its replacement is tested and
verified. This lets us switch between them with little difficulty.

We will probably remove one or both of these options once we have
confidence that the new jdwp implementation has stuck.

Test: ./test.py --host -j50
Test: ./test/run-test --host --debug 001-HelloWorld
Test: Manual, flash walleye, debug app

Bug: 62821960

Change-Id: Ie31db6b6f7d76a03d4ab8e178fcf298ed0eec203
diff --git a/runtime/jdwp_provider.h b/runtime/jdwp_provider.h
new file mode 100644
index 0000000..849ba21
--- /dev/null
+++ b/runtime/jdwp_provider.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_JDWP_PROVIDER_H_
+#define ART_RUNTIME_JDWP_PROVIDER_H_
+
+#include <ios>
+
+#include "base/macros.h"
+#include "base/logging.h"
+
+namespace art {
+
+enum class JdwpProvider {
+  kNone,
+  kInternal,
+};
+
+std::ostream& operator<<(std::ostream& os, const JdwpProvider& rhs);
+
+}  // namespace art
+#endif  // ART_RUNTIME_JDWP_PROVIDER_H_