fix of MUSR-27: mlog-file should now be ok, enven if there is no FUNCTIONS block

This commit is contained in:
nemu 2009-03-10 06:56:16 +00:00
parent 0bb27b7061
commit 6eacc87cee

View File

@ -402,12 +402,17 @@ int PMsrHandler::WriteMsrLogFile()
}
// write functions block
f << endl << "FUNCTIONS";
CheckAndWriteComment(f, ++lineNo);
for (int i=0; i<GetNoOfFuncs(); i++) {
str = *fFuncHandler->GetFuncString(i);
str.ToLower();
f << endl << str.Data();
cout << endl << ">> GetNoOfFuncs() = " << GetNoOfFuncs() << endl;
if (GetNoOfFuncs() != 0) {
f << endl << "FUNCTIONS";
CheckAndWriteComment(f, ++lineNo);
for (int i=0; i<GetNoOfFuncs(); i++) {
str = *fFuncHandler->GetFuncString(i);
str.ToLower();
f << endl << str.Data();
CheckAndWriteComment(f, ++lineNo);
}
} else {
CheckAndWriteComment(f, ++lineNo);
}