Commit 02a79e28 authored by Francois Bleibel's avatar Francois Bleibel
Browse files

Added more exception catch codes in interpreter. Should now link correctly...

Added more exception catch codes in interpreter. Should now link correctly with boost libraries. Small debug output changes.
parent f827a09b
......@@ -67,7 +67,7 @@ OPTION(GENERATE_DOC "Generate html documentation" ON)
# --- BOOST ---------------------------------------------------
SET(Boost_THREAD_FOUND 0)
FIND_PACKAGE(Boost COMPONENTS thread)
FIND_PACKAGE(Boost COMPONENTS thread REQUIRED)
IF(Boost_THREAD_FOUND)
#MESSAGE(STATUS "Boost_THREAD_LIBRARY:" ${Boost_THREAD_LIBRARY})
#MESSAGE(STATUS "Boost_THREAD_LIBRARY_RELEASE:" ${Boost_THREAD_LIBRARY_RELEASE})
......
......@@ -124,7 +124,7 @@ protected:
public:
virtual void checkCompatibility( void ) { throw Tcopy; }
virtual void checkCompatibility( void ) { throw Tcopy; }
private:
const T& setTcopy( const T& t );
......
......@@ -49,6 +49,8 @@ IF (UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dl pthread)
ENDIF (UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
INSTALL(TARGETS ${LIBRARY_NAME}
DESTINATION lib)
......@@ -72,7 +74,8 @@ ADD_LIBRARY(${plugin}
"${plugin_file}.cpp")
TARGET_LINK_LIBRARIES(${plugin}
${PROJECT_NAME} ${${plugin}_dependancy})
${PROJECT_NAME} ${${plugin}_dependancy}
${Boost_LIBRARIES})
SET_TARGET_PROPERTIES(${plugin}
PROPERTIES
......
......@@ -64,13 +64,14 @@ registerFunction( const string& funname,
if( funkey != functionMap.end() ) // key does exist
{
if( initDone )
{
dgDEBUG(15) << "!! Another function already defined with the same name. "
<< "Funname is" <<funname.c_str() << endl;
}
throw ExceptionFactory( ExceptionFactory::FUNCTION_CONFLICT,
"Another function already defined with the same name. ",
"Funname is <%s>.",funname.c_str() );
{
dgDEBUG(15) << "!! Another function already defined with the same name. Overloading "
<< "Funname is" <<funname.c_str() << endl;
throw ExceptionFactory( ExceptionFactory::FUNCTION_CONFLICT,
"Another function already defined with the same name. ",
"Funname is <%s>.",funname.c_str() );
}
}
else
{
......@@ -475,7 +476,7 @@ shell( std::istream& sin, std::ostream& sout, const std::string& promptUser )
istringstream args (cmdArgs);
try{ cmd(cmdLine,args,sout); }
catch( ExceptionAbstract& e ) { dgDEBUG(1) << e; throw e; }
catch( exception& e ) { dgDEBUG(1) << e.what(); throw e; }
catch(...) { dgDEBUG(1) << "!! unknow!." <<endl; throw; }
}
}
......
......@@ -131,7 +131,9 @@ openFile( const SignalBase<int> & sig,
dgDEBUG(5) << "Sig <"<<sig.getName()
<< ">: new file "<< filename << endl;
std::ofstream * newfile = new std::ofstream( filename.c_str() );
dgDEBUG(5) << "Newfile:" << (void*) newfile << endl;
hardFiles.push_back( newfile );
dgDEBUG(5) << "Creating Outstringstream" << endl;
//std::stringstream * newbuffer = new std::stringstream();
OutStringStream * newbuffer = new OutStringStream(); // std::stringstream();
......
......@@ -51,9 +51,9 @@ int main( int argc,char** argv )
g_shell.cmd( "run",script,cout );
}
}
catch( ExceptionAbstract& e )
catch( exception& e )
{
cout << "!! In file <" << argv[fileIdx] << "> : " << e <<endl;
cout << "!! In file <" << argv[fileIdx] << "> : " << e.what() <<endl;
}
catch ( const char* str ) {
cout << "!! In file <" << argv[fileIdx] << "> : "
......@@ -70,9 +70,9 @@ int main( int argc,char** argv )
dgDEBUG(5) << "Shell over." << endl;
if( cin.eof() ) break;
}
catch( ExceptionAbstract& e )
catch( exception& e )
{
cout << "!! " << e <<endl;
cout << "!! " << e.what() <<endl;
}
catch( ... ){ dgDEBUG(5) << "!! Unknown! " <<endl ; }
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment