JABA Developers' Resources

As an alternative, it is possible to create a resource file using the JABA GUI, as described below.

Running JABA through the provided drivers

After setting up the environment and having the subject ready (together with the corresponding resource file), the drivers provided with the distribution can be run.

Textual driver

To run the textual driver, simply execute

jaba <resource file>

For example, you can analyze the test program provided with the distribution as follows:

jaba test.rc

GUI driver

The GUI driver can be run in two ways:
  • Using a resource file:
  • jabaGUI <resourcefile>

    In this case, the driver first performs the analysis and then provides the user with an interface that allows for visualizing some of the graphs built by JABA, such as CFGs and ICFGs, using DOTTY. (Dotty is a graph layouting and visualizing program provided by AT&T research. It is a free software and can be downloaded from Graphvizsite at AT&T.)
    For example, you can analyze the test program provided with the distribution as follows:

    jabaGUI test.rc

    and see the ICFG for the program by pressing the "ICFG" button (and suitably zooming-out in the dotty window...)

  • Without a resource file:
  • jabaGUI

    In this case, the GUI allows the user to graphically browse the directory structure to specify the CLASSPATH and the set of classes to be analyzed. Once the selection has been performed, the user can save the information in a resource file, for future reuse, perform the analysis, and visualize different graphs as described at the previous point.

    It is possible to specify some options for the GUI driver by creating a file named .jabarc in the current working directory directory. A sample file is provided with the distribution (file jabarc.sample) in directory ${HOME}/JABA. The format of the file is as follows:
    # jaba.workingDirectory
    # Sets the working directory for Jaba
    # this will be the start directory for all
    # file selection dialogs.
    #
    # Default: user's home directory
    #
    jaba.workingDirectory = /home/orso/Students/MohamedMansour/Examples

    # jaba.useSystemClassPath
    # Appends the users CLASSPATH to the Class
    # Path List
    jaba.useSystemClassPath = false

    # jaba.classPath
    # List of initial class paths
    # This list will be appended to the
    # Class Path list on startup
    jaba.classPath = /home/orso/java/lib/jdk1.4

    # dotty.outpath
    # Directory for .dotty file
    # Default: current directory
    dotty.outpath = /home/orso/jaba/dottyStuff

    Building your custom analysis application

    Copying and modifying the driver

    Because JABA is an API, to use the system for your analyses or application, you must write a driver to invoke the functionality and query the analysis information. To write a driver, create a subclass of jaba.main.JABADriver and redefine method run(). A sample driver, which can be used as a starting point, is provided in ${HOME}/JABA/src/JABA.java. The driver contains some sample queries and can be copied and modified to create your own driver. For example:
    
    cd ${HOME}/JABA
    cp src/JABA.java src/myJABA.java
    
    
    Now, edit your copy of the driver to compute the desired analysis information. Remeber to change the name of the class from JABA to whatever name you chose for the driver---myJABA in the above example. The javadoc documentation of the interface of JABA is included in the distribution, in the directory ${HOME}/JABA/doc/javadoc

    Visualizing the analysis graphs in JABA

    JABA provides a facility to visualize the graphs like ICFG, ACFG etc, that are produced during the program analysis. The graphs can be output to files. These graphs can be visualized with DOTTY. (The GUI driver uses this facility to display graphs.)

    Any explicit graph can be output in the dotty format by calling the function createDottyFile. createDottyFile is a method of the Graph class. It takes two arguments. The first one is a string indicating the name of the file where the graph has to written. The second one is a class specifying the paramaters of the output graph.

    Presently, JABA allows specifying the parameters of the nodes of the graph. The user can output any combination of the following node specification parameters.

    User can specify any combination of these parameters to be written. This can be done by specifying the parameters in the resource file. To specify the parameters in the resource file, you need to add the following line in the resource file.
    DottyOutputParameters = NODE_NUMBER: STATEMENT_NUMBER: BYTECODE_OFFSET: NODE_TYPE
    Include each of the parameter name if you want it to be output in the node of the graph. For eample if you need to output only Node Number and Node type then include DottyOutputParameters = NODE_NUMBER: NODE_TYPE in the resource file. If the statement is not included in the resource file, JABA outputs all the parameters as default

    Compiling the driver

    To compile the driver, you just need to execute, with the CLASSPATH set correctly.

    javac ${HOME}/JABA/src/myJABA.java

    Running your custom analyzer

    First, add to the CLASSPATH, before the jaba.jar entry, the path to your local classes. For example, for the myJABA driver, you would need to add ${HOME}/JABA/src to the CLASSPATH:

    setenv CLASSPATH ${HOME}/JABA/src:${CLASSPATH}

    On the command line, run the driver you modified followed by the name of the resource file that you created. For the analysis to succeed, it is important to increase the amount of memory used by the JVM, using the -mx option:

    java -mx1000m jaba.main.JABADriver myJABA <resource file>

    Reporting a bug in JABA

    We have an automated bug-tracking system to report and keep track of bugs in JABA. Problem reports and enhancement requests can be submitted on-line at http://measure.cc.gt.atl.ga.us/sis/.
    When reporting a problem, please provide the following information: