@@ -196,16 +196,19 @@ ErrorMessage::ErrorMessage(const tinyxml2::XMLElement * const errmsg)
196196 for (const tinyxml2::XMLElement *e = errmsg->FirstChildElement (); e; e = e->NextSiblingElement ()) {
197197 const char * name = e->Name ();
198198 if (std::strcmp (name," location" )==0 ) {
199+ const char *strorigfile = e->Attribute (" origfile" );
199200 const char *strfile = e->Attribute (" file" );
200201 const char *strinfo = e->Attribute (" info" );
201202 const char *strline = e->Attribute (" line" );
202203 const char *strcolumn = e->Attribute (" column" );
203204
205+ const char *origfile = strorigfile ? strorigfile : unknown;
204206 const char *file = strfile ? strfile : unknown;
205207 const char *info = strinfo ? strinfo : " " ;
206208 const int line = strline ? strToInt<int >(strline) : 0 ;
207209 const int column = strcolumn ? strToInt<int >(strcolumn) : 0 ;
208210 callStack.emplace_front (file, info, line, column);
211+ callStack.front ().setOrigFile (origfile);
209212 } else if (std::strcmp (name," symbol" )==0 ) {
210213 mSymbolNames += e->GetText ();
211214 }
@@ -508,6 +511,7 @@ std::string ErrorMessage::toXML() const
508511
509512 for (auto it = callStack.crbegin (); it != callStack.crend (); ++it) {
510513 printer.OpenElement (" location" , false );
514+ printer.PushAttribute (" origfile" , it->getOrigFile ().c_str ());
511515 printer.PushAttribute (" file" , it->getfile (false ).c_str ());
512516 printer.PushAttribute (" line" , std::max (it->line ,0 ));
513517 printer.PushAttribute (" column" , it->column );
@@ -750,6 +754,11 @@ void ErrorMessage::FileLocation::setfile(std::string file)
750754 mFileName = Path::simplifyPath (std::move (file));
751755}
752756
757+ void ErrorMessage::FileLocation::setOrigFile (std::string file)
758+ {
759+ mOrigFileName = Path::simplifyPath (std::move (file));
760+ }
761+
753762std::string ErrorMessage::FileLocation::stringify (bool addcolumn) const
754763{
755764 std::string str;
0 commit comments