more debugger fixes
-setting/clearing breakpoints during run-time now works -multi-line strings resulted in wrong line numbers in bytecode, fixed
This commit is contained in:
parent
09a2de9916
commit
8280bb0de0
@ -243,6 +243,15 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) {
|
|||||||
|
|
||||||
if (request_scene_tree)
|
if (request_scene_tree)
|
||||||
request_scene_tree(request_scene_tree_ud);
|
request_scene_tree(request_scene_tree_ud);
|
||||||
|
|
||||||
|
} else if (command=="breakpoint") {
|
||||||
|
|
||||||
|
bool set = cmd[3];
|
||||||
|
if (set)
|
||||||
|
insert_breakpoint(cmd[2],cmd[1]);
|
||||||
|
else
|
||||||
|
remove_breakpoint(cmd[2],cmd[1]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_parse_live_edit(cmd);
|
_parse_live_edit(cmd);
|
||||||
}
|
}
|
||||||
@ -518,6 +527,13 @@ void ScriptDebuggerRemote::_poll_events() {
|
|||||||
|
|
||||||
if (request_scene_tree)
|
if (request_scene_tree)
|
||||||
request_scene_tree(request_scene_tree_ud);
|
request_scene_tree(request_scene_tree_ud);
|
||||||
|
} else if (command=="breakpoint") {
|
||||||
|
|
||||||
|
bool set = cmd[3];
|
||||||
|
if (set)
|
||||||
|
insert_breakpoint(cmd[2],cmd[1]);
|
||||||
|
else
|
||||||
|
remove_breakpoint(cmd[2],cmd[1]);
|
||||||
} else {
|
} else {
|
||||||
_parse_live_edit(cmd);
|
_parse_live_edit(cmd);
|
||||||
}
|
}
|
||||||
|
@ -642,6 +642,11 @@ void GDTokenizerText::_advance() {
|
|||||||
str+=res;
|
str+=res;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (CharType(GETCHAR(i))=='\n') {
|
||||||
|
line++;
|
||||||
|
column=0;
|
||||||
|
}
|
||||||
|
|
||||||
str+=CharType(GETCHAR(i));
|
str+=CharType(GETCHAR(i));
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -1101,6 +1101,7 @@ void ScriptEditor::_menu_option(int p_option) {
|
|||||||
int line=current->get_text_edit()->cursor_get_line();
|
int line=current->get_text_edit()->cursor_get_line();
|
||||||
bool dobreak = !current->get_text_edit()->is_line_set_as_breakpoint(line);
|
bool dobreak = !current->get_text_edit()->is_line_set_as_breakpoint(line);
|
||||||
current->get_text_edit()->set_line_as_breakpoint(line,dobreak);
|
current->get_text_edit()->set_line_as_breakpoint(line,dobreak);
|
||||||
|
get_debugger()->set_breakpoint(current->get_edited_script()->get_path(),line+1,dobreak);
|
||||||
} break;
|
} break;
|
||||||
case DEBUG_NEXT: {
|
case DEBUG_NEXT: {
|
||||||
|
|
||||||
|
@ -1078,6 +1078,19 @@ void ScriptEditorDebugger::live_debug_reparent_node(const NodePath& p_at, const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEditorDebugger::set_breakpoint(const String& p_path,int p_line,bool p_enabled) {
|
||||||
|
|
||||||
|
if (connection.is_valid()) {
|
||||||
|
Array msg;
|
||||||
|
msg.push_back("breakpoint");
|
||||||
|
msg.push_back(p_path);
|
||||||
|
msg.push_back(p_line);
|
||||||
|
msg.push_back(p_enabled);
|
||||||
|
ppeer->put_var(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScriptEditorDebugger::_error_selected(int p_idx) {
|
void ScriptEditorDebugger::_error_selected(int p_idx) {
|
||||||
|
|
||||||
error_stack->clear();
|
error_stack->clear();
|
||||||
|
@ -173,6 +173,8 @@ public:
|
|||||||
void live_debug_duplicate_node(const NodePath& p_at,const String& p_new_name);
|
void live_debug_duplicate_node(const NodePath& p_at,const String& p_new_name);
|
||||||
void live_debug_reparent_node(const NodePath& p_at,const NodePath& p_new_place,const String& p_new_name,int p_at_pos);
|
void live_debug_reparent_node(const NodePath& p_at,const NodePath& p_new_place,const String& p_new_name,int p_at_pos);
|
||||||
|
|
||||||
|
void set_breakpoint(const String& p_path,int p_line,bool p_enabled);
|
||||||
|
|
||||||
void update_live_edit_root();
|
void update_live_edit_root();
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user