Add path information for objects in objects file

fixes #8371
This commit is contained in:
Gunnar Beutner 2015-02-05 15:05:07 +01:00
parent 4452711b1d
commit 4896428c06
2 changed files with 15 additions and 0 deletions

View File

@ -140,6 +140,13 @@ void ObjectListCommand::PrintObject(std::ostream& fp, bool& first, const String&
fp << "Object '" << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << internal_name << ConsoleColorTag(Console_Normal) << "'"; fp << "Object '" << ConsoleColorTag(Console_ForegroundBlue | Console_Bold) << internal_name << ConsoleColorTag(Console_Normal) << "'";
fp << " of type '" << ConsoleColorTag(Console_ForegroundMagenta | Console_Bold) << type << ConsoleColorTag(Console_Normal) << "':\n"; fp << " of type '" << ConsoleColorTag(Console_ForegroundMagenta | Console_Bold) << type << ConsoleColorTag(Console_Normal) << "':\n";
Array::Ptr di = object->Get("debug_info");
if (di) {
fp << ConsoleColorTag(Console_ForegroundCyan) << " % declared in '" << di->Get(0) << "', lines "
<< di->Get(1) << ":" << di->Get(2) << "-" << di->Get(3) << ":" << di->Get(4) << ConsoleColorTag(Console_Normal) << "\n";
}
PrintProperties(fp, properties, debug_hints, 2); PrintProperties(fp, properties, debug_hints, 2);
type_count[type]++; type_count[type]++;

View File

@ -214,6 +214,14 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
persistentItem->Set("properties", attrs); persistentItem->Set("properties", attrs);
persistentItem->Set("debug_hints", debugHints.ToDictionary()); persistentItem->Set("debug_hints", debugHints.ToDictionary());
Array::Ptr di = new Array();
di->Add(m_DebugInfo.Path);
di->Add(m_DebugInfo.FirstLine);
di->Add(m_DebugInfo.FirstColumn);
di->Add(m_DebugInfo.LastLine);
di->Add(m_DebugInfo.LastColumn);
persistentItem->Set("debug_info", di);
ConfigCompilerContext::GetInstance()->WriteObject(persistentItem); ConfigCompilerContext::GetInstance()->WriteObject(persistentItem);
persistentItem.reset(); persistentItem.reset();