[Rose-commits] r89 - in trunk: docs/Rose projects/DocumentationGenerator src/frontend/BinaryDisassembly src/frontend/CxxFrontend src/frontend/SageIII src/util/commandlineProcessing tests/roseTests/programAnalysisTests/defUseAnalysisTests tutorial

liaoch at osp5.lbl.gov liaoch at osp5.lbl.gov
Sat Oct 18 13:03:41 PDT 2008


Author: liaoch
Date: 2008-10-18 13:03:41 -0700 (Sat, 18 Oct 2008)
New Revision: 89

Modified:
   trunk/docs/Rose/developersAppendix.tex
   trunk/projects/DocumentationGenerator/Makefile.am
   trunk/projects/DocumentationGenerator/classifyDeprecated.C
   trunk/projects/DocumentationGenerator/correctAllComments.C
   trunk/projects/DocumentationGenerator/correctExternalComments.C
   trunk/projects/DocumentationGenerator/correctExternalCommentsAndCompile.C
   trunk/projects/DocumentationGenerator/createDocumentationForROSE.C
   trunk/projects/DocumentationGenerator/docLint.C
   trunk/projects/DocumentationGenerator/testParser06.C
   trunk/projects/DocumentationGenerator/testParser09.C
   trunk/projects/DocumentationGenerator/testParser10.C
   trunk/projects/DocumentationGenerator/testParser11.C
   trunk/projects/DocumentationGenerator/testParser12.C
   trunk/src/frontend/BinaryDisassembly/RoseBin.cpp
   trunk/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp
   trunk/src/frontend/BinaryDisassembly/RoseBin_IDAPRO_buildTree.cpp
   trunk/src/frontend/BinaryDisassembly/RoseBin_file.cpp
   trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-646e04576d4266880b4066826540b2ae.tar.gz
   trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-646e04576d4266880b4066826540b2ae.tar.gz
   trunk/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-646e04576d4266880b4066826540b2ae.tar.gz
   trunk/src/frontend/SageIII/sageSupport.C
   trunk/src/util/commandlineProcessing/commandline_processing.C
   trunk/src/util/commandlineProcessing/commandline_processing.h
   trunk/tests/roseTests/programAnalysisTests/defUseAnalysisTests/runTest.C
   trunk/tutorial/defuseAnalysis.C
Log:
Load rose-0.9.4a-2557 into trunk.


Modified: trunk/docs/Rose/developersAppendix.tex
===================================================================
--- trunk/docs/Rose/developersAppendix.tex	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/docs/Rose/developersAppendix.tex	2008-10-18 20:03:41 UTC (rev 89)
@@ -1,7 +1,120 @@
 \chapter{ Developer's Appendix }
 
 \label{developersAppendix:developersAppendix}
+%Added by Liao 10/17/2008
+\section{Working with the ROSE SVN repositories}
+\label{gettingStarted::svn}
+We have two subversion repositories for ROSE: an internal one at LLNL and
+an external one at SciDAC Outreach Center (using a vendor drop scheme). 
+Some tips for using them are gathered in this section. 
+\subsection{The External Repository}
+\begin{itemize}
+\item Install your svn client ($>=$1.5.1 is recommended ) with
+\textit{libsvn\_ra\_dav} support
+(\htmladdnormallink{http://www.webdav.org/neon}{http://www.webdav.org/neon}
+and \textit{--with-ssl}) or set the right \textit{LD\_LIBRARY\_PATH} for it
+(\textit{libsvn\_ra\_dav-1.so}) if you encounter the following problem:\\
+ \textit{svn: Unrecognized URL scheme for
+ 'https://outreach.scidac.gov/svn/rose/trunk'} 
+\item To check out the main trunk, type: \\
+\textit{svn checkout https://outreach.scidac.gov/svn/rose/trunk rose}
+\item To check out a branch, type: \\
+\textit{svn checkout
+https://outreach.scidac.gov/svn/rose/branches/branch\_name rose} 
+\item Merge the new updates of the main trunk into your working branch. 
+Conceptually, svn merge works as two step: diff two revisions and merge the different into a working copy.
+So you need to know two revision numbers of the main trunk: the first is
+the latest revision number of the main trunk from which your branch was
+created (or most recently synchronized);
+the second is usually the head revision of the main trunk.
+\begin{itemize}
+  \item find the revision in which your branch was created or the last
+  synchronization point with the trunk:\\ 
+         \textit{svn log
+         https://outreach.scidac.gov/svn/rose/branches/branch\_name} 
+  \item cd local work copy of your branch, do the merge (overlapped merging
+  seems possible using subversion 1.5.1), assume the last synchronization
+  point(or originating point) is rev 56:\\
+        \textit{svn merge --dry-run -r 56:69
+        https://outreach.scidac.gov/svn/rose/trunk} \\
+        \textit{svn merge -r 56:69
+        https://outreach.scidac.gov/svn/rose/trunk} 
+   \item Solve conflicts as needed.     
+   \item svn commit: please record the start and end revision numbers of
+   the main trunk being merged into the log to keep track of merging.   
+\end{itemize}                
+\item You can check the archive of email notifications of the svn commits
+from \htmladdnormallink{https://osp5.lbl.gov/pipermail/rose-commits}{https://osp5.lbl.gov/pipermail/rose-commits} 
+\end{itemize}
 
+
+\subsection{The Internal Repository}
+Again, make sure you are using subversion $>$ 1.4.x, 1.5.1 and up is recommended.
+\begin{itemize}
+\item Set local subversion configuration to ignore certain files and
+automatically set file attributes (e.g. binary or text files ) during committing. 
+A sample config file is available in the internal ROSE subversion repository:\\
+  \textit{trunk/ROSE/scripts/subversion.config}
+Please save it to your own .subversion/config before committing files. 
+\item List content in the repository:
+  \begin{itemize}
+          \item list root info: \textit{svn list
+          file:///usr/casc/overture/ROSE/svn/ROSE}
+          \item list all branches: \textit{svn list
+          file:///usr/casc/overture/ROSE/svn/ROSE/branches}
+          \item list all tags: \textit{svn list
+          file:///usr/casc/overture/ROSE/svn/ROSE/tags} 
+   \end{itemize}       
+\item Check out something:
+   \begin{itemize}
+          \item the main trunk: \textit{svn co
+          file:///usr/casc/overture/ROSE/svn/ROSE/trunk/ROSE rose-svn} 
+          \item a tag: \textit{svn co
+          file:///usr/casc/overture/ROSE/svn/ROSE/tags/tag-name}
+          \item a branch: \textit{svn co
+          file:///usr/casc/overture/ROSE/svn/ROSE/branches/branch-name} 
+          \item Either of these can be used on a separate machine (not CASC
+          or LC) with LLNL VPN access by changing \textit{file:///} to
+          \textit{svn+ssh://username@hostname/}. 
+    \end{itemize}      
+\item Merge the contributions of a branch from the SciDAC repository to the
+internal repository: assume the branch is named \textit{testonly} and the
+contribution is from r4 to r5, 
+\textit{sourcetree} is the working copy of the internal repository (Subversion 1.5 works better than 1.4.x):
+  \begin{itemize}
+          \item run make check, make dist, make distcheck on the external branch before the merge
+          \item \textit{svn status} to check modified and new files. 
+          \item \textit{svn add file-name} to add new files if there are
+          any.
+          \item \textit{svn merge --dry-run -r4:5
+          https://outreach.scidac.gov/svn/rose/branches/testonly
+          sourcetree} 
+          \item \textit{svn merge -r4:5
+          https://outreach.scidac.gov/svn/rose/branches/testonly
+          sourcetree}
+          \item solve any possible conflicts alone the way
+           \item svn commit: please record the start and end revision numbers of
+         the external branch being merged into the log to keep track of merging.   
+   \end{itemize}
+
+\item branches   
+    \begin{itemize}
+    \item Add a new branch based on the head of the main trunk:\\
+    \textit{svn cp file:///usr/casc/overture/ROSE/svn/ROSE/trunk/ROSE file:///usr/casc/overture/ROSE/svn/ROSE/branches/branch-name}
+    \item Delete a branch: \\
+    \textit{svn delete file:///usr/casc/overture/ROSE/svn/ROSE/branches/branch-name}
+    \end{itemize}
+
+\item Email notification: A perl script named post-commit (under
+svn/text/hooks or svn/ROSE/hooks) keeps our email recipient list.\\
+          \textit{/usr/casc/overture/ROSE/svn/ROSE/hooks/post-commit}
+\item To upgrade, do \textit{svn switch} to new tag URL
+\item Building distributions of ROSE MUST be done with \textit{svn export}. Otherwise, .svn directories are copied into the distribution trees. 
+
+\end{itemize}
+
+
+
 \section{Building ROSE from the Source Code Repository Checkout {\em (for developers only)}}
 \label{gettingStarted:DeveloperInstructions}
 
@@ -871,6 +984,49 @@
    editor -- just suspending it prevents your changes from taking effect.
 \end{enumerate}
 
+\section{Updating The External Website and Repository}
+(For the LLNL internal developers only) We have several special top level
+makefile targets to update the rosecompiler.org and SciDAC Outreach
+subversion repository. They are controlled by the regression test scripts
+automatically. Here are some instructions if you really want to do it manually:
+
+\subsection{rosecompiler.org}
+Here are the commands to update the rosecompiler.org website:
+\begin{verbatim}
+
+# 1. enter your build tree for ROSE. You should have ran make docs already
+ cd build/docs/Rose
+
+# 2. change the scidac.outreach account to yours in the Makefile. e.g 
+  # in build/docs/Rose/Makefile
+  copyWebPages: logo
+       cd ROSE_WebPages?; rsync -avz *   yourAccount at web-dev.nersc.gov:/www/host/rosecompiler
+
+# 3. do the uploading, input your password when prompted. 
+    make copyWebPages  
+\end{verbatim}
+
+\subsection{The External Repository}
+To build the binary file of the EDG frontend and the corresponding
+\textit{EDG\_SAGE\_CONNECTION} code for the current platform:
+
+\begin{itemize}
+  \item  \textit{make binary\_edg\_tarball} 
+  \item  add the binary into the internal SVN repository, remove any stale
+  binaries for other platforms as well. \\
+  \textit{make copy\_binary\_edg\_tarball\_to\_source\_tree\_svn} 
+   \item make a source release package with EDG binaries. \\
+   \textit{make source\_with\_binary\_edg\_dist  DOT\_SVNREV=-svnversion} 
+\end{itemize}   
+
+Finally, a dedicated script will import the release package into the
+external ROSE svn repository hosted at the SciDAC Outreach Center. You must
+have an active account with https://outreach.scidac.gov to do this!\\
+
+\textit{rose/scripts/importRoseDistributionToSVN ROSE\_TOP\_TEST\_DIR}
+
+It conducts a set of sanity checks and postprocessing before the actual importing. e.g. No EDG copyrighted files in the package, remove .svn and other undesired directories or files, make sure all EDG binaries for supported platforms are available.
+
 \section{Enabling PHP Support}
 
 \begin{enumerate}

Modified: trunk/projects/DocumentationGenerator/Makefile.am
===================================================================
--- trunk/projects/DocumentationGenerator/Makefile.am	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/Makefile.am	2008-10-18 20:03:41 UTC (rev 89)
@@ -63,7 +63,7 @@
 
 
 testDocsROSE: docs/SgNode.docs createDocumentationForROSE sage_doxygen_documentation.h $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
-	$(VALGRIND) ./createDocumentationForROSE --edg:no_warnings -rose:collectAllCommentsAndDirectives -rose:includeCommentsAndDirectives SageIII -rose:includeCommentsAndDirectives docs $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
+	$(VALGRIND) ./createDocumentationForROSE --edg:no_warnings  -DCAN_NOT_COMPILE_WITH_ROSE=true  -rose:collectAllCommentsAndDirectives -rose:includeCommentsAndDirectives SageIII -rose:includeCommentsAndDirectives docs $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 	@echo "Overwrite a copy of the test files in $(top_srcdir)/docs/testDoxygen_copy"
@@ -74,7 +74,7 @@
 
 testDocsROSE_small: docs/SgNode.docs createDocumentationForROSE sage_doxygen_documentation.h $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.h
 	cd $(top_builddir)/src/frontend/SageIII; $(MAKE) removeHashLineDirectivesFromGeneratedCode
-	$(VALGRIND) ./createDocumentationForROSE -rose:verbose 2 --edg:no_warnings -rose:collectAllCommentsAndDirectives -rose:includeCommentsAndDirectives SageIII -rose:includeCommentsAndDirectives docs $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(srcdir)/roseLite.C
+	$(VALGRIND) ./createDocumentationForROSE -rose:verbose 2 --edg:no_warnings -DCAN_NOT_COMPILE_WITH_ROSE=true -rose:collectAllCommentsAndDirectives -rose:includeCommentsAndDirectives SageIII -rose:includeCommentsAndDirectives docs $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(srcdir)/roseLite.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 	@echo "Overwrite a copy of the test files in $(top_srcdir)/docs/testDoxygen_copy"
@@ -83,21 +83,21 @@
 
 
 testSage: docs/SgNode.docs correctExternalComments sage_doxygen_documentation.h $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
-	$(VALGRIND) ./correctExternalComments --edg:no_warnings $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
+	$(VALGRIND) ./correctExternalComments  --edg:no_warnings  -DCAN_NOT_COMPILE_WITH_ROSE=true  $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 	@echo "Overwrite a copy of the test files in $(top_srcdir)/docs/testDoxygen_copy"
 	mv -f *.docs $(top_srcdir)/docs/testDoxygen_copy
 
 testClassifyDeprecated: docs/SgNode.docs sage_doxygen_documentation.h classifyDeprecated $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
-	$(VALGRIND) ./classifyDeprecated --edg:no_warnings $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
+	$(VALGRIND) ./classifyDeprecated  --edg:no_warnings  -DCAN_NOT_COMPILE_WITH_ROSE=true  $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 	@echo "Overwrite a copy of the test files in $(top_srcdir)/docs/testDoxygen_copy"
 	mv -f *.docs $(top_srcdir)/docs/testDoxygen_copy
 
 testDocLint: docs/SgNode.docs sage_doxygen_documentation.h docLint $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
-	$(VALGRIND) ./docLint --edg:no_warnings $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
+	$(VALGRIND) ./docLint  --edg:no_warnings  -DCAN_NOT_COMPILE_WITH_ROSE=true  $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 
@@ -114,7 +114,7 @@
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 
 testClassifyDeprecatedSmall: docs/SgNode.docs sage_doxygen_documentation.h classifyDeprecated $(top_builddir)/src/frontend/SageIII/Cxx_Grammar.C
-	$(VALGRIND) ./classifyDeprecated --edg:no_warnings $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(srcdir)/small.C
+	$(VALGRIND) ./classifyDeprecated  --edg:no_warnings  -DCAN_NOT_COMPILE_WITH_ROSE=true  $(OPTIONS) $(INCLUDES) -I. -Idocs $(srcdir)/sage_doxygen_documentation.C $(srcdir)/small.C
 	@echo "Due to possible bug in ROSE, a few header files are generated ... remove them"
 	-rm -f limits basic_file.h locale_facets.h stl_threads.h  stl_tree.h
 	@echo "Overwrite a copy of the test files in $(top_srcdir)/docs/testDoxygen_copy"

Modified: trunk/projects/DocumentationGenerator/classifyDeprecated.C
===================================================================
--- trunk/projects/DocumentationGenerator/classifyDeprecated.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/classifyDeprecated.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -43,8 +43,8 @@
    {
      vector<string> argvList(argv, argv + argc);
 
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      Doxygen::parseCommandLine(argvList);
 

Modified: trunk/projects/DocumentationGenerator/correctAllComments.C
===================================================================
--- trunk/projects/DocumentationGenerator/correctAllComments.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/correctAllComments.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -10,8 +10,8 @@
    {
      vector<string> argvList(argv, argv + argc);
 
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      Doxygen::parseCommandLine(argvList);
 

Modified: trunk/projects/DocumentationGenerator/correctExternalComments.C
===================================================================
--- trunk/projects/DocumentationGenerator/correctExternalComments.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/correctExternalComments.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -10,8 +10,8 @@
    {
      vector<string> argvList(argv, argv + argc);
 
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      Doxygen::parseCommandLine(argvList);
 
@@ -19,12 +19,18 @@
      newArgv.insert(newArgv.begin() + 1, "-rose:collectAllCommentsAndDirectives");
 
   // Build the AST used by ROSE
-     SgProject* sageProject = frontend(newArgv);
+     try{
+       SgProject* sageProject = frontend(newArgv);
+       Doxygen::annotate(sageProject);
 
-     Doxygen::annotate(sageProject);
+       Doxygen::correctAllComments(sageProject);
 
-     Doxygen::correctAllComments(sageProject);
+       Doxygen::unparse(sageProject);
 
-     Doxygen::unparse(sageProject);
+     }catch(SgAsmGenericFile::FormatError e){
+       fprintf(stderr, "%s\n",  e.mesg.c_str());
+       exit(1);
+
+     }
    }
 

Modified: trunk/projects/DocumentationGenerator/correctExternalCommentsAndCompile.C
===================================================================
--- trunk/projects/DocumentationGenerator/correctExternalCommentsAndCompile.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/correctExternalCommentsAndCompile.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -8,8 +8,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      char **newArgv = new char*[argc+2];
      newArgv[0] = argv[0];

Modified: trunk/projects/DocumentationGenerator/createDocumentationForROSE.C
===================================================================
--- trunk/projects/DocumentationGenerator/createDocumentationForROSE.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/createDocumentationForROSE.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -433,8 +433,8 @@
 
      vector<string> argvList(argv, argv + argc);
 
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix(".docs");
+     CommandlineProcessing::addCppSourceFileSuffix(".h");
 
      commentMap = std::map<const PreprocessingInfo*, DoxygenComment* >();
 

Modified: trunk/projects/DocumentationGenerator/docLint.C
===================================================================
--- trunk/projects/DocumentationGenerator/docLint.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/docLint.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -11,8 +11,8 @@
 
      vector<string> argvList(argv, argv + argc);
 
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      Doxygen::parseCommandLine(argvList);
 

Modified: trunk/projects/DocumentationGenerator/testParser06.C
===================================================================
--- trunk/projects/DocumentationGenerator/testParser06.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/testParser06.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -11,8 +11,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
   // Build the AST used by ROSE
      SgProject* sageProject = frontend(argc,argv);

Modified: trunk/projects/DocumentationGenerator/testParser09.C
===================================================================
--- trunk/projects/DocumentationGenerator/testParser09.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/testParser09.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -10,8 +10,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
   // Build the AST used by ROSE
      SgProject* sageProject = frontend(argc,argv);

Modified: trunk/projects/DocumentationGenerator/testParser10.C
===================================================================
--- trunk/projects/DocumentationGenerator/testParser10.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/testParser10.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -39,8 +39,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs")
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
   // Build the AST used by ROSE
      SgProject* sageProject = frontend(argc,argv);

Modified: trunk/projects/DocumentationGenerator/testParser11.C
===================================================================
--- trunk/projects/DocumentationGenerator/testParser11.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/testParser11.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -32,8 +32,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
   // Build the AST used by ROSE
      SgProject* sageProject = frontend(argc,argv);

Modified: trunk/projects/DocumentationGenerator/testParser12.C
===================================================================
--- trunk/projects/DocumentationGenerator/testParser12.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/projects/DocumentationGenerator/testParser12.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -17,8 +17,8 @@
 
 int main( int argc, char * argv[] ) 
    {
-     CommandlineProcessing::addSourceFileSuffix(".docs");
-     CommandlineProcessing::addSourceFileSuffix(".h");
+     CommandlineProcessing::addCppSourceFileSuffix("docs");
+     CommandlineProcessing::addCppSourceFileSuffix("h");
 
      char **newArgv = new char*[argc+2];
      newArgv[0] = argv[0];

Modified: trunk/src/frontend/BinaryDisassembly/RoseBin.cpp
===================================================================
--- trunk/src/frontend/BinaryDisassembly/RoseBin.cpp	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/frontend/BinaryDisassembly/RoseBin.cpp	2008-10-18 20:03:41 UTC (rev 89)
@@ -424,7 +424,7 @@
     std::cerr << " no assembly language specified. " << endl;
     std::cerr << " use RoseBin_support::setAssemblyLanguage(string) " << endl;
     std::cerr << " options : arm, x86 " << endl;
-    exit(0);
+    abort();
   }
 
   ROSE_ASSERT(globalNode);

Modified: trunk/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp
===================================================================
--- trunk/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/frontend/BinaryDisassembly/RoseBin_DB_IDAPRO.cpp	2008-10-18 20:03:41 UTC (rev 89)
@@ -449,7 +449,7 @@
     return createArmInstruction(address, mnemonic);
   } else {
     cerr << " no assembly language selected! " << endl;
-    exit(0); 
+    abort();
   }
 
   // *************************************************************

Modified: trunk/src/frontend/BinaryDisassembly/RoseBin_IDAPRO_buildTree.cpp
===================================================================
--- trunk/src/frontend/BinaryDisassembly/RoseBin_IDAPRO_buildTree.cpp	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/frontend/BinaryDisassembly/RoseBin_IDAPRO_buildTree.cpp	2008-10-18 20:03:41 UTC (rev 89)
@@ -67,7 +67,7 @@
           //cout << " children are : " << child << " -- " << exprTree.symbol << endl;
         }
         
-        exit(0);
+        abort();
       }
       SgAsmExpression* child = *(children->begin());
       ROSE_ASSERT(RoseAssemblyLanguage==x86);

Modified: trunk/src/frontend/BinaryDisassembly/RoseBin_file.cpp
===================================================================
--- trunk/src/frontend/BinaryDisassembly/RoseBin_file.cpp	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/frontend/BinaryDisassembly/RoseBin_file.cpp	2008-10-18 20:03:41 UTC (rev 89)
@@ -185,7 +185,7 @@
     return createArmInstruction(address, mnemonic);
   } else {
     cerr << " no assembly language selected! " << endl;
-    exit(0); 
+    abort(); 
   }
 
   // *************************************************************
@@ -339,7 +339,7 @@
       } else {
 	if (i_func!=-1) {
 	  cerr << " ERROR :: could not append instruction to function : " << endl;
-	  //exit(0);
+	  //abort();
 	}
       }
       

Modified: trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-apple-darwin9.5.0-646e04576d4266880b4066826540b2ae.tar.gz
===================================================================
(Binary files differ)

Modified: trunk/src/frontend/CxxFrontend/roseBinaryEDG-i686-pc-linux-gnu-646e04576d4266880b4066826540b2ae.tar.gz
===================================================================
(Binary files differ)

Modified: trunk/src/frontend/CxxFrontend/roseBinaryEDG-x86_64-pc-linux-gnu-646e04576d4266880b4066826540b2ae.tar.gz
===================================================================
(Binary files differ)

Modified: trunk/src/frontend/SageIII/sageSupport.C
===================================================================
--- trunk/src/frontend/SageIII/sageSupport.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/frontend/SageIII/sageSupport.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -34,7 +34,7 @@
 
   // printf ("In outputTypeOfFileAndExit(%s): Evaluate the file type \n",name.c_str());
 
-#if 0
+#if 1
   // I could not get this code to work for me, so I just used something internally built on the system command (that has some security checking).
 
   // Use file(1) to try to figure out the file type to report in the exception
@@ -44,34 +44,34 @@
 
      printf ("pid = %d \n",pid);
 
-     if (0 == pid)
-        {
-          close(0);
-          dup2(child_stdout[1], 1);
-          close(child_stdout[0]);
-          close(child_stdout[1]);
-          execlp("file", "file", "-b", name.c_str(), NULL);
-          exit(1);
-        }
-       else
-        {
-          if (pid > 0)
-             {
-               char buf[4096];
-               memset(buf, 0, sizeof buf);
-               read(child_stdout[0], buf, sizeof buf);
-               buf[sizeof(buf)-1] = '\0';
-               if (char *nl = strchr(buf, '\n')) *nl = '\0'; /*keep only first line w/o LF*/
-               waitpid(pid, NULL, 0);
-               char mesg[64+sizeof buf];
-               sprintf(mesg, "unrecognized file format: %s", buf);
-               throw SgAsmGenericFile::FormatError(mesg);
-             }
-            else
-             {
-               throw SgAsmGenericFile::FormatError("unrecognized file format");
-             }
-        }
+     if (pid == -1) { // Error
+        perror("fork: error in outputTypeOfFileAndExit ");
+        exit (1);
+     } if (0 == pid)
+     {
+       close(0);
+       dup2(child_stdout[1], 1);
+       close(child_stdout[0]);
+       close(child_stdout[1]);
+       execlp("/usr/bin/file", "/usr/bin/file", "-b", name.c_str(), NULL);
+       exit(1);
+     }
+     else
+       {
+         int status;
+         if (waitpid(pid, &status, 0) == -1) {
+           perror("waitpid");
+           abort();
+         }
+
+         char buf[4096];
+         memset(buf, 0, sizeof buf);
+         read(child_stdout[0], buf, sizeof buf);
+         std::string buffer(buf);
+         buffer =  name+ " unrecognized file format: " + buffer;
+
+         throw SgAsmGenericFile::FormatError(buffer.c_str());
+       }
 #else
   // Call the Unix "file" command, it would be great if this was an available 
   // system call (but Robb thinks it might not be available).
@@ -94,7 +94,7 @@
 
   // printf ("\n\nExiting: Unknown file Error \n\n");
   // ROSE_ASSERT(false);
-     exit(0);
+     abort();
 #endif
    }
 

Modified: trunk/src/util/commandlineProcessing/commandline_processing.C
===================================================================
--- trunk/src/util/commandlineProcessing/commandline_processing.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/util/commandlineProcessing/commandline_processing.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -6,7 +6,7 @@
 
 #include "string_functions.h"
 #include <string.h>
-
+#include <iostream>
 #include "commandline_processing.h"
 
 // Use Brian Gunney's String List Assignent (SLA) library
@@ -16,6 +16,8 @@
 // effect the users application (just not in header files).
 using namespace std;
 
+Rose_STL_Container<std::string> CommandlineProcessing::extraCppSourceFileSuffixes;
+
 #if 0
 // DQ (10/6/2008): (comment added) This function is replaced by:
 // "bool CommandlineProcessing::isOptionTakingSecondParameter( string argument )"
@@ -581,7 +583,13 @@
      validSourceFileSuffixes.push_back(suffix);
    }
 
+void
+CommandlineProcessing::addCppSourceFileSuffix ( const string &suffix )
+   {
+     extraCppSourceFileSuffixes.push_back(suffix);
+   }
 
+
 //Rama 
 //Also refer to the code in functions isCppFileNameSuffix  Dan and I added in StringUtility
 //For now define CASE_SENSITIVE_SYSTEM to be true, as we are currently a UNIXish project.
@@ -653,6 +661,12 @@
 #endif
           returnValue = true;
 
+     if(find(extraCppSourceFileSuffixes.begin(), extraCppSourceFileSuffixes.end(),suffix) != extraCppSourceFileSuffixes.end())
+     {
+       returnValue = true;
+     } 
+
+     
      return returnValue;
    }
 

Modified: trunk/src/util/commandlineProcessing/commandline_processing.h
===================================================================
--- trunk/src/util/commandlineProcessing/commandline_processing.h	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/src/util/commandlineProcessing/commandline_processing.h	2008-10-18 20:03:41 UTC (rev 89)
@@ -21,6 +21,8 @@
        //! All matching inputprefix:option in argList are also removed.   
           Rose_STL_Container<std::string> generateOptionWithNameParameterList ( Rose_STL_Container<std::string> & argList, std::string inputPrefix );
 
+          extern Rose_STL_Container<std::string> extraCppSourceFileSuffixes;
+
        //! Search 'argv' for an option like optionPrefix:option, remove the option if 'removeOption' is true.
        /*! 
         The argument 'option' adds () to the actual option, and allows the |(OR) operations.For example: 
@@ -53,6 +55,8 @@
        // DQ and PC (6/1/2006): Added Peter's suggested fixes to support auto-documentation.
       //! Add another valid source file suffix
           void addSourceFileSuffix ( const std::string &suffix );
+          void addCppSourceFileSuffix ( const std::string &suffix );
+
           bool isSourceFilename ( std::string name ); 
 
           bool isObjectFilename ( std::string name );
@@ -86,7 +90,7 @@
 
           void initSourceFileSuffixList();
           static Rose_STL_Container<std::string> validSourceFileSuffixes;
-
+          
           void initObjectFileSuffixList();
           static Rose_STL_Container<std::string> validObjectFileSuffixes;
 

Modified: trunk/tests/roseTests/programAnalysisTests/defUseAnalysisTests/runTest.C
===================================================================
--- trunk/tests/roseTests/programAnalysisTests/defUseAnalysisTests/runTest.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/tests/roseTests/programAnalysisTests/defUseAnalysisTests/runTest.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -45,7 +45,7 @@
     cout << "\n------------------------\nchecking for " << name << " -- " << funcName << " -- " << nodeNr << endl;
     if (maxNodes!=nrOfNodes) {
       cout << " Error: Test should have " << nrOfNodes << " nodes. found: " << maxNodes << endl;
-      exit(1);
+      abort();
     }
     cout << " Test has nodes:  " << nrOfNodes <<  endl;
 

Modified: trunk/tutorial/defuseAnalysis.C
===================================================================
--- trunk/tutorial/defuseAnalysis.C	2008-10-17 21:11:10 UTC (rev 88)
+++ trunk/tutorial/defuseAnalysis.C	2008-10-18 20:03:41 UTC (rev 89)
@@ -45,7 +45,7 @@
     cout << "\n------------------------\nchecking for " << name << " -- " << funcName << " -- " << nodeNr << endl;
     if (maxNodes!=nrOfNodes) {
       cout << " Error: Test should have " << nrOfNodes << " nodes. found: " << maxNodes << endl;
-      exit(0);
+      abort();
     }
     cout << " Test has nodes:  " << nrOfNodes <<  endl;
 



More information about the Rose-commits mailing list