|
@@ -145,6 +145,7 @@ static bool auto_quit = false;
|
|
|
static OS::ProcessID allow_focus_steal_pid = 0;
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
static bool auto_build_solutions = false;
|
|
|
+static String debug_server_uri;
|
|
|
#endif
|
|
|
|
|
|
// Display
|
|
@@ -286,6 +287,7 @@ void Main::print_help(const char *p_binary) {
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
OS::get_singleton()->print(" -e, --editor Start the editor instead of running the scene.\n");
|
|
|
OS::get_singleton()->print(" -p, --project-manager Start the project manager, even if a project is auto-detected.\n");
|
|
|
+ OS::get_singleton()->print(" --debug-server <uri> Start the editor debug server (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007)\n");
|
|
|
#endif
|
|
|
OS::get_singleton()->print(" -q, --quit Quit after the first iteration.\n");
|
|
|
OS::get_singleton()->print(" -l, --language <locale> Use a specific locale (<locale> being a two-letter code).\n");
|
|
@@ -875,6 +877,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|
|
} else if (I->get() == "-p" || I->get() == "--project-manager") { // starts project manager
|
|
|
|
|
|
project_manager = true;
|
|
|
+ } else if (I->get() == "--debug-server") {
|
|
|
+ if (I->next()) {
|
|
|
+ debug_server_uri = I->next()->get();
|
|
|
+ if (debug_server_uri.find("://") == -1) { // wrong address
|
|
|
+ OS::get_singleton()->print("Invalid debug server uri. It should be of the form <protocol>://<bind_address>:<port>.\n");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
+ N = I->next()->next();
|
|
|
+ } else {
|
|
|
+ OS::get_singleton()->print("Missing remote debug server uri, aborting.\n");
|
|
|
+ goto error;
|
|
|
+ }
|
|
|
} else if (I->get() == "--build-solutions") { // Build the scripting solution such C#
|
|
|
|
|
|
auto_build_solutions = true;
|
|
@@ -2347,6 +2361,9 @@ bool Main::start() {
|
|
|
}
|
|
|
}
|
|
|
DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_EDITOR);
|
|
|
+ if (!debug_server_uri.is_empty()) {
|
|
|
+ EditorDebuggerNode::get_singleton()->start(debug_server_uri);
|
|
|
+ }
|
|
|
}
|
|
|
#endif
|
|
|
if (!editor) {
|