I just check the DWARF information in the parserthread.o
by using:
objdump -W parserthread.o >> aaaa.txt
Then I have found that
there are two entries for templateArgument in the debug information.
The source code is like:
wxString ParserThread::ReadAncestorList()
{
wxString ccc;
wxString templateArgument;
wxString aaa;
aaa = m_Tokenizer.GetToken(); // eat ":"
templateArgument = aaa;
while (!TestDestroy())
{
//Peek the next token
wxString next = m_Tokenizer.PeekToken();
if (next.IsEmpty()
|| next==ParserConsts::opbrace
|| next==ParserConsts::semicolon ) // here, we are at the end of ancestor list
{
break;
}
else if (next==ParserConsts::lt) // class AAA : BBB < int, float >
{
wxString arg = SkipAngleBraces();
if(!arg.IsEmpty()) // find a matching <>
{
templateArgument<<arg;
}
else
{
TRACE(_T("Not Matching <> find. Error!!!") );
}
}
//check the returned Token is a simple Macro usage
wxString tmp = GetClassFromMacro(m_Tokenizer.GetToken());
//Handle Current token first
//Skip the public, protected and private keyword, we don't care them
if (tmp==ParserConsts::kw_public
||tmp==ParserConsts::kw_protected
||tmp==ParserConsts::kw_private )
{
continue;
}
else
{
templateArgument<<tmp;
}
}
TRACE(_T("ReadAncestorList() : Ancestors: ") + templateArgument);
return templateArgument;
}
Then you can see,
there is only one entry for wxString aaa, but two entry for wxString templateArgument.
Is it possible a bug in GCC?
I have just tested in TDM GCC 4.5 and Loaden GCC 4.4.4.
Both of them has bad information about "wxString templateArgument".
Any suggestions?
Thanks.
Edit:It seems some thing related to "return variables", because when I use "aaa" as a return variable, then, the wxString aaa shows badly, at this time, the wxString templateArgument shows correctly.
see the image:
