Show function name in debugger stack trace

Also show script and line when the instance is gone when resuming from
yield.
This commit is contained in:
George Marques 2019-05-10 16:39:39 -03:00
parent bdc6649b79
commit 9df1a2442b
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
2 changed files with 3 additions and 4 deletions

View file

@ -622,8 +622,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
d["frame"] = i;
s->set_metadata(0, d);
//String line = itos(i)+" - "+String(d["file"])+":"+itos(d["line"])+" - at func: "+d["function"];
String line = itos(i) + " - " + String(d["file"]) + ":" + itos(d["line"]);
String line = itos(i) + " - " + String(d["file"]) + ":" + itos(d["line"]) + " - at function: " + d["function"];
s->set_text(0, line);
if (i == 0)

View file

@ -1778,7 +1778,7 @@ Variant GDScriptFunctionState::_signal_callback(const Variant **p_args, int p_ar
if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
#ifdef DEBUG_ENABLED
ERR_EXPLAIN("Resumed after yield, but class instance is gone");
ERR_EXPLAIN("Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line));
ERR_FAIL_V(Variant());
#else
return Variant();
@ -1874,7 +1874,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) {
ERR_FAIL_COND_V(!function, Variant());
if (state.instance_id && !ObjectDB::get_instance(state.instance_id)) {
#ifdef DEBUG_ENABLED
ERR_EXPLAIN("Resumed after yield, but class instance is gone");
ERR_EXPLAIN("Resumed function '" + String(function->get_name()) + "()' after yield, but class instance is gone. At script: " + state.script->get_path() + ":" + itos(state.line));
ERR_FAIL_V(Variant());
#else
return Variant();