Mono: Partially implement some Godot debug api functions
Debug breaks sent with debug_break and debug_break_parse should display correctly in the Godot debugger now.
This commit is contained in:
parent
4c0b0a6bdd
commit
8e2e0795bb
|
@ -499,6 +499,47 @@ String CSharpLanguage::_get_indentation() const {
|
||||||
return "\t";
|
return "\t";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String CSharpLanguage::debug_get_error() const {
|
||||||
|
|
||||||
|
return _debug_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CSharpLanguage::debug_get_stack_level_count() const {
|
||||||
|
|
||||||
|
if (_debug_parse_err_line >= 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
// TODO: StackTrace
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CSharpLanguage::debug_get_stack_level_line(int p_level) const {
|
||||||
|
|
||||||
|
if (_debug_parse_err_line >= 0)
|
||||||
|
return _debug_parse_err_line;
|
||||||
|
|
||||||
|
// TODO: StackTrace
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
String CSharpLanguage::debug_get_stack_level_function(int p_level) const {
|
||||||
|
|
||||||
|
if (_debug_parse_err_line >= 0)
|
||||||
|
return String();
|
||||||
|
|
||||||
|
// TODO: StackTrace
|
||||||
|
return String();
|
||||||
|
}
|
||||||
|
|
||||||
|
String CSharpLanguage::debug_get_stack_level_source(int p_level) const {
|
||||||
|
|
||||||
|
if (_debug_parse_err_line >= 0)
|
||||||
|
return _debug_parse_err_file;
|
||||||
|
|
||||||
|
// TODO: StackTrace
|
||||||
|
return String();
|
||||||
|
}
|
||||||
|
|
||||||
Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() {
|
Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() {
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
|
@ -958,12 +999,11 @@ void CSharpLanguage::thread_exit() {
|
||||||
|
|
||||||
bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) {
|
bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) {
|
||||||
|
|
||||||
// Break because of parse error
|
// Not a parser error in our case, but it's still used for other type of errors
|
||||||
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||||
// TODO
|
_debug_parse_err_line = p_line;
|
||||||
//_debug_parse_err_line = p_line;
|
_debug_parse_err_file = p_file;
|
||||||
//_debug_parse_err_file = p_file;
|
_debug_error = p_error;
|
||||||
//_debug_error = p_error;
|
|
||||||
ScriptDebugger::get_singleton()->debug(this, false);
|
ScriptDebugger::get_singleton()->debug(this, false);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -974,10 +1014,9 @@ bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const S
|
||||||
bool CSharpLanguage::debug_break(const String &p_error, bool p_allow_continue) {
|
bool CSharpLanguage::debug_break(const String &p_error, bool p_allow_continue) {
|
||||||
|
|
||||||
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||||
// TODO
|
_debug_parse_err_line = -1;
|
||||||
//_debug_parse_err_line = -1;
|
_debug_parse_err_file = "";
|
||||||
//_debug_parse_err_file = "";
|
_debug_error = p_error;
|
||||||
//_debug_error = p_error;
|
|
||||||
ScriptDebugger::get_singleton()->debug(this, p_allow_continue);
|
ScriptDebugger::get_singleton()->debug(this, p_allow_continue);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -162,7 +162,7 @@ public:
|
||||||
virtual bool has_script_signal(const StringName &p_signal) const;
|
virtual bool has_script_signal(const StringName &p_signal) const;
|
||||||
virtual void get_script_signal_list(List<MethodInfo> *r_signals) const;
|
virtual void get_script_signal_list(List<MethodInfo> *r_signals) const;
|
||||||
|
|
||||||
/* TODO */ virtual bool get_property_default_value(const StringName &p_property, Variant &r_value) const;
|
virtual bool get_property_default_value(const StringName &p_property, Variant &r_value) const;
|
||||||
virtual void get_script_property_list(List<PropertyInfo> *p_list) const;
|
virtual void get_script_property_list(List<PropertyInfo> *p_list) const;
|
||||||
virtual void update_exports();
|
virtual void update_exports();
|
||||||
|
|
||||||
|
@ -309,6 +309,11 @@ class CSharpLanguage : public ScriptLanguage {
|
||||||
|
|
||||||
Dictionary scripts_metadata;
|
Dictionary scripts_metadata;
|
||||||
|
|
||||||
|
// For debug_break and debug_break_parse
|
||||||
|
int _debug_parse_err_line;
|
||||||
|
String _debug_parse_err_file;
|
||||||
|
String _debug_error;
|
||||||
|
|
||||||
friend class GDMono;
|
friend class GDMono;
|
||||||
void _uninitialize_script_bindings();
|
void _uninitialize_script_bindings();
|
||||||
|
|
||||||
|
@ -368,11 +373,11 @@ public:
|
||||||
/* TODO */ virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) {}
|
/* TODO */ virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) {}
|
||||||
|
|
||||||
/* DEBUGGER FUNCTIONS */
|
/* DEBUGGER FUNCTIONS */
|
||||||
/* TODO */ virtual String debug_get_error() const { return ""; }
|
virtual String debug_get_error() const;
|
||||||
/* TODO */ virtual int debug_get_stack_level_count() const { return 1; }
|
virtual int debug_get_stack_level_count() const;
|
||||||
/* TODO */ virtual int debug_get_stack_level_line(int p_level) const { return 1; }
|
virtual int debug_get_stack_level_line(int p_level) const;
|
||||||
/* TODO */ virtual String debug_get_stack_level_function(int p_level) const { return ""; }
|
virtual String debug_get_stack_level_function(int p_level) const;
|
||||||
/* TODO */ virtual String debug_get_stack_level_source(int p_level) const { return ""; }
|
virtual String debug_get_stack_level_source(int p_level) const;
|
||||||
/* TODO */ virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
/* TODO */ virtual void debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
||||||
/* TODO */ virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
/* TODO */ virtual void debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
||||||
/* TODO */ virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
/* TODO */ virtual void debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {}
|
||||||
|
|
Loading…
Reference in New Issue