In addition to providing a set of ROSE specific widgets, the roseQtWidgets library provides some 'advanced' functionality which might be helpful in writing a GUI for your ROSE-project.
The roseQtWidgets library was designed with the idea of having a general GUI for ROSE, which is also able to do project management ( add/remove files from an existing SgProject ), management of AST-Annotators, and has support for mapping between a source and binary AST.
These additional features of the roseQtWidget library, which are used in the RoseQt GUI are described here.
Central (singleton) class for managing SgProjects.
View of the ProjectManager
Singleton class for management of SgProject's is derived from ItemTreeNode because it's also used for displaying a project-tree in ProjectView
- Singleton class, call instance()
- the project manager needs two extern widgets for displaying information before you can call any other functions, set theses two widgets: setTaskListWidget() and setTaskMsgOutputWidget
- the ProjectManager has a list of multiple Projects, you can get them by calling getProject()
- See also:
TaskList and TaskOutput-Widget:
The QRoseComponentProxy class was implemented for using QRose widgets in the RoseQt GUI. So it is possible to link QRose widgets to other RoseQt widgets.
The RoseQt Gui uses the AST annotation mechanism to implement certain features. It supports the display of MetricAttributes (Kiviat diagram, and coloring of RoseTreeView 's) and uses annotation-objects to store a mapping between source and binary AST's . Thats why some annotators are part of the qt library, even if they do not depend on any Qt functionality. If more annotators for metric attributes are written, it would be a good idea to create a separate project for the annotation. This project than could implement a general framework for AST annotation which then can also handle dependencies between annotators. (For example some MetricAttribute annotator may want to use the Binary-Source mapping i.e. would depend on the mapping annotator).
Currently the annotation happens in RoseFrontendTask, the Flop instruction annotator is executed by default, the PIN annotation takes place when a file with the same name as the sourcefile, but with the ending .pin , exists. The AsmToSourceMapper is also executed by default and relies on the fact, that all files added to a project are related.
A convenient way to see which attributes are annotated to which node, is to use the AstBrowserWidget connected to a NodeInfoWidget (which can display the annotation objects).
Implemented in AsmToSourceMapper :
Creates Annotation with mapping: Source AST <-> Binary AST using dwarf information.
This annotator is based on a pin-tool which you can find in
Create a new AsmToSourceMapper object for every binary file, and add the sourcefile via addFile(). This class uses dwarf information which is included in the binary if it was compiled with the
-g option. The annotation is stored in the AST as annotation objects i.e. AstBinaryNodeLink / AstSourceNodeLink
For instructions how to use and compile pin-tools see the IntelPin documentation.
This pin-tool counts how often every annotation was executed and writes this information to a file called
itrace.pin . It has a very simple format: each line represents an instruction, and has first the address of the instruction, then separated by whitespaces how often this instruction was executed. Rename that file to YourBinaryName.pin and put it in the same folder as your binary. Then, when you load this binary in the RoseQt gui the annotation is done automatically (see RoseFrontendTask).
Implemented in FlopCounter
Annotates the AST with information of FLOP operations.
Counts the occurances of FLOP operations like, assignments, additions, multiplies etc. and annotates them as MetricAttributes
Usage example for annotation:
The Metrics system provides functionality for normalizing AstAttributes and a common interface for all widgets which use the metric attributes.
Generated on Tue Sep 15 14:48:47 2009 for RoseQtWidgets by