You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[3.x] [Debugger] Add --debug-server CLI option.
Automatically starts the editor debug server at given <IP>:<PORT>. E.g.: # Run editor and debug server listening on any interface, port 8080 godot3 -e --path proj/proj_empty --debug-server *:8080 # Run the godot project connecting to that debug server. godot3 --path proj/proj_empty --remote-debug 127.0.0.1:8080
This commit is contained in:
@@ -1560,8 +1560,10 @@ void ScriptEditorDebugger::_clear_execution() {
|
||||
stack_script.unref();
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::start() {
|
||||
stop();
|
||||
void ScriptEditorDebugger::start(int p_port, const IP_Address &p_bind_address) {
|
||||
if (is_inside_tree()) {
|
||||
stop();
|
||||
}
|
||||
|
||||
if (is_visible_in_tree()) {
|
||||
EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
|
||||
@@ -1573,7 +1575,11 @@ void ScriptEditorDebugger::start() {
|
||||
}
|
||||
|
||||
const int max_tries = 6;
|
||||
remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
|
||||
if (p_port < 0) {
|
||||
remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
|
||||
} else {
|
||||
remote_port = p_port;
|
||||
}
|
||||
int current_try = 0;
|
||||
// Find first available port.
|
||||
Error err = server->listen(remote_port);
|
||||
@@ -1582,7 +1588,7 @@ void ScriptEditorDebugger::start() {
|
||||
current_try++;
|
||||
remote_port++;
|
||||
OS::get_singleton()->delay_usec(1000);
|
||||
err = server->listen(remote_port);
|
||||
err = server->listen(remote_port, p_bind_address);
|
||||
}
|
||||
// No suitable port found.
|
||||
if (err != OK) {
|
||||
@@ -1592,7 +1598,7 @@ void ScriptEditorDebugger::start() {
|
||||
EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons();
|
||||
|
||||
auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree");
|
||||
if (auto_switch_remote_scene_tree) {
|
||||
if (is_inside_tree() && auto_switch_remote_scene_tree) {
|
||||
EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user