Opened 19 years ago

Last modified 14 years ago

#60 closed defect (worksforme)

getErrorString, getMessagesString, getMessagesStringInternal.

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

Description

See comments.

Change History (5)

comment:1 by Adrian Pop, 19 years ago

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 by Adrian Pop, 19 years ago

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 by Adrian Pop, 19 years ago

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 by Peter Aronsson, 18 years ago

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 by Martin Sjölund, 14 years ago

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

Note: See TracTickets for help on using tickets.