Opened 19 years ago

Last modified 14 years ago

#60 closed defect (worksforme)

getErrorString, getMessagesString, getMessagesStringInternal.

Reported by: adrpo Owned by: adrpo
Priority: critical Milestone:
Component: Interactive Environment Version: 1.3
Keywords: Cc: adrpo, adrpo

Description

See comments.

Change History (5)

comment:1 Changed 19 years ago by adrpo

Make a file l.mo in trunk/testsuite/mofiles and put these commands in it:

/ start
loadFileInteractiveQualified("ExternalFunction1.mo");
getErrorString();
getMessagesString();
getMessagesStringInternal();
loadFileInteractiveQualified("Faculty1.mo");
getErrorString();
getMessagesString();
getMessagesStringInternal();
loadFileInteractiveQualified("Faculty2.mo");
getErrorString();
getMessagesString();
getMessagesStringInternal();
/ end

Running the script:

adrpo@KAFKA ~/dev/OpenModelica/testsuite/mofiles
$ ../../Compiler/omc.exe l.mos
{f,ExternalFunction1}
""
""
"{}"
{Faculty1}
"Class Faculty1 not found in scope Faculty1.
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
"
"Class Faculty1 not found in scope Faculty1.
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
"
"{{"Class Faculty1 not found in scope Faculty1.", "TRANSLATION", "ERROR", "3"}"
{Faculty2,Faculty2Model}
"Class Faculty1 not found in scope Faculty1.
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
"
"Class Faculty1 not found in scope Faculty1.
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
No matching function found for Faculty1, candidates are
"
"{{"Class Faculty1 not found in scope Faculty1.", "TRANSLATION", "ERROR", "3"}"


And OMC never seems to return anything but weird error
messages after parsing of Faculty1.mo
Can we somehow clear the error buffer on each loadFileInteractiveQualified?
It would be neat to have something like:
clearErrors() which resets the error state.

This is a show stopping bug for MDT.

Cheers,
Adrian Pop/

comment:2 Changed 19 years ago by adrpo

I had a look at getErrorString()
It calls Error.print_message_str()
which calls ErrorExt.print_message_str()
which does this:

std::string res("");
while(!errorMessageQueue.empty()) {

res = res+errorMessageQueue.front().getMessage()+string("\n");
errorMessageQueue.pop();

}

Which means that after this the errorMessageQueue should be EMPTY
but is not on next calls to getErrorsString().
I don't understand why this is happening, any ideas?

comment:3 Changed 19 years ago by adrpo

This bug is connected with recursive functions.
Small Example:

function RecursiveFunction

input Integer x;
output Integer y;

algorithm

y := if x > 0 then RecursiveFunction(x-1) else 1;

end RecursiveFunction;

Normal omc call, no interactive.
$ /c/OpenModelica132/bin/omc.exe RecursiveFunction.mo
Class RecursiveFunction not found in scope RecursiveFunction.
No matching function found for RecursiveFunction, candidates are
No matching function found for RecursiveFunction, candidates are
No classes are loaded.
Execution failed!

comment:4 Changed 18 years ago by petar

Adrian, Probably you have more interest in fixing this bug. I reassign it to
you. If you find someone better to deal with it, please reassign it again.

comment:5 Changed 14 years ago by sjoelund.se

Seems to work in the trunk, so I am closing this.

Note: See TracTickets for help on using tickets.