FR-V/FR FAMILY SOFTUNE C/C++ ANALYZER …..."ANSI standard" in this manual). Those C-language...
Transcript of FR-V/FR FAMILY SOFTUNE C/C++ ANALYZER …..."ANSI standard" in this manual). Those C-language...
FUJITSU SEMICONDUCTOR
CONTROLLER MANUAL
FR-V/FR FAMILY
SOFTUNE C/C++ ANALYZER MANUALfor V5
CM81-00309-4E
FR-V/FR FAMILY
SOFTUNE C/C++ ANALYZER MANUALfor V5
FUJITSU LIMITED
PREFACE
� Purpose and Intended Reader
The Softune C/C++ Language Analyzer (simply called the "C/C++ Analyzer" in this manual) is adevelopment support tool for embedded microcontrollers. The C/C++ Analyzer displays andprints the structure of a source program written in the C/C++ language and the status of databeing used by the program.
The C Analyzer runs Windows XP, Windows Me, Windows 2000, Windows 98 and Windows NT 4.0.
This manual explains the functions of the C/C++ Analyzer and how to use it.
This manual is intended for persons using the C/C++ Analyzer to analyze the source programswritten in the C/C++ language.
The C/C++ Analyzer can only analyze C-language programs that conform to the AmericanNational Standard for Information System Programming Language C, X3. 159-1989 (called the"ANSI standard" in this manual). Those C-language programs partially meet ISO/IEC 14882:1998.
Readers of this manual must be familiar with the basic operation of Windows XP, Windows Me,Windows 2000, Windows 98 or Windows NT 4.0 and must have basic knowledge of the Clanguage specification.
For the C/C++ language specifications, refer to the Programming Language CJIS X 3010-1993or a reference book meeting ANSI standards.
� Trademarks
SOFTUNE is a trademark of FUJITSU LIMITED.
Microsoft, Windows, Windows NT, and MS-DOS are registered trademarks of MicrosoftCorporation in the U.S. and other countries.
The names of products and systems appearing in this manual are trademarks or registeredtrademarks of their respective companies.
� Structure of This Manual
This manual consists of the following 24 chapters and an appendix:
CHAPTER 1 "OVERVIEW"
This chapter outlines the analysis of a source program in the C/C++ language with the C/C++ Analyzer.
CHAPTER 2 "ANALYSIS PROCEDURE"
This chapter explains the procedure for analyzing a source program written in the C/C++language with the C/C++ Analyzer.
CHAPTER 3 "PROJECT"
This chapter explains how to create and operate a project.
CHAPTER 4 "FILE"
This chapter explains how to create and operate a file.
i
CHAPTER 5 "ANALYZE"
This chapter describes details on source program analysis using this system.
CHAPTER 6 "EDIT"
This chapter explains how to operate the Analyze functions.
CHAPTER 7 "VIEW"
This chapter explains how to operate the View functions.
CHAPTER 8 "COMPILE"
This chapter explains the Compile functions.
CHAPTER 9 "CHECK"
This chapter explains the check feature.
CHAPTER 10 "GROBAL INFORMATION"
This chapter explains the operation of global information.
CHAPTER 11 "SETUP"
This chapter explains the setup operation.
CHAPTER 12 "WINDOWS"
This chapter explains window display and operation.
CHAPTER 13 "HELP"
This chapter explains the display and operation of the help function.
CHAPTER 14 "GRAPH FLOW"
This chapter explains the display and operation of a graph flow.
CHAPTER 15 "CALL TREE"
This chapter explains the display and operation of a call tree.
CHAPTER 16 "CLASS INFORMATION"
This chapter explains the display and operation of class information.
CHAPTER 17 "NAME SPACE"
This chapter explains the display and operation of the name space information.
CHAPTER 18 "LOGIC FLOW"
This chapter explains how to display and operate Logic Flow
CHAPTER 19 "SUMMARY"
This chapter explains how to display and operate Summary
CHAPTER 20 "CROSS REFERENCE"
This chapter explains how to display and operate Cross Reference.
CHAPTER 21 "PROGRAM EDITING"
This chapter explains how to start the standard editor and how to edit the program.
CHAPTER 22 "MAX USED STACK"
This chapter will explain how to display and operate the max used stack.
CHAPTER 23 "USED STACK INFORMATION"
This chapter explains used stack information and max used stack.
ii
CHAPTER 24 "PRINTING"
This chapter explains the printing operation and features
"APPENDIX"
This appendix explains problems that may occur during the use of Softune C/C++ Analyzer.
� Reference Documents
THE C PROGRAMMING LANGUAGE (Brian W. Kernighan & Dennis M. Ritchie)
American National Standard for Infornmation Systems - Programming Language C, X3. 159-1989
The Annotated Reference Manual (Addison-Wesley Publishing Company, Inc.)
The Programming Language C++ Third Edition (Addison-Wesley Publishing Company, Inc.)
ISO/IEC 14882:1998
iii
©2002 FUJITSU LIMITED Printed in Japan
• The contents of this document are subject to change without notice. Customers are advised to consultwith FUJITSU sales representatives before ordering.
• The information and circuit diagrams in this document are presented as examples of semiconductordevice applications, and are not intended to be incorporated in devices for actual use. Also, FUJITSU isunable to assume responsibility for infringement of any patent rights or other rights of third partiesarising from the use of this information or circuit diagrams.
• The products described in this document are designed, developed and manufactured as contemplatedfor general use, including without limitation, ordinary industrial use, general office use, personal use, andhousehold use, but are not designed, developed and manufactured as contemplated (1) for useaccompanying fatal risks or dangers that, unless extremely high safety is secured, could have a seriouseffect to the public, and could lead directly to death, personal injury, severe physical damage or otherloss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, masstransport control, medical life support system, missile launch control in weapon system), or (2) for userequiring extremely high reliability (i.e., submersible repeater and artificial satellite). Please note that Fujitsu will not be liable against you and/or any third party for any claims or damagesarising in connection with above-mentioned uses of the products.
• Any semiconductor devices have an inherent chance of failure. You must protect against injury, damageor loss from such failures by incorporating safety design measures into your facility and equipment suchas redundancy, fire protection, and prevention of over-current levels and other abnormal operatingconditions.
• If any products described in this document represent goods or technologies subject to certainrestrictions on export under the Foreign Exchange and Foreign Trade Law of Japan, the priorauthorization by Japanese government will be required for export of those products from Japan.
iv
READING THIS MANUAL
� Product Names
In this manual and this product, product names are designated as follows:
SOFTUNE is designated as Softune.
The Microsoft® Windows® 98 operating system is abbreviated to Windows 98.
The Microsoft® Windows® Millennium Edition operating system is abbreviated to Windows Me.
The Microsoft® Windows NT® Workstation operating system Version 4.0 and the Microsoft®
Windows NT® Server network operating system Version 4.0 are abbreviated to Windows NT 4.0.
Microsoft® Windows® 2000 Professional operating system is abbreviated to Windows 2000.
Microsoft® Windows® XP Professional operating system is abbreviated to Windows XP.
� Note on Descriptions
The examples of windows and screens shown in this manual are those displayed when the C/C++ Analyzer operates on Windows 2000. Actual windows and screens may vary dependingon the operating system, environment, computer model, and display resolution.
v
vi
CONTENTS
CHAPTER 1 OVERVIEW ................................................................................................... 11.1 What Is the C/C++ Analyzer? ................................................................................................................ 21.2 Window Configuration ............................................................................................................................ 31.3 Basic Functions ..................................................................................................................................... 9
1.3.1 Project ............................................................................................................................................ 111.3.2 File .................................................................................................................................................. 131.3.3 Analyze ........................................................................................................................................... 141.3.4 Edit ................................................................................................................................................. 151.3.5 View ................................................................................................................................................ 161.3.6 Compile .......................................................................................................................................... 181.3.7 Setup .............................................................................................................................................. 201.3.8 Window ........................................................................................................................................... 211.3.9 Help ................................................................................................................................................ 22
1.4 Display Functions ................................................................................................................................ 231.4.1 Class Information ............................................................................................................................ 251.4.2 Name Space ................................................................................................................................... 271.4.3 Call Tree ......................................................................................................................................... 281.4.4 Graph Flow ..................................................................................................................................... 291.4.5 Logic Flow ...................................................................................................................................... 301.4.6 Summary Information ..................................................................................................................... 311.4.7 Cross Reference Information .......................................................................................................... 321.4.8 Global Information .......................................................................................................................... 331.4.9 Program Editing .............................................................................................................................. 341.4.10 Max Used Stack ............................................................................................................................. 361.4.11 Candidate for Inline Function .......................................................................................................... 371.4.12 Candidate for Const Declaration .................................................................................................... 381.4.13 Printing ........................................................................................................................................... 39
CHAPTER 2 ANALYSIS PROCEDURE ........................................................................... 412.1 Starting the C/C++ Analyzer ................................................................................................................ 422.2 Terminating the C/C++ Analyzer ......................................................................................................... 432.3 Windows .............................................................................................................................................. 442.4 Menus on Window ............................................................................................................................... 462.5 Creating a Project ................................................................................................................................ 482.6 Setting Analysis Options ...................................................................................................................... 50
2.6.1 General Mode ................................................................................................................................. 512.6.2 C/C++ options ................................................................................................................................. 522.6.3 Maximum Number of Statements in an Inline Function .................................................................. 542.6.4 Project Setup .................................................................................................................................. 55
2.7 Analyzing Source Programs ................................................................................................................ 562.8 Displaying Analysis Results ................................................................................................................. 572.9 Analysis Result Data File ..................................................................................................................... 58
vii
CHAPTER 3 PROJECT ................................................................................................... 593.1 Project Menu ....................................................................................................................................... 603.2 Creating a New Project ....................................................................................................................... 623.3 Opening a Project ............................................................................................................................... 643.4 Saving a Project .................................................................................................................................. 653.5 Updating Dependence ........................................................................................................................ 663.6 Printing ................................................................................................................................................ 673.7 Print Preview ....................................................................................................................................... 683.8 Printer Setup ....................................................................................................................................... 69
CHAPTER 4 FILE ............................................................................................................. 714.1 File Menu ............................................................................................................................................ 724.2 Creating a New File ............................................................................................................................ 734.3 Opening a File ..................................................................................................................................... 744.4 Saving a File ....................................................................................................................................... 754.5 Adding or Deleting a File ..................................................................................................................... 76
CHAPTER 5 ANALYZE ................................................................................................... 795.1 Analyze Menu ..................................................................................................................................... 805.2 Setting Analysis Options ..................................................................................................................... 81
5.2.1 General Mode ................................................................................................................................ 835.2.2 C/C++ Options ............................................................................................................................... 845.2.3 Maximum Number of Statements in an Inline Function ................................................................. 865.2.4 Pre-processor ................................................................................................................................ 87
CHAPTER 6 EDIT ............................................................................................................ 916.1 Edit Menu ............................................................................................................................................ 92
CHAPTER 7 VIEW ........................................................................................................... 977.1 View Menu .......................................................................................................................................... 987.2 Tool Bar ............................................................................................................................................ 1007.3 Status Bar ......................................................................................................................................... 1017.4 Project Window ................................................................................................................................. 1027.5 Analysis Message Window ............................................................................................................... 1047.6 Analysis Information (Graph Flow) .................................................................................................... 1067.7 Analysis Information (Tree View) ...................................................................................................... 1087.8 Class Information .............................................................................................................................. 1107.9 Name Space ..................................................................................................................................... 1127.10 Function List ...................................................................................................................................... 1137.11 Max Used Stack ................................................................................................................................ 1157.12 Find ................................................................................................................................................... 116
CHAPTER 8 COMPILE .................................................................................................. 1198.1 Compile Menu ................................................................................................................................... 1208.2 Setting Options for fcc911s ............................................................................................................... 121
8.2.1 Detailed Options for Preprocessor (fcc911s Compiler) ................................................................ 1248.2.2 Detailed Options for Language Specifications (fcc911s Compiler) .............................................. 1288.2.3 Detailed Options for Optimization (fcc911s Compiler) ................................................................. 130
viii
8.2.4 Detailed Options for Output (fcc911s Compiler) ........................................................................... 1328.3 Setting Options for fcc935s ................................................................................................................ 134
8.3.1 Detailed Options for Preprocessor (fcc935s Compiler) ................................................................ 1378.3.2 Detailed Options for Language Specifications (fcc935s Compiler) .............................................. 1418.3.3 Detailed Options for Optimization (fcc935s Compiler) .................................................................. 1438.3.4 Detailed Options for Output (fcc935s Compiler) ........................................................................... 146
8.4 Setting up ANSI C/C++ Compiler Options ......................................................................................... 148
CHAPTER 9 CHECK ...................................................................................................... 1519.1 Check Menu ....................................................................................................................................... 1529.2 Displaying Inline Expansion Candidate Function ............................................................................... 153
CHAPTER 10 GLOBAL INFORMATION ......................................................................... 15510.1 Selecting Global Information .............................................................................................................. 15610.2 Displaying Global Variable Information .............................................................................................. 15710.3 Pointing to const-Type Qualification Declaration Candidate .............................................................. 15810.4 Pop-up Menu of Global Information ................................................................................................... 15910.5 Searching for Text ............................................................................................................................. 160
CHAPTER 11 SETUP ....................................................................................................... 16111.1 Setup Menu ....................................................................................................................................... 16211.2 Editor Customization .......................................................................................................................... 16311.3 Environment of Compiler .................................................................................................................. 165
CHAPTER 12 WINDOWS ................................................................................................. 16712.1 [Window] Menu .................................................................................................................................. 168
CHAPTER 13 HELP ......................................................................................................... 16913.1 [Help] Menu ....................................................................................................................................... 170
CHAPTER 14 GRAPH FLOW .......................................................................................... 17114.1 Displaying Graph Flow ....................................................................................................................... 17214.2 Pop-up Menu of Graph Flow .............................................................................................................. 17414.3 Enlargement/Reduction Display ........................................................................................................ 17614.4 Focus Display .................................................................................................................................... 17814.5 Displaying Undefined Functions ........................................................................................................ 18014.6 Outputting Bitmap File ....................................................................................................................... 181
CHAPTER 15 CALL TREE ............................................................................................... 18315.1 Displaying Call Tree ........................................................................................................................... 18415.2 Call Tree Pop-up Menu ...................................................................................................................... 185
CHAPTER 16 CLASS INFORMATION ............................................................................ 18716.1 Displaying Class Information ............................................................................................................. 18816.2 Class Inheritance Diagram ................................................................................................................ 189
16.2.1 Enlargement/Reduction Display ................................................................................................... 19116.2.2 Focus Display ............................................................................................................................... 19316.2.3 Displaying Undefined Classes ...................................................................................................... 195
ix
16.2.4 Class Name List ........................................................................................................................... 19616.3 Class Statistical Information .............................................................................................................. 19716.4 Class Inheritance Information ........................................................................................................... 19916.5 Class Usage Information ................................................................................................................... 20016.6 Friend Information ............................................................................................................................. 201
CHAPTER 17 NAME SPACE .......................................................................................... 20317.1 Displaying Name Space Information ................................................................................................. 204
CHAPTER 18 LOGIC FLOW ........................................................................................... 20718.1 Selecting Logic Flow ......................................................................................................................... 20818.2 Display Logic Flow ............................................................................................................................ 20918.3 Logic Flow Pop-Up Menu .................................................................................................................. 211
CHAPTER 19 SUMMARY ................................................................................................ 21319.1 Selecting Summary ........................................................................................................................... 21419.2 Displaying Summary ......................................................................................................................... 21519.3 How to Measure and Use Complexity ............................................................................................... 21719.4 Summary Pop-up Menu .................................................................................................................... 21819.5 Searching for Text ............................................................................................................................. 219
CHAPTER 20 CROSS REFERENCE ............................................................................... 22120.1 Selecting Cross Reference ............................................................................................................... 22220.2 Displaying Cross Reference ............................................................................................................. 22320.3 Cross Reference Pop-up Menu ........................................................................................................ 22620.4 Searching for Text ............................................................................................................................. 228
CHAPTER 21 PROGRAM EDITING ................................................................................ 22921.1 Activate the Standard Editor ............................................................................................................. 23021.2 External Editor Setup ........................................................................................................................ 23121.3 Standard Editor Setup ....................................................................................................................... 23321.4 Standard Editor Pop-up Menu .......................................................................................................... 23621.5 Other Functions ................................................................................................................................ 238
CHAPTER 22 MAX USED STACK .................................................................................. 24122.1 Max Used Stack (Specified Function) ............................................................................................... 24222.2 Max Used Stack (All Functions) ........................................................................................................ 24322.3 Max Used Stack Route (Specified Function) .................................................................................... 24422.4 Max Used Stack Route (All Functions) ............................................................................................. 24522.5 Max Used Stack Route Focus .......................................................................................................... 246
CHAPTER 23 USED STACK INFORMATION ................................................................. 24723.1 Calculating Max Used Stack ............................................................................................................. 24823.2 Limitations on the Max Used Stack ................................................................................................... 24923.3 Creating a Stack Information File ...................................................................................................... 250
CHAPTER 24 PRINTING ................................................................................................. 25524.1 Printing the Analysis Window ............................................................................................................ 256
x
APPENDIX .......................................................................................................................... 259APPENDIX A TROUBLESHOOTING .......................................................................................................... 260
INDEX ...................................................................................................................................271
xi
xii
CHAPTER 1 OVERVIEW
This chapter outlines the analysis of a source program in the C/C++ language with the C/C++ Analyzer.
1.1 "What Is the C/C++ Analyzer?"
1.2 "Window Configuration"
1.3 "Basic Functions"
1.4 "Display Functions"
1
CHAPTER 1 OVERVIEW
1.1 What Is the C/C++ Analyzer?
The C/C++ Analyzer is a tool to display and print the structure of a source program written in the C/C++ language and the status of data being used by the program. This tool provides information that can be effectively used to increase program development and code efficiency in object programs. This tool also conforms to the embedded feature of the FR-V/FR Family Softune C/C++ Compiler.
� Effects of C/C++ Analyzer
The C/C++ Analyzer can respond to the following user demands:
• The user wants to examine the structure and processing contents of a program of whichinternal processing is unknown.
• The user wants to create a structured program and obtain an understanding of its structureand processing logic.
• Before modifying a program, the user wants to examine the range of the effect ofmodification.
• The user wants to create documents for a program.
• The user wants to create a embedded application program that is highly efficient in the useof codes.
2
1.2 Window Configuration
1.2 Window Configuration
This section explains the window configuration of the C/C++ Analyzer. The C/C++ Analyzer has the following six types of window:• Main window• Project window• Analysis message window• Analysis window• Edit window• Dialog box
� Main Window
When the C/C++ Analyzer is started, the main window is first opened. All other windows will bedisplayed on the main window when opened.
Figure 1.2-1 "Example of Main Window" shows an example of the main window on which theproject window and the message window is displayed.
Figure 1.2-1 Example of Main Window
3
CHAPTER 1 OVERVIEW
� Project Window
The C/C++ Analyzer analyzes the source programs that are managed by the projectmanagement function. The C/C++ Analyzer also manages the stack information files created bya Fujitsu’s compiler.
For details on the project window, see Section 7.4 "Project Window".
Figure 1.2-2 "Example of Project Window" shows an example of the project window on whichsource programs are listed.
Figure 1.2-2 Example of Project Window
4
1.2 Window Configuration
� Analysis Message Window
The C/C++ Analyzer displays analysis messages while analyzing a source program. When theuser double-clicks on an analysis message, e.g., warning message, the relevant section of thesource program is displayed on the edit window enabling the user to easily modify the section.
For details on the analysis message window, see Section 7.5 "Analysis Message Window".
Figure 1.2-3 "Example of Analysis Message Window" shows an example of the analysismessage window on which analysis status is displayed.
Figure 1.2-3 Example of Analysis Message Window
5
CHAPTER 1 OVERVIEW
� Analysis Windows
After a source program is analyzed normally by the C/C++ Analyzer, the user can displayvarious types of analysis window.
For details on the analysis windows, see Section 7.6 "Analysis Information (Graph Flow)" andSection 7.7 "Analysis Information (Tree View)".
Figure 1.2-4 "Analysis Windows" shows an example of some analysis windows on display.
Figure 1.2-4 Analysis Windows
6
1.2 Window Configuration
� Edit Windows
The C/C++ Analyzer has some functions to edit source programs on edit windows. Each editwindow is opened when the user selects it to create a new text file or calls it from the analysismessage window.
For details on the edit windows, see CHAPTER 2 "ANALYSIS PROCEDURE".
Figure 1.2-5 "Edit Windows"shows an example of some edit windows on display.
Figure 1.2-5 Edit Windows
7
CHAPTER 1 OVERVIEW
� Dialog Box
Dialog boxes are used to set up analysis options and printing on the C/C++ Analyzer.
For details on each dialog box, see subsequent chapters.
Figure 1.2-6 "Dialog Box for Analysis Options" shows the dialog box for analysis options.
Figure 1.2-6 Dialog Box for Analysis Options
8
1.3 Basic Functions
1.3 Basic Functions
The C/C++ Analyzer has the basic functions listed below. This section provides an outline of each basic function in the following order:• Project• File• Analyze• Edit• View• Compile• Setup• Window• Help
� Project
The Project functions permit the user to manage C/C++ source files through the projectmanagement functions of the C/C++ Analyzer.
� File
The File functions permit the user to open C/C++ source and stack information files.
� Analyze
The Analyze functions permit the user to analyze the structure of a source program in aselected project and create analysis data.
� Edit
The Edit functions permit the user to edit character strings on various analysis windows andsource programs.
� View
The View functions permit the user to display various analysis windows based on analysis data.
� Compile
The Compile functions permit the user to compile a source program in a selected project.
� Setup
The Setup functions permit the user to customize the internal editor and set up the compilerenvironment.
� Window
The Window functions permit the user to change settings on various analysis windows.
9
CHAPTER 1 OVERVIEW
� Help
The Help functions permit the user to display the help files showing a functional outline of the C/C++ Analyzer and C/C++ Analyzer operation methods.
10
1.3 Basic Functions
1.3.1 Project
The Project functions permit the user to manage C/C++ source files through the project management functions of the C/C++ Analyzer.The project management functions include the following:• Creation of new projects• Management of existing projectsWith these functions, the user can manage source programs collectively.
� Project File
The extension code for a project file name is ".anp".
� New Project
The New Project function permits the user to create a new project. When New Project ischosen from the Project menu, the Project Name & Path dialog box appears. Specify the nameof the new project and the name of the folder to store the new project file in the dialog box.
� Open Project
The Open Project function permits the user to open an existing project. To select the existingproject to be opened, choose Open Project from the Project menu. The Select File dialog boxappears. Select the existing project file in the dialog box.
� Save Project
The Save Project function permits the user to save the currently opened project by writing itscontents over the project saved under the same name.
� Save Project As
The Save Project As function permits the user to save the currently opened project under a newname.
� Close Project
The Close Project function permits the user to close the currently opened project. If the projectis not saved, a message is displayed alerting the user of such status.
� Update Dependence
The Update Dependence function permits the user to also register the header file used by asource program newly registered in the same project.
The Print function displays a dialog box for printing settings. The range of printing and thenumber of print copies can be specifie.
11
CHAPTER 1 OVERVIEW
� Print Preview
The Print Preview function displays images of printed pages.
� Print Setup
The Print Setup function displays a dialog box to set up the printer.
� Quit C/C++ Analyzer
The Quit C/C++ Analyzer function terminates the C/C++ Analyzer. If a file is being edited in aproject when the Quit C/C++ Analyzer command is chosen from the Project menu, a messagedialog box appears asking if the file is to be saved.
12
1.3 Basic Functions
1.3.2 File
The File functions permits the user to file. The user can save and print modified files of source programs.
� New File
The New File function permits the user to create a new text file. The user can edit a sourceprogram, stack information, or document file.
This function opens an untitled file with the editor.
� Open File
The Open File function permits the user to open an existing file.
To open a file, choose Open File from the File menu. The Select File dialog box appears.Select the file to be opened from the list in the dialog box, and click the Open button.
� Add File in Project
The Add File in Project function permits the user to register files in an opened project. Toregister files, choose Add File in Project from the File menu. The Select File dialog boxappears. Select the files to be registered in the project from the list in the dialog box, and clickthe OK button.
� Delete File from Project
The Delete File from Project function permits the user to delete the files selected on the projectwindow. If no file is selected, this function deletes all files.
� Save File
The Save File function permits the user to save the currently opened file by writing its contentsover the file saved under the same name.
� Save File As
The Save File As function permits the user to save the currently opened file under a new name.This function is valid only when a file is currently opened.
13
CHAPTER 1 OVERVIEW
1.3.3 Analyze
The Analyze functions permit the user to analyze a source program statically and create the data required for display by the C/C++ Analyzer. The structure of the source program can be easily understood.
� Re-Analyze
The Re-Analyze function analyzes the source programs registered in a specified project.
� Analyze
The Analyze function analyzes only the modified source programs among the source programsregistered in a specified project.
� Interrupt
The Interrupt function cancels analysis operation. When the Interrupt command is chosen fromthe Analyze menu, a dialog box indicating cancellation of analysis operation appears.
This function is valid only while a source program is being analyzed by the Analyze or Re-Analyze function.
� Analysis Options
The Analysis Options function permits the user to set optional information for the analysis ofsource program. When the Analysis Options command is chosen from the Analyze menu, theAnalysis Options dialog box appears.
14
1.3 Basic Functions
1.3.4 Edit
The Edit functions permit the user to edit source programs and text files. The user can perform cut and paste operations for the file being edited.
� Copy
The Copy function copies the data selected on the currently displayed analysis or edit windowand saves the data on the clipboard.
� Select All
The Select All function permits the user to select all data on the currently displayed analysis oredit window and save the data on the clipboard. This function is valid only when an analysis oredit window is displayed.
� Undo
The Undo function cancels the previous file editing operation performed on the currentlydisplayed edit window and restores the relevant file to the status before the file editingoperation. This function is valid only when an edit window is displayed.
� Paste
The Paste function inserts the content of the clipboard in the position indicated by the cursor onthe currently displayed edit window. This function is valid only when an edit window isdisplayed.
� Cut
The Cut function cuts out the selected data and saves the data on the clipboard.
This function is valid only when an edit window is displayed by the internal editor.
� Find
The character sequence in the specified edit window is searched.
This function is valid only when an edit window is displayed by the internal editor.
� Replace
The character sequence in the specified edit window is searched and replaced.
This function is valid only when an edit window is displayed by the internal editor.
� Find in Files
It searches whether it is contained in the file specified by the specified character sequence. Areference result is displayed on an analysis message window.
This function is valid only when an edit window is displayed by the internal editor.
15
CHAPTER 1 OVERVIEW
1.3.5 View
The View functions permit the user to display or hide the tool bar and windows and customize each window and editor. With these functions, the user can freely set up the screen.
� Tool Bar
The Tool Bar function displays or hides the tool bar.
� Status Bar
The Status Bar function displays or hides the status bar.
� Project
The Project function displays or hides a project window.
� Message Bar
The Message Bar function displays or hides the analysis message bar.
� Analysis Information (Graph Flow)
The Analysis Information (Graph Flow) function displays a Graph Flow window.
This function is valid only when there is already an analysis data file created by the Analyze orRe-Analyze command in the Analyze menu.
� Analysis Information (Tree View)
The Analysis Information (Tree View) function displays a Call Tree window.
This function is valid only when a Graph Flow window is displayed.
� Class Hierarchy
The Class Hierarchy function displays a class inheritance diagram.
This function is valid only when a Graph Flow window is displayed.
� Class Name List
The Class Name List function displays a class list.
This function is valid only when a class inheritance diagram is displayed.
� Name Spaces
The Name Spaces function displays name space information.
This function is valid only when a Graph Flow window is displayed.
16
1.3 Basic Functions
� Name Space Contents
The Name Space Contents function displays name space contents.
This function is valid only when the name space information is displayed.
� Function List
The Function List function displays a function list.
This function is valid only when a Graph Flow window is displayed.
� Max Used Stack
The Max Used Stack function displays the information on maximum used stack on a GraphFlow window.
This function can be used only when a stack information file is already created using theCompile functions.
This function is valid only when a Graph Flow window is displayed.
� Max Used Stack Route
The Max Used Stack Route function displays the route to the maximum used stack on a GraphFlow window.
This function can be used only when a stack information file is already created using theCompile functions.
This function is valid only when a Graph Flow window is displayed.
� Find
The Find function permits the user to search data on a selected analysis window to find aspecified character string.
� Find Prev
The Find Prev function permits the user to search the data in a backward direction on a selectedanalysis window to find a specified character string.
This function is valid only when at least an analysis window is displayed.
� Find Next
The Find Next function permits the user to search the data in a forward direction on a selectedanalysis window to find a specified character string.
This function is valid only when at least an analysis window is displayed.
17
CHAPTER 1 OVERVIEW
1.3.6 Compile
The Compile functions permit the user to compile a source program. The following compilers can be selected:• fcc911s (compiler for the FR family) as the compiler to be used.• fcc935s (compiler for the FR-V family) as the compiler to be used.With the Compile functions, a stack information file required to control the maximum size stack can be created. The user must install fcc911s (compiler for the FR family) or fcc935s (compiler for the FR-V family) to use the Compile functions.
� Compilation-target Files
All the source programs registered in the currently displayed project are the targets ofcompilation.
� Start Compilation
The Start Compilation function starts compilation of the source programs registered in thecurrently displayed project.
� Interrupt Compilation
The Interrupt Compilation function cancels the compilation operation in progress. When theInterrupt Compilation command is chosen from the Compile menu, a dialog box indicatingcancellation of compilation operation appears.
This function is valid only while source programs are being compiled by the Start Compilationfunction.
� Option
The Option functions permits the user to set options for the complyer. The user can set teeoptions body and chech the options set.
❍ Target Compiler
This option specifies the type of compiler.
When ANSI is specified, fcc911s (compiler for FR family) is started in the full ANSI mode.
❍ Language
This option specifies the language for the messages to be output by the compiler.
❍ Chip Classification
The family name of MCU is specified.
❍ Optimization Level
This option specifies the level of compiler optimization.
18
1.3 Basic Functions
❍ Warning Level
This option specifies the level of warning on the compiler.
❍ Translation Controller
This option specifies the range of compilation.
❍ Target MCU
This option specifies hte type of MCU. It is possible to input cpu type manually.
❍ Output DEBUG information
This option specifies whether to output debug information to object files.
❍ Not reading default option file
This option specifies whether to use the default option file.
❍ Output STACK information
This option specifies whether to output the information on the used size of stack.
❍ Details
• Preprocessor: Specifies options for the preprocessor.
• Language: Specifies detailed options for language specifications.
• Optimization: Specifies detailed options for optimization.
• Output: Specifies detailed options for output.
❍ Other Option’s Description
This field permits the user to directly set other available options for the compiler.
❍ Confirm
This button permits the user to check the settings of compiler options.
19
CHAPTER 1 OVERVIEW
1.3.7 Setup
The Setup functions permit the user to set up the internal editor and the installation environment for the compiler.
� Editor Customize
The Editor Customize function permits the user to specify the editor (internal editor or your owneditor) to be used for editing.
If an edit window has already been displayed by the internal editor, a dialog box to customizethe internal editor appears when the Editor Customize command is chosen from the Setupmenu.
� Compilation Environment
The Compilation Environment function permits the user to set the path for the directory wherethe compiler environment in use has been installed. If the compiler environment has not beeninstalled, a dialog box indicating non-installation of compiler environment appears.
20
1.3 Basic Functions
1.3.8 Window
The Window functions permit the user to change the status of various analysis windows on display.
� Cascade
The Cascade function displays multiple windows that overlap.
� Tile Vertically
The Tile Vertically function arranges multiple windows in a row vertically.
� Tile Horizontally
The Tile Horizontally function arranges multiple windows in a row horizontally.
� Arrange Icons
The Arrange Icons function arranges iconized windows horizontally in a row at the bottom of themain window for the current application.
� Close All
The Close All function closes all analysis windows displayed.
� Window names 1, 2,...
The Window menu lists currently displayed analysis windows at the bottom.
The currently active window is indicated by a check mark at the top of its name. If the userwants to activate a window, select the name of the window in the list.
21
CHAPTER 1 OVERVIEW
1.3.9 Help
The Help functions permit the user to display the help files showing a functional outline of the C/C++ Analyzer and C/C++ Analyzer operation methods. The help files can be printed and searched to find descriptions with a keyword. With these functions, the user can operate this tool and reference analysis information.
� Help Topics
The Help Topics function displays a table of contents and keyword for help information on the C/C++ Analyzer.
� About C/C++ Analyzer
The About C/C++ Analyzer function displays version information on the C/C++ Analyzer.
22
1.4 Display Functions
1.4 Display Functions
The C/C++ Analyzer can display various items of analysis information based on its analysis functions. The C/C++ Analyzer has the display functions listed below. This section gives an outline of each display function in the following order:• Class Information• Name Space• Call Tree• Graph Flow• Logic Flow• Summary Information• Cross Reference Information• Global Information• Program Editing• Max Used Stack• Candidate for Inline Function• Candidate for Const Declaration• Printing
� Class Information
The Class Information function displays class information, including a diagram showinginheritance relations between base and derived classes, a list of class names, and informationon friend functions.
� Name Space
The Name Space function displays the information on the name spaces of C/C++ programs.
� Call Tree
The Call Tree function displays the call relations between functions in a list structure.
� Graph Flow
The Graph Flow function displays a diagram showing the call relations between functions.
� Logic Flow
The Logic Flow function displays a diagram showing the internal structures of functions.
� Summary Information
The Summary Information function displays various kinds of statistical information on eachfunction.
23
CHAPTER 1 OVERVIEW
� Cross Reference Information
The Cross Reference Information function displays the status of data usage by each function.
� Global Information
The Global Information function displays the status of usage of global variables.
� Program Editing
The Program Editing function starts the internal editor. When customized, this function can startan external editor.
� Max Used Stack
The Max Used Stack function calculates and displays the maximum size of stack used byprogram. This function also displays the route of functions for using a maximum size stack.
� Candidate for Inline Function
The Candidate for Inline Function searches functions to find candidates for inline development.
� Candidate for Const Declaration
The Candidate for Const Declaration function searches variables to find candidates for thosevariables that will be targets of optimization when declared as constants.
� Printing
The Printing function permits the user to print various analysis windows displayed.
24
1.4 Display Functions
1.4.1 Class Information
The Class Information function displays the following information about the classes of C++ source programs:• Class inheritance diagram• Class summary information• Class list• Class inheritance information• Class usage information• Friend informationFrom the above information, the user can understand the inheritance relations among classes of C++ source programs and where they are used.
� Class Inheritance Diagram
The class inheritance diagram visually shows the inheritance relations among classes. Thefollowing information can be referenced:
• Inheritance relations among all the classes used
• Arbitrary class
• Base class of a specified class
• Classes derived from a specified class
� Class Summary Information
Class summary information shows characteristics of each class. The following information canbe referenced:
• Type of the class
• Name, attribute, and type of data member used in the class
• Name, attribute, and type of member function used in the class
� Class List
The class list shows the classes used in programs in a list form.
� Class Inheritance Information
Class inheritance information shows the information about the base class of a specified class.The following information can be referenced:
• Name of the base class
• Inheritance level of the base class
• Name of source file where the base class is declared
• Type and kind of the base class
25
CHAPTER 1 OVERVIEW
� Class Usage Information
Class usage information shows the positions where a specified class is used (defined or quoted)by indicating source file names and line numbers. The specified class can be searched basedon this information.
� Friend Information
Friend information shows the friend information on a specified class. This information enablesthe user to know the friend declaration information in an arbitrary class.
26
1.4 Display Functions
1.4.2 Name Space
The Name Space function displays the following information on the name spaces of C/C++ programs:• Name space information• Name space contentsThis information enables the user to easily understand the global information on a C source program and the use of name space members and declarations in a C++ source program.
� Name Space Information
Name space information provides information about external variables and functions used in aC source program or the name space names used in a C++ source program.
� Name Space Contents
Name space contents show detailed information on a specified name space. The followinginformation can be referenced:
• Names and types of name space members
• Identifier of alias definition
• Identifier of using declaration
• Identifier of using instruction
27
CHAPTER 1 OVERVIEW
1.4.3 Call Tree
The Call Tree function displays the call relations between functions in a source program and highlights the relevant function box displayed on the Graph Flow window.
� Call Tree Function
The Call Tree function displays the call relations between functions used in a source program ina list form.
The following functions on the Call Tree window can be used:
• Highlighting a specified function on the Graph Flow window
• Displaying the edit window for the source program that includes a specified functiondefinition
• Displaying the Logic Flow window that includes A specified function definition
• Displaying the summary information on a specified function
• Displaying the mutual reference information on a specified function
• Displaying all the functions used on the Call Tree window
• Displaying only the highest-level functions used on the Call Tree window
• Searching the contents of the Call Tree window to find a function name
28
1.4 Display Functions
1.4.4 Graph Flow
The Graph Flow function displays the call relations between functions in a form of diagram. This diagram enables the user to easily understand the structure of the program.
� Graph Flow Function
The Graph Flow function displays the call relations between functions in a form of diagram. Thefollowing functions can be used on the Graph Flow window:
• Displaying the entire structure of the analyzed program and searching for a specifiedfunction
• Displaying the functions called by a specified function
• Displaying the functions calling a specified function
• Displaying the functions that are not found in the analyzed program but called from thefunctions in the program
• Displaying the number of program lines used for each function
• Displaying the maximum size of stack used by each function
• Displaying the max used stack route
• Outputting the contents of Graph Flow window as a bit map file
29
CHAPTER 1 OVERVIEW
1.4.5 Logic Flow
The Logic Flow function displays the internal structure of a function in diagram form. This diagram enables the user to easily understand the internal structure of a function.
� Logic Flow Function
The Logic Flow function displays the source program of a specified function in diagram form.
For C source program
• Visually displaying the control structure of if, for, switch, break, goto, while, pairs of do andwhile, and continue statements and structure and union declarations
• Controlling the display of comment lines
• Controlling the display of the contents of user include or system include files
• Searching for variable, function, tag, and macro names
For C++ source program
• Visually displaying the control structure of if, for, switch, break, goto, while, pairs of do andwhile, and continue statements and class, structure, and union declarations
• Controlling the display of comment lines
• Controlling the display of the contents of user include or system include files
• Searching for variable, function, tag, macro, and class names
30
1.4 Display Functions
1.4.6 Summary Information
The Summary Information function displays the statistical information as listed below on each function. This information enables the user to understand the characteristics of each function.
� Summary Information Function
The Summary Information function displays the detailed information on a specified function.The user can reference the following information:
• Complexity
• Number of lines
• Number of included lines
• Name of the function this function calls
• Name of the function calling this function
• Numbers of if, while, for, and other statements appearing in the function
31
CHAPTER 1 OVERVIEW
1.4.7 Cross Reference Information
The Cross Reference Information function displays the information listed below on each function. This information enables the user to know the status of data use in each function.
� Mutual Reference Information Function
The Mutual Reference Information function displays the status of data usage and data attributesin a specified function.
For C source program
• Attributes and types of variable, function, parameter, and enumerator names used in thefunction and the line numbers of the lines declaring, defining, or referencing them
• Kinds and types of structure tag, union tag, and enumerated-type tag names and typedefnames used in the function and the line numbers of the lines defining them
• Line numbers of the lines defining and invalidating the macro names and substitute stringsused in the function
For C++ source program
• Line numbers of the lines declaring or referencing the variable names, function names(including operator function, member function, and translation function names), classobjects, constructors, and destructors used in the function
• Structure tag names, union tag names, and enumerated-type tag names, typedef names,their kinds and types used in the function and the line numbers of the lines defining them
• Macro names and substitute strings used in the function and the line numbers of the linesdefining and invalidating the macros
32
1.4 Display Functions
1.4.8 Global Information
The Global Information function displays the global information as listed below on an entire source program. This information enables the user to understand the status of data use that affects the entire program.
� Global Information Function
The Global Information function displays detailed information on the global variables in a sourceprogram that are related to the entire source program.
For C source program
• Types of global variables used in the program and the name of the function using the globalvariables
• Candidates for those variables that will be targets of optimization when declared asconstants (searching)
For C++ source program
• Types of global variables used in the program and the name of the function using the globalvariables
• Candidates for those variables that will be targets of optimization when declared asconstants (searching)
• Name space names used in the program, their types, and the name of the source files usingthe name spaces
33
CHAPTER 1 OVERVIEW
1.4.9 Program Editing
When a source file name is double-clicked on a displayed analysis window, the user can start the internal editor and edit the source file. The user can also use an external editor after customization.
� Selecting an Editor
Without the Graph Flow window displayed, choose Editor Customize from the Setup menu.Then, the internal editor or an external editor can be selected.
� Internal Editor Functions
In the Internal Editor Setup dialog box, the user can specify the following functions and items:
❍ Automatic Indent
Specify this function to automatically indent each line in the same way as the preceding line.
❍ View/Hide: EOF
Specify this item to display an EOF symbol at the end of file.
❍ View/Hide: Line Number
Specify this item to display logical line numbers on the left side of the edit window.
❍ View/Hide: Return Character
Specify this item to display a special symbol as the return code.
❍ View/Hide: Ruler
Specify this item to display the ruler on the edit window.
❍ View/Hide: Char Space
Specify this item to display a special symbol as the em-size space.
❍ View/Hide: Comment
Specify this item to highlight comments.
❍ View/Hide: Tab
• View/Hide: Specify this item to display a special symbol as the tab code.
• Skipped spaces: Specify the number of spaces to be skipped by a tab code.
❍ Error Tag
Specify this item to colorize error tag in source file.
❍ Colorize
• C Keyword: Specify this item to read a C-language keyword file and highlight the relevantkeywords.
34
1.4 Display Functions
• C++ Keyword: Specify this item to read a C++-language keyword file and highlight therelevant keywords.
• Assembler Keyword: Specify this item to read an assembler (ASM) keyword file andhighlight the relevant keywords.
• Extended Keyword: Specify this item to read an extended keyword file and highlight therelevant keywords.
❍ Search Results
Specify this function to highlight the lines, including the string found by searching on the editwindow.
35
CHAPTER 1 OVERVIEW
1.4.10 Max Used Stack
The Max Used Stack function calculates and displays the maximum size stack used by an entire program or a specified function. This function also displays the route for a maximum size stack. This information enables the user to know the maximum size stack required for the current application and the route for use thereof.
� Calculation of Maximum Used Stack
The Max Used Stack function reads a stack usage information file and calculates the maximumsize stack used. The Max Used Stack function displays the maximum size stack used for thefunctions holding stack usage information on the Graph Flow window.
❍ For all functions
The Max Used Stack function can display the maximum size stack used by all functions,including callee functions, displayed on the Graph Flow window.
❍ For a specified function
The Max Used Stack function can display the maximum size stack used only in a functionspecified on the Graph Flow window. (The callee functions are ignored.)
� Display of Maximum Used Stack Route
The Max Used Stack function displays the maximum used stack route based on the calculatedmaximum size stack used. The Max Used Stack function displays the maximum used stackroute for the functions holding stack usage information on the Graph Flow window.
❍ For all functions
The Max Used Stack function can display the maximum used stack route for all functionsdisplayed on the Graph Flow window.
❍ For a specified function
The Max Used Stack function can display the maximum used stack route only for a functionspecified on the Graph Flow window.
Note:
To calculate the maximum size stack used, the user must create a stack usage informationfile for each source file with the Softune C/C++ Compiler.
To create a stack usage information file, choose Option from the Compile menu, click on theOutput STACK information check box, then perform compilation.
For restrictions on the calculation of the maximum size stack used, see CHAPTER 23"USED STACK INFORMATION".
36
1.4 Display Functions
1.4.11 Candidate for Inline Function
The Candidate for Inline Function searches functions to locate candidates for inline development. Inline development of functions usually increase not only the speed of program execution but also the size of the object program. However, if compilation is optimized, the size of the object program may be reduced significantly.
� Conditions for the Function that can be a Candidate for Inline Development
• The function is called by another function in a source program.
• The function is defined in a source program.
• The type of actual parameters for the function is the same as the type of dummy parametersfor the function.
• The number of actual parameters for the function is the same as the number of dummyparameters for the function.
• The parameters of the function do not have class attributes (in the case of C++ program).
• The parameters of the function do not include structures or unions.
• The function is not called recurrently.
• The function does not call a setjmp function.
• The function does not include descriptions of try, throw, and catch (in the case of C++program).
• The function is not a dummy function (in the case of C++ program).
• The function is not called through reference to an address.
• The number of lines describing the function does not exceed the "maximum number ofstatements in an inline function" specified in the Analysis Options dialog box.
Reference:
Specify the "maximum number of statements in an inline function" in consideration of thearea to be used.
37
CHAPTER 1 OVERVIEW
1.4.12 Candidate for Const Declaration
The Candidate for Const Declaration function displays the global variables that should be declared as constants. The variables declared with constant qualification will be the targets of compilation optimization.
� Conditions for the Variable that can be a Candidate for Constant Declaration
• The variable is defined as an external variable.
• The variable is not updated in the entire source program.
38
1.4 Display Functions
1.4.13 Printing
The results of analysis can be printed. The printed analysis results can be used as documents or material for preview and maintenance.
� Printing
The contents of analysis and edit windows can be printed.
For details, see CHAPTER 24 "PRINTING".
39
CHAPTER 1 OVERVIEW
40
CHAPTER 2 ANALYSIS PROCEDURE
This chapter explains the procedure for analyzing a source program written in the C/C++ language with the C/C++ Analyzer.
2.1 "Starting the C/C++ Analyzer"
2.2 "Terminating the C/C++ Analyzer"
2.3 "Windows"
2.4 "Menus on Window"
2.5 "Creating a Project"
2.6 "Setting Analysis Options"
2.7 "Analyzing Source Programs"
2.8 "Displaying Analysis Results"
2.9 "Analysis Result Data File"
41
CHAPTER 2 ANALYSIS PROCEDURE
2.1 Starting the C/C++ Analyzer
To start the C/C++ Analyzer, double-click the C/C++ Analyzer icon registered in the system. When the C/C++ Analyzer is started, its initial window appears.
� Starting with the Icon
Double-click the C/C++ Analyzer icon on the desktop.
Figure 2.1-1 C/C++ Analyzer Icon
� Starting from the Start Menu
Choose Program from the Start menu, and choose Softune C++ Analyzer from the submenu.
� Starting from the Explorer
Choose Program from the Start menu, and choose Explorer from the submenu to start theExplorer, then double-click on cpanalyze.exe in the folder where the Softune C/C++ Analyzerhas been installed.
� Starting from the MS-DOS Prompt
Choose Program from the Start menu and choose MS-DOS Prompt to start the MS-DOSprompt, then execute the cpanalyze.exe command in the folder where the Softune C/C++Analyzer has been installed.
42
2.2 Terminating the C/C++ Analyzer
2.2 Terminating the C/C++ Analyzer
To terminate the C/C++ Analyzer, choose Quit C/C++ Analyzer from the Project menu.
� Starting the C/C++ Analyzer
Figure 2.2-1 "Project Menu" shows the Project menu of the C/C++ Analyzer.
Figure 2.2-1 Project Menu
43
CHAPTER 2 ANALYSIS PROCEDURE
2.3 Windows
When the C/C++ Analyzer is started, the initial window of the C/C++ Analyzer appears.
� Initial Window
Figure 2.3-1 "Initial Window" shows the initial window of the C/C++ Analyzer.
Figure 2.3-1 Initial Window
44
2.3 Windows
� Window for Analysis
Figure 2.3-2 "Analysis Information (Graph Flow) Window" shows an example of the AnalysisInformation (Graph Flow) window displayed after a new project has been created.
Figure 2.3-2 Analysis Information (Graph Flow) Window
45
CHAPTER 2 ANALYSIS PROCEDURE
2.4 Menus on Window
This section explains the bars and menus displayed on each window of the C/C++ Analyzer.
� Menus and Bars on Window
❍ Tool bar
The tool bar shows the commands of the File and Analyze menus in icon forms.
❍ Status bar
The status bar provides explanations of the menu commands.
❍ Menu bar
The menu bar shows the menus related to the currently focused window.
� Project Menu
See Section 1.3.1 "Project".
� File Menu
See Section 1.3.2 "File".
� Analyze Menu
See Section 1.3.3 "Analyze".
� Edit Menu
See Section 1.3.4 "Edit".
� View Menu
See Section 1.3.5 "View".
� Compile Menu
See Section 1.3.6 "Compile".
� Setup Menu
See Section 1.3.7 "Setup".
� Window Menu
See Section 1.3.8 "Window".
46
2.4 Menus on Window
� Help Menu
See Section 1.3.9 "Help".
47
CHAPTER 2 ANALYSIS PROCEDURE
2.5 Creating a Project
To analyze a source program with the C/C++ Analyzer, the user must create a project and register the source program in the project. This section explains how to create a project with the New Project command and register the source program in the project with the Add File in Project command.
� Project Name & Path Dialog Box
When New Project is chosen from the Project menu, the Project Name & Path dialog boxappears as shown in Figure 2.5-1 "Project Name & Path Dialog Box".
Figure 2.5-1 Project Name & Path Dialog Box
� Select File Dialog Box
When Add File in Project is chosen from the File menu, the Select File dialog box appears asshown in Figure 2.5-2 "Select File Dialog Box".
Figure 2.5-2 Select File Dialog Box
48
2.5 Creating a Project
� Selecting a File
Select a file as follows:
1. Create a new project with the New Project command or open an existing project with theOpen Project command.
2. Use the Add File in Project command to specify the directory where the file to be selected isstored.
3. Select the name of the file to be selected from the file list in the Look in: box by clicking(multiple files can be selected by dragging). The user can specify the type of files to belisted in the box if necessary. And the type of file displayed if necessary in [kind] box can bespecified.
4. If unnecessary files are selected, specify the unnecessary source files on the Project windowand delete with the Delete File from Project command.
� Specifying the Type of Project File
The user can specify the project file for Softune Workbench or that for Softune C/C++ Checkeras the file type as follows:
1. Choose Open Project from the Project menu. The Select File dialog box appears.
2. In the Files of type field, specify the extension code "prj" for the project file for SoftuneWorkbench or "cpj" for the project file for Softune C/C++ Checker.
3. Select the specified project file. Only the project file for Softune C/C++ Analyzer can beused as the project file to be saved.
49
CHAPTER 2 ANALYSIS PROCEDURE
2.6 Setting Analysis Options
The user must set some analysis options when analyzing a source program with the C/C++ Analyzer. This section explains how to set analysis options using the Analysis Options dialog box.
� Analysis Options Command
When Analysis Options is chosen from the Analyze menu, the Analysis Options dialog boxappears as shown in Figure 2.6-1 "Analysis Options Dialog Box".
Figure 2.6-1 Analysis Options Dialog Box
50
2.6 Setting Analysis Options
2.6.1 General Mode
Specify the target of analysis under the General Mode item in the Analysis Option dialog box.
� General Mode
• Select "fcc911s" to perform analysis based on fcc911s.
• Select "fcc935s" to perform analysis based on fcc935s.
• Select "ANSI" to perform analysis strictly conforming to the ANSI Standard.
• Specify the family name of MCU in the Chip Classification field. This specification will affect pre-defined macros and the stack information library.
• Specify the target MCU in the Target MCU field. This specification will affect previousdefined macros and the stack information library.
• When a value in the Maximum number of statement is specified in an inline function field astack information file corresponding to the source file specified in the select file dialogselected.
51
CHAPTER 2 ANALYSIS PROCEDURE
2.6.2 C/C++ options
The user can specify the following options in the Analysis Options dialog box:• Language Level• Other options
� Language Level
The user can specify one of the following language specification levels of the C/C++ sourceprogram:
❍ ANSI+Extension
"ANSI+Extension" specifies the new ANSI C/C++ specifications, including extendedspecifications. The structure of a program whose operation varies depending on the languagespecification (new or old) is interpreted in conformance with ANSI C/C++ specifications. Thewarning messages related to changes in the integer extension rules will be displayed on theAnalysis Message window. On the other hand, the warning messages related to tri-graphsequences or added escape sequences will not be displayed.
❍ Strict ANSI
"Strict ANSI" specifies that related header files must strictly conform to ANSI C/C++specifications. However, the files can include those extended ANSI specifications that do notaffect programs strictly conforming to ANSI C/C++ specifications. For some extendedspecifications, warning messages will be displayed on the Analysis Message window. Amongthe identifiers in the standard header files, only those defined by ANSI C/C++ specifications arevisible.
❍ Embedded C++
"Embedded C++" specifies that C++ source files are interpreted in conformance to EC++specifications. In addition to ordinary warning messages, extra warning messages will beoutput for specifications out of the EC++ specifications. Regarding C source files, thespecification of "EC++" has the same meaning as the specification of "ANSI".
� Warning Level
The warning level at the time of analysis can be specified to be this input column. The outputlevel of a warning message is specified among the diagnostic message at the time of analyzinga source program.
� Other Options
The following options can be specified in the Other Options field:
❍ -D name [= tokens]
If this option is omitted, token 1 associates "name" with the specified tokens as the processingby the #define preprocessing instruction. This function gives "=tokens" as the result.
❍ -U name
This option invalidates the definition of "name" as the processing by the #under preprocessing
52
2.6 Setting Analysis Options
instruction. If the same name is specified in both the -D and -U options, the specified name isnot defined regardless of the option order.
53
CHAPTER 2 ANALYSIS PROCEDURE
2.6.3 Maximum Number of Statements in an Inline Function
Specify the maximum limit for the number of executable statements of the function that can be a candidate for inline function. Specify it in the Maximum number of statements in an inline function field of the Analysis Options dialog box.
� Maximum Number of Statements in an Inline Function
Conditions for the function that can be a candidate for inline function are as described below.The candidates exclude the inline specification functions and the member functions defined in aclass in a C++ source program.
• The function is called by another function in a source program.
• The function is defined in a source program.
• The type of actual parameters for the function is the same as the type of dummy parametersfor the function.
• The number of actual parameters for the function is the same as the number of dummyparameters for the function.
• The parameters of the function do not have class attributes, structures, and unions.
• The function is not called recurrently.
• The function is not a dummy function.
• The function does not call a setjmp function.
• The function does not include try, throw, and catch blocks.
• The function is not called through reference to an address.
• The number of lines describing the function does not exceed the maximum number ofstatements in an inline function.
Reference:
Specify the "maximum number of statements in an inline function" in consideration of thearea to be used.
54
2.6 Setting Analysis Options
2.6.4 Project Setup
Click the Project’s Setup button in the Analysis Options dialog box and set up the include paths and macro definitions required for analysis.
� Include Path
Set up the include paths for the header files used by the source file to be analyzed by the C/C++Analyzer.
To register an include path, enter the name of the include path directly or click the Referencebutton to display the folder reference dialog box and enter the name of the include path.
After entering the name of the include path, click the Register button to register the include path.
The include paths registered will be used sequentially from the top to search for files to beincluded.
The order of registration can changed and files can be deleted from registration.
The order of searching, which includes files according to the description format in the sourceprogram, is explained below.
The file names enclosed by double-quotation marks are searched in the following order:
1. Current directory including the #include preprocessing instruction
2. Directories registered in the include path column (ascending order)
3. Directories where the standard include files supported by the C/C++ Analyzer are installed
The file names enclosed by brackets (<>) are searched in the following order:
1. Directories registered in the include path column (ascending order)
2. Directories where the standard include files supported by the C/C++ Analyzer are installed.
� Macro Definition
Set up the macro definitions used by the source file to be analyzed by the C/C++ Analyzer.
To register each macro definition, enter the name of the macro directly.
Click the Register button to register the entered macro name.
The macro names registered are defined sequentially from the top.
The user can also change the order of registration and delete macro definitions fromregistration.
If multiple macro definitions are registered with the same name, the macro definition at thebottom among those in the registration column has priority over others.
55
CHAPTER 2 ANALYSIS PROCEDURE
2.7 Analyzing Source Programs
When the Analyze or Re-Analyze command is chosen from the Analyze menu, the source programs registered in the currently opened project are analyzed. If an error occurs during analysis, the content of the error is displayed on the Analysis Message window. If no error occurs and analysis ends, the result of analysis is displayed automatically.
� Analyze
The Analyze command analyzes all source files displayed on the current project window.
The progress of analysis is displayed on the Analysis Message window.
� Re-Analyze
The Re-Analyze command analyzes only the modified source files among the source filesdisplayed on the current project window.
� Interrupt
The Interrupt command cancels analysis operation. When the Interrupt command is chosen, adialog box indicating cancellation of analysis operation appears. Analysis information is thendeleted and the analysis window is not displayed.
This function is valid only while a source program is being analyzed after the Analyze or Re-Analyze command has been chosen.
� Analysis Message Window
If an error occurs during the analysis of a source program, an error message is output to theAnalysis Message window and the analysis operation is stopped. The analysis window is notdisplayed as in the case of the Interrupt command.
56
2.8 Displaying Analysis Results
2.8 Displaying Analysis Results
When the Analysis Information (Graph Flow) command is chosen from the View menu, a Graph Flow window appears. The user can display various analysis information on the Graph Flow window.
� Display of Analysis Information (Graph Flow Window)
When the analysis of source programs ends normally, analysis data is saved as a project and aGraph Flow window appears.
Even after the Graph Flow window is closed, it can be displayed again with the AnalysisInformation (Graph Flow) command in the View menu without the need for re-analysis becausethe analysis data has been saved.
The Graph Flow window shows the internal hierarchical structure of C/C++ source program.The user can also display detailed information on functions and classes on the Graph Flowwindow.
57
CHAPTER 2 ANALYSIS PROCEDURE
2.9 Analysis Result Data File
Analysis results are saved as data files in the relevant project.
� Saving an Analysis Result Data File
An analysis result data file is created under a file name with a suffix ".q". For example, if thename of a source file is "test.cpp", an analysis result data file named "test.q" is created.
If the contents of the source file are changed after the analysis result data file has been saved,the analysis results cannot be displayed correctly. If the directory or file name of the analysisresult data file is changed, subsequent operation will be abnormal.
� Updating an Analysis Result Data File
If an analysis result data file has been created for a source file and the source file is analyzedagain, the analysis result data file is updated to (or replaced with) a new analysis result data file.
� Displaying an Existing Analysis Result
To display an existing analysis result, open the project that includes the corresponding analysisresult data file and choose Analysis Information (Graph Flow) from the View menu. Thus, theanalysis result can be displayed without performing re-analysis.
� Deleting an Analysis Result Data File
To delete an analysis result data file, use the Delete command of the Explorer.
58
CHAPTER 3 PROJECT
This chapter explains how to create and operate a project.
3.1 "Project Menu"
3.2 "Creating a New Project"
3.3 "Opening a Project"
3.4 "Saving a Project"
3.5 "Updating Dependence"
3.6 "Printing"
3.7 "Print Preview"
3.8 "Printer Setup"
59
CHAPTER 3 PROJECT
3.1 Project Menu
Projects can be managed using the commands in the Project menu.Project menu commands are as follows:• New Project command• Open Project command• Close Project command• Save Project command• Save Project As command• Update Dependence command• Print command• Print Preview command• Print Setup command• Quit C/C++ Analyzer command
� Project Menu
❍ New Project command
The New Project command permits the user to create a new project.
If this command is chosen from the Project menu, the Project Name & Path dialog box appears.Specify the name of the new project and the name of the folder to store the new project file inthe dialog box.
❍ Open Project command
The Open Project command permits the user to open an existing project.
If this command is chosen from the Project menu, the Select File dialog box appears. Specifythe project file created with the New Project command in the dialog box to open.
❍ Close Project command
The Close Project command closes the currently opened project. If the contents of the projecthave not been saved after the last change, a dialog box asking whether to save the projectappears.
❍ Save Project command
The Save Project command saves the currently opened project by writing its contents over theproject saved under the same name. This command does not close the project. To close theproject, use the Close Project command.
❍ Save Project As command
The Save Project As command permits the user to save the currently opened project under anew name. If this command is chosen from the Project menu, the Project Name & Path dialogbox appears. Specify the new name of the project in the dialog box.
60
3.1 Project Menu
❍ Update Dependence command
The Update Dependence command permits the user to register in the same project the includefiles used by the source files belonging to the currently opened project.
❍ Print command
The Print command permits the user to print the contents of a currently opened analysiswindow.
If this command is chosen from the Project menu, the Print dialog box appears. Make settingsfor printing in the dialog box.
❍ Print Preview command
The Print Preview command displays a print image currently opened analysis window.
❍ Print Setup command
The Print Setup command permits the user to set up the printer.
If this command is chosen, the Printer Setup dialog box appears. Make printer settings in thisdialog box.
❍ Quit C/C++ Analyzer command
The Quit C/C++ Analyzer command terminates the C/C++ Analyzer. If the contents of theproject have not been saved after the last change, a dialog box asking whether to save theproject appears.
61
CHAPTER 3 PROJECT
3.2 Creating a New Project
To create a new project, choose the New Project command from the Project menu.
� Creating a New Project
If the New Project command is chosen from the Project menu, the Project Name & Path dialogbox appears. Specify the name of the new project and the name of the folder to store the newproject file in the dialog box. When the new project is created, a file named "project-name.anp"is created in the specified folder. If the new project is opened next time, specify the created file.
� Project Name & Path Dialog Box
Use the Project Name & Path dialog box for creating a new project. The following settings canbe made in the dialog box:
• Project Name: Enter the name of the new project.
• Path: Specify the folder to store the new project.
• Change Directory: Use this button to display the Folder Reference dialog box.
Figure 3.2-1 Project Name & Path Dialog Box
Reference:
If no project name is specified or the project or file name specified includes an invalidcharacter, a message dialog box indicating the error appears when the OK button ispressed.
62
3.2 Creating a New Project
� Folder Reference Dialog Box
If the Change Directory button in the Project Name & Path dialog box is clicked, a dialog box toreference the folders appears as follows:
Figure 3.2-2 Folder Reference Dialog Box
63
CHAPTER 3 PROJECT
3.3 Opening a Project
To open an existing project, choose the Open Project command from the Project menu.
� Opening a Project
If the Open Project command is chosen from the Project menu, the Select File dialog boxappears. Specify the project file to be opened in the dialog box.
� Select File Dialog Box
Use the Select File dialog box for opening an existing project. The following settings can bemade in the dialog box:
❍ Look in:
Specify the folder storing the project file to be opened in this field.
❍ File name:
Specify the name of the project file to be opened by entering it or selecting it from the list. Thelist box shows the files having the identifier (anp) of the project file format for C/C++ Analyzer.
❍ Files of type:
Specify the type of the project file to be opened by selection. As the default, this field shows thefile type with the identifier (anp) of the project file format for C/C++ Analyzer. The user can alsoselect the identifier (prj) of the project file format for Softune Workbench or the identifier (cpj) ofthe project file format for Softune C/C++ Checker.
Figure 3.3-1 Select File Dialog Box
Note:
The user can specify the project file for Softune Workbench, Softune C/C++ Checker, orSoftune C/C++ Analyzer. However, the information in the saved project file can only be usedfor the Softune C/C++ Analyzer
64
3.4 Saving a Project
3.4 Saving a Project
There are two methods of saving a project: Saving it by overwriting and saving it with a new name. To save a project, choose the Save Project or Save Project As command, respectively.
� Save Project Command
The Save Project command saves the currently opened project by writing its contents over theproject saved under the same name. For example, the file names added in the project andchanges in option settings can be saved.
� Save Project As Command
The Save Project As command permits the user to save the currently opened project under anew name. For example, the file names added in the project and changes in option settings canbe saved. If this command is chosen, the Project Name & Path dialog box appears as follows:
Figure 3.4-1 Project Name & Path Dialog Box
� Confirmation Dialog Box
The confirmation dialog box appears if:
• you have made changes in the currently opened project and choose the New Projectcommand without saving the changes,
• you have made changes in the currently opened project and choose the Close Projectcommand without saving the changes, or
• you have made changes in the currently opened project and choose the Quit C/C++Analyzer command without saving the changes.
Figure 3.4-2 Confirmation Dialog Box
65
CHAPTER 3 PROJECT
3.5 Updating Dependence
The include files used in the source programs registered in a project can be updated by choosing the Update Dependence command from the Project menu.
� Update Dependence Command
The Update Dependence command checks the source files registered in the currently openedproject and registers the include files used by the source programs in the same project. Theinclude files registered by this function are displayed in the include file category on the relevantproject window.
66
3.6 Printing
3.6 Printing
The contents of a displayed analysis window can be printed by choosing the Print command from the Project menu.
� Printing
If the Print command is chosen from the Project menu, the Print dialog box appears. The usercan make printing settings in the dialog box.
For details on printing functions, see CHAPTER 24 "PRINTING".
67
CHAPTER 3 PROJECT
3.7 Print Preview
A print image of the contents of the currently opened analysis window can be displayed.
� Print Preview
If the Print Preview command is chosen from the Project menu, the Print Preview windowappears.
For details on printing functions, see CHAPTER 24 "PRINTING".
68
3.8 Printer Setup
3.8 Printer Setup
The printer connected to the computer can be set up directly or via a network by choosing the Print Setup command from the Project menu.
� Printer Setup
If the Print Setup command is chosen from the Project menu, the Printer Setup dialog boxappears. Make printer settings in this dialog box.
For details on printing functions, see CHAPTER 24 "PRINTING".
69
CHAPTER 3 PROJECT
70
CHAPTER 4 FILE
This chapter explains how to create and operate a file.
4.1 "File Menu"
4.2 "Creating a New File"
4.3 "Opening a File"
4.4 "Saving a File"
4.5 "Adding or Deleting a File"
71
CHAPTER 4 FILE
4.1 File Menu
The user can create a new file, open an existing file, and save a file using the commands in the File menu.File menu commands are as follows:• New File command• Open File command• Save File command• Save File As command• Add File in Project command• Delete File from Project command
� File Menu
❍ New File command
The New File command creates a new file. If this command is chosen, an untitled edit windowis opened. If an existing file is to be opened, use the Open File command.
❍ Open File command
The Open File command permits the user to open an existing file. If this command is chosen,the Select File dialog box appears. Any type of file can be specified in this dialog box.
❍ Save File command
The Save File command saves the file being edited without changing its name and folder. If theuser attempts to save a newly created file for the first time, the Save File As dialog box appearsand the file can be saved with an appropriate file name. If an existing file is to be saved with anew name in a new folder, use the Save File As command.
The Save File command is valid only when an edit window is opened.
❍ Save File As command
The Save File As command permits the user to save the file being edited without a new name.If this command is chosen, the Save File As dialog box appears and the file can be saved withan appropriate file name.
The Save File As command is valid only when an edit window is opened.
❍ Add File in Project command
The Add File in Project command permits the user to add a file in a project. As default, thetypes of the files that can be added are "*.cpp", "*.cxx", "*.ipp", and "*.cc". The user can alsoselect "*.c", "*.i", "*.h", "*.hpp", "*.stk", and "*.*" as types of files that can be added.
❍ Delete File from Project command
The Delete File from Project command permits the user to delete the files selected on a projectwindow from the relevant project. If no file is selected, this command deletes all files from theproject.
72
4.2 Creating a New File
4.2 Creating a New File
To create a new file, choose the New File command from the File menu.
� Creating a New File
Choose the New File command from the File menu. An untitled edit window is opened on themain window as follows:
Figure 4.2-1 Example of Edit Window (Untitled)
The edit operations on the edit window are linked with the commands in the Edit menu. Fordetails, see the explanation of the Edit menu.
Reference:
If an external editor is registered using the Editor Customize command in the Setup menu,the external editor is activated by the above operation. For details, see the explanation ofthe Setup menu.
73
CHAPTER 4 FILE
4.3 Opening a File
If the Open File command is chosen, the Select File dialog box appears.
� Opening a File
Choose the Open File command from the File menu. The Select File dialog box appears.Specify an already created text file in the dialog box.
� Select File Dialog Box
Use the Select File dialog box to open an existing text file. The following settings can be madein the dialog box:
❍ Look in:
Specify the folder storing the text file to be opened in this field.
❍ File name:
Specify the name of the text file to be opened by entering it or selecting it from the list. The listbox lists the files having an identifier corresponding to the file type selected in the Files of typebox.
❍ Files of type:
Specify the type of the text file to be opened by selection. As default, any type of file can beselected. The type of file can be specified by entering the extension code corresponding to thetype in the File name field.
Figure 4.3-1 Example of Select File Dialog Box
74
4.4 Saving a File
4.4 Saving a File
There are two methods of saving a file: Saving by overwriting and saving with a new name.
� Save File Command
The Save File command saves the currently opened file by writing its contents over the filesaved under the same name.
� Save File As Command
The Save File As command permits the user to save the currently opened file with a new name.If this command is chosen, the Save File As dialog box appears as follows:
Figure 4.4-1 Save File As Dialog Box
� Confirmation Dialog Box
The confirmation dialog box appears if:
• you have made changes in the currently opened edit window and choose the New Projectcommand without saving the changes,
• you have made changes in the currently opened edit window and choose the Close Projectcommand without saving the changes, or
• you have made changes in the currently opened edit window and choose the Quit C/C++Analyzer command without saving the changes.
Figure 4.4-2 Confirmation Dialog Box
75
CHAPTER 4 FILE
4.5 Adding or Deleting a File
If the Add File in Project is chosen, the Select File dialog box appears.
� Adding a File in a Project
Choose the Add File in Project from the File menu. The Select File dialog box appears. Specifythe name of the program file to be added in a project in the dialog box.
� Select File Dialog Box
Use the Select File dialog box to register an existing source program in a project. The followingsettings can be made in the dialog box:
❍ File name:
Specify the name of the file to be added by entering it or selecting it from the list. The list boxlists files having an identifier corresponding to the file type selected in the Files of type box.
❍ Files of type:
Select the type of file to be added. As default, the types of files that can be added are "*.cpp","*.cxx", "*.cc" and "*.ipp". The user can also select "*.c", "*.i", "*.h", "*.hpp", "*.stk", and "*.*" asthe types of files that can be added.
❍ File Kind
The kind of file independent of an extension can be set up.
❍ Look in:
Specify the folder storing the file to be added in this field.
Figure 4.5-1 Select File Dialog Box
76
4.5 Adding or Deleting a File
� Deleting Files from a Project
Choose the Delete File from Project in the File menu. The program files selected on thecurrently opened project window are deleted from the relevant project.
If no program file is selected on the project window, all program files displayed on the projectwindow are deleted from the relevant project.
Figure 4.5-2 Confirmation Dialog Box
Reference:
The user can also add and delete files with corresponding commands in the pull-downmenus on the project window. For details, see Section 7.4 "Project Window".
77
CHAPTER 4 FILE
78
CHAPTER 5 ANALYZE
This chapter explains how to operate the Analyze functions.
5.1 "Analyze Menu"
5.2 "Setting Analysis Options"
79
CHAPTER 5 ANALYZE
5.1 Analyze Menu
The user can start and stop analysis and set analysis options using the commands in the Analyze menu.Analyze menu commands are as follows:• Re-Analyze command• Analyze command• Interrupt command• Analysis Options command
� Analyze Menu
Figure 5.1-1 "Analyze Menu" shows the Analyze menu.
Figure 5.1-1 Analyze Menu
❍ Re-Analyze command
The Re-Analyze function analyzes the source programs registered in a specified project tocreate analysis information.
❍ Analyze command
The Analyze function analyzes only modified source programs among source programsregistered in a specified project to create analysis information.
❍ Interrupt command
The Interrupt function cancels analysis operations while in progress. If this command is chosen,the analysis information being created is deleted.
❍ Analysis Options command
The Analysis Options function permits the user to set optional information for analysis.
80
5.2 Setting Analysis Options
5.2 Setting Analysis Options
This section explains how to set analysis options for the C/C++ Analyzer.
� Analysis Options Dialog Box
Figure 5.2-1 "Analysis Options Dialog Box" shows the Analysis Options dialog box.
Figure 5.2-1 Analysis Options Dialog Box
The following options can be set in the Analysis Options dialog box:
� General Mode
❍ Target Compiler
Specify the compiler for the analysis target.
❍ Chip Classification
The family of MCU currently used is specified.
81
CHAPTER 5 ANALYZE
❍ Target MCU
Specify the type of MCU used. It is possible to input cpu type manually.
❍ Call MUSC
Specify the check option when using Max Used Stack Function.
� C/C++ Options
❍ Language Level
Specify a language specification level of C/C++ source program.
❍ Warning Level
Specify an output level for warning messages among the diagnostic messages to be outputduring the analysis of a source program.
❍ Other Options
Specify other options when passing the options directly to the analyzer.
� Maximum Number of Statements in an Inline Function
Specify the maximum limit for the number of executable statements for the function that can bea candidate for inline function.
� Preprocessor Setting
Set include paths and macro definitions.
82
5.2 Setting Analysis Options
5.2.1 General Mode
Use the General Mode items in the Analysis Options dialog box to specify the target of analysis.
� Target Compiler
The user can specify one of following analysis methods.
❍ fcc911s
Specifies the analysis based on fcc911s.
❍ fcc935s
Specifies the analysis based on fcc935s.
❍ ANSI
Specifies the analysis strictly conforming th the ANSI Standard.
� Chip Classification
Specify a MCU Family Name in the Chip Classification field by selection menu. The stack usageinformation file for the standard library function and predefined macros corresponding to thespecified Chip Classification is selected.
� Target MCU
Specify a MCU number in the MCU Type field by selection from menu or entry. The stack usageinformation file for the standard library function corresponding to the specified MCU is selected.
The already defined macros corresponding to the specified MCU are also registered.
� Call MUSC
If the Call Musc radio button is checked, the stack usage information file corresponding to thesource program registered in the relevant project is selected.
83
CHAPTER 5 ANALYZE
5.2.2 C/C++ Options
The user can specify the following options in the Analysis Options dialog box:• Language Level• Warning Level• Other Options
� Language Level
The user can specify one of the following language specification levels of C/C++ sourceprogram:
❍ ANSI+Extension
"ANSI+Extension" specifies the new ANSI C/C++ specifications, including extendedspecifications. The structure of a program whose operation varies depending on the languagespecification (new or old) is interpreted in conformance with ANSI C/C++ specifications. Thewarning messages related to changes in the integer extension rules will be displayed on theAnalysis Message window. On the other hand, the warning messages related to tri-graphsequences or added escape sequences will not be displayed.
❍ Strict ANSI
"Strict ANSI" specifies that related header files must much strictly conform to ANSI C/C++specifications. However, the files can include those extended ANSI specifications that do notaffect the program strictly conforming to ANSI C/C++ specifications. For some of the extendedspecifications, warning messages will be displayed on the Analysis Message window. Amongthe identifiers in the standard header files, only those defined by the ANSI C/C++ specificationsare visible.
❍ Embedded C++
"Embedded C++" specifies that C++ source files are interpreted in conformance with the EC++specifications. In addition to ordinary warning messages, extra warning messages will beoutput for the specifications out of the EC++ specifications. Regarding C source files, thespecification of "EC++" has the same meaning as the specification of "ANSI".
� Warning Level
Specify an output level for warning messages among the diagnostic messages to be outputduring the analysis of a source program.
The output level can be specified in the range from 0 to 8. Output levels 1 to 8 make nodifference, but are prepared for compatibility with the Softune C Analyzer. If output level 0 isspecified, the output of warning messages is suppressed. The default is output level 2.
� Other Options
The user can specify the following options in the Other Options field:
❍ -D name [= tokens]
If this option is omitted, token 1 associates "name" with the specified tokens as the processingby the #define preprocessing instruction. This function gives "=tokens" as the result.
84
5.2 Setting Analysis Options
❍ -U name
This option invalidates the definition of "name" as the processing by the #under preprocessinginstruction. If the same name is specified in both the -D and -U options, the specified name isnot defined regardless of the order of the options.
85
CHAPTER 5 ANALYZE
5.2.3 Maximum Number of Statements in an Inline Function
Specify the maximum limit for the number of executable statements of the function that can be a candidate for inline function. Specify it in the Maximum number of statements in an inline function field of the Analysis Options dialog box.
� Maximum Number of Statements in an Inline Function
Conditions for the function that can be a candidate for inline function are as described below.
• The function is called by another function that is in a source program.
• The function is defined in a source program.
• The type and number of actual parameters for the function is the same as those of dummyparameters for the function.
• The parameters of the function do not have class attributes, structures, and unions.
• The function is not called recurrently.
• The function does not call a set jmp function.
• The function does not include try, throw, and catch blocks.
• The function is not a dummy function.
• The function is not called through reference to an address.
• The number of lines describing the function does not exceed the maximum number ofstatements in an inline function.
Reference:
Specify the "maximum number of statements in an inline function" in consideration of thearea to be used.
86
5.2 Setting Analysis Options
5.2.4 Pre-processor
If the Preprocessor button is clicked in the Analysis Options dialog box, the Preprocessor Settings dialog box appears. This dialog box has two setting screens: Include Paths and Macro Definition screens.
� Include Paths Screen of Preprocessor Settings Dialog Box
Figure 5.2-2 "Include Paths Screen" shows the Include Paths screen.
Figure 5.2-2 Include Paths Screen
Items and buttons of the Include Paths screen are as follows:
❍ Path
This field shows the include path to be used for analysis.
Registered include paths are shown in the List of registered paths and will be passed to thepreprocessor sequentially from the top.
❍ Browse button
This button displays the window to select a path from existing include paths.
The path selected on the window is shown in the Path field.
87
CHAPTER 5 ANALYZE
❍ Add button
This button adds the include path shown in the Path field in the List of registered paths box.
❍ Delete button
This button deletes a selected include path from the List of registered paths box.
❍ Move Upward button
This button shifts the selected include path upward with one line which is in the List of registeredpaths displayed in the box.
❍ Move Downward button
This button shifts the selected include path downward with one line which is in the List ofregistered paths displayed in the box.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
� Macro Definition Screen of Preprocessor Settings Dialog Box
Figure 5.2-3 "Macro Definition Screen" shows the Macro Definition screen.
Figure 5.2-3 Macro Definition Screen
Items and buttons of the Macro Definition screen are as follows:
❍ Name
This field permits the user to specify the name of the macro to be registered for analysis.
88
5.2 Setting Analysis Options
❍ Value
This field permits the user to enter the value of the macro.
❍ List of Registered Macro Definition
This box lists registered macro names.
Listed registered macros will be passed to the preprocessor sequentially from the top.
❍ Add button
This button adds the macro specified in the Name field in the List of Registered Macro Definitionbox.
❍ Delete button
This button deletes a selected macro from the List of Registered Macro Definition box.
❍ Move Upward button
This button shifts the selected macro upward with one line which is in the List of RegisteredMacro Definition displayed in the box.
❍ Move Downward button
This button shifts the selected macro downward with one line which is in the List of RegisteredMacro Definition displayed in the box.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
89
CHAPTER 5 ANALYZE
90
CHAPTER 6 EDIT
This chapter explains how to operate the Edit functions.
6.1 "Edit Menu"
91
CHAPTER 6 EDIT
6.1 Edit Menu
The commands in the Edit menus are as follows:• Undo command• Cut command• Copy command• Paste command• Select All command• Find command• Replace command• Find in Files command
� Edit Menu
Figure 6.1-1 "Edit Menu" shows the Edit menu.
Figure 6.1-1 Edit Menu
❍ Undo command
The Undo command cancels the previous file editing operation performed on the currentlydisplayed edit window and restores the relevant file to the status prior to the file editingoperation.
❍ Cut command
The Cut command cuts out currently selected data from the relevant file and saves the data onthe clipboard during file editing. If no data is selected, this command is invalid. The dataalready saved on the clipboard is replaced with the data newly saved by the Cut command.
❍ Copy command
The Copy command copies currently selected data on the clipboard during file editing. If nodata is selected, this command is invalid. The data already copied on the clipboard is replacedwith the data newly copied by the Copy command.
❍ Paste command
The Paste command inserts the content of the clipboard in the position indicated by the cursorduring file editing. If no data is found on the clipboard, this command is invalid.
92
6.1 Edit Menu
❍ Select All command
The Select All command selects all data displayed on a specified window.
Note:
The Edit menu described above is valid only when the internal editor is used. Choose theEditor Customize command from the Setup menu to display the CUSTOMIZE dialog box andcheck whether the Use External Editor check box has a check mark. If the Editor has acheck mark, the internal editor is not used.
❍ Find command
If you choose the Find command from the Edit menu when an edit window is active, the Find inCurrent File dialog box appears.
The following conditions can be set in the Find in Current File dialog box:
• Find What
• Match Whole Word Only
• Match Case
• Normal Expression
• Ambiguous Expression
• Direction
• Position
Figure 6.1-2 "Find in Current File Dialog Box (Edit Window)" shows an example of a display ofthe Find in Current File dialog box for the analysis window.
Figure 6.1-2 Find in Current File Dialog Box (Edit Window)
93
CHAPTER 6 EDIT
❍ Replace command
The Replace command permits the user to replace a specified character string with a newcharacter string on an edit window.
If you choose the Replace command, the Replace dialog box appears. On the Replace dialogbox, enter the character string to be replaced in the Find What field and the character string toreplace it in the Replace With field.
The following conditions can be set in the Replace dialog box:
• Find What
• Replace With
• Match Whole Word Only
• Match Case
• Normal Expression
• Ambiguous Expression
• Direction
• Position
Figure 6.1-3 "Replace Dialog Box (Edit Window)" shows an example of a display of the Replacedialog box.
Figure 6.1-3 Replace Dialog Box (Edit window)
94
6.1 Edit Menu
❍ Find in Files command
If you choose the Find in Files command from the Edit menu when an edit window is active, theFind in Files dialog box appears.
The following conditions can be set in the Find in Files dialog box:
• Find What
• In files
• In folder
• Match whole word only
• Match case
Figure 6.1-4 "Find in Files Dialog Box" shows an example of a display of the Find in file dialogbox.
Figure 6.1-4 Find in Files Dialog Box
95
CHAPTER 6 EDIT
96
CHAPTER 7 VIEW
This chapter explains how to operate the View functions.
7.1 "View Menu"
7.2 "Tool Bar"
7.3 "Status Bar"
7.4 "Project Window"
7.5 "Analysis Message Window"
7.6 "Analysis Information (Graph Flow)"
7.7 "Analysis Information (Tree View)"
7.8 "Class Information"
7.9 "Name Space"
7.10 "Function List"
7.11 "Max Used Stack"
7.12 "Find"
97
CHAPTER 7 VIEW
7.1 View Menu
You can display the tool bar, status bar, project window, analysis message window, graph flow, class inheritance diagram, logic flow, and other information using the commands in the View menu.View menu commands are as follows:• Tool Bar command• Status Bar command• Project command• Message Bar command• Class Hierarchy command• Class Name List command• Name Spaces command• Name Space Contents command• Analysis Information (Graph Flow) command• Analysis Information (Tree View) command• Function List command• Max Used Stack command• Max Used Stack Route command• Find command• Find Prev command• Find Next command
� View Menu
The commands in the View menu are explained as follows:
❍ Tool Bar command
The Tool Bar command displays or hides the tool bar. When the tool bar is on display, a checkmark is displayed to the left of the command name.
❍ Status Bar command
The Status Bar command displays or hides the status bar. The status bar displays a briefexplanation of a menu command or tool bar button when it is selected, or displays the status ofa special key on the keyboard whether it is pressed being on or off. When the status bar is ondisplay, a check mark is displayed to the left of the command name.
❍ Project command
The Project command displays or hides a project window. When a project window is on display,a check mark is displayed to the left of the command name.
98
7.1 View Menu
❍ Message Bar command
The Message Bar command displays or hides the analysis message window. When theanalysis message window is on display, a check mark is displayed to the left of the commandname.
❍ Class Hierarchy command
The Class Hierarchy command displays the inheritance relationships among the classes of C++source programs.
❍ Class Name List command
The Class Name List command displays a list of the class names for C++ source programs.This command is valid only when a class inheritance diagram is displayed.
❍ Name Spaces command
The Name Spaces command displays a list of the name spaces used by source programs.
❍ Name Space Contents command
The Name Space Contents command displays detailed information on a specified name space.
❍ Analysis Information (Graph Flow) command
The Analysis Information (Graph Flow) command displays the call relationships among thefunctions in a source program on a Graph Flow window.
❍ Analysis Information (Tree View) command
The Analysis Information (Tree View) command displays the call relationships among thefunctions in a source program on a Call Tree window.
❍ Function List command
The Function List command displays a list of the functions used by a source program.
❍ Max Used Stack command
The Max Used Stack command displays information on the maximum used stack in eachfunction box displayed on a Graph Flow window.
❍ Max Used Stack Route command
The Max Used Stack Route command displays the maximum used stack route for the functionboxes on a Graph Flow window.
❍ Find command
The Find command displays the Find dialog box to permit the user to search data on a specifiedanalysis window and locate a specified character string.
❍ Find Prev command
The Find Prev command searches data in a backward direction on a selected analysis windowto locate the character string specified with the previously executed Find command.
❍ Find Next command
The Find Next command searches data in a forward direction on a selected analysis window tolocate the character string specified with the previously executed Find command.
99
CHAPTER 7 VIEW
7.2 Tool Bar
The tool bar is displayed above the menu bar at the top of the application window. The tool bar contains buttons for the tools of the C/C++ Analyzer. To use a tool, click the left side of the mouse on the corresponding tool button.
� Tool Bar
Figure 7.2-1 "Example of a Tool Bar" shows an example of a tool bar.
Figure 7.2-1 Example of a Tool Bar
Figure 7.2-2 Example of a Tool Bar (Display control bar)
The display control bar is used to specify the default window after analysis is finished. TheAnalysis Information (Graph Flow), The Analysis Information (Tree View), or Class Hierarchycan be selected.
100
7.3 Status Bar
7.3 Status Bar
The status bar is displayed at the bottom of each window f the C/C++ Analyzer.You can display or hide the status bar with the Status Bar command in the View menu.
� Status Bar
Figure 7.3-1 "Example of Status Bar" shows an example of a status bar.
Figure 7.3-1 Example of Status Bar
The status bar displays a brief explanation of a menu command when the command is selected.It also displays a brief explanation of a tool when the button is held down on the tool bar. If youcancel the tool after reading the explanation, move the mouse pointer outside the tool button,then release the mouse button.
101
CHAPTER 7 VIEW
7.4 Project Window
Use the project window to manage the source and stack information files registered in the relevant project.
� Project Window
Figure 7.4-1 "Example of Project Window" shows an example of a source file display on theproject window.
Figure 7.4-1 Example of Project Window
The project window uses Source Files, Include Files, and Stack Files folders to register files.
❍ Source Files folder
This folder is used to register selected source files.
❍ Include Files folder
This folder is used to register selected include files and include files dependent on registeredsource files.
❍ Stack Files folder
This folder is used to register the stack information files (stk) corresponding to selected sourcefiles. The stack information files to be registered can also be selected.
❍ Pop-up menu
If you position the mouse cursor inside the project window and click the right button of themouse, a pop-up menu appears.
The pop-up menu has the following commands:
102
7.4 Project Window
• Add Files: Registers additional source files or stack information files in the project.
• Remove Files: Deletes selected registered source files or stack information files from theproject.
• Edit File: Allows you to edit the source file selected on the project window.
• Hide Window: Hides the project window.
• Docking: Permits project window docking with another window or restores it to the originalsize.
• File Property: Displays the File Property dialog box showing a time stamp and pathinformation on a specified file.
Figure 7.4-2 File Property Dialog Box
Figure 7.4-3 Example of a Pop-up Menu on the Project Window
103
CHAPTER 7 VIEW
7.5 Analysis Message Window
The analysis message window shows simple analysis messages.
� Analysis Message Window
The analysis message window displays simple analysis messages after analysis. Figure 7.5-1"Example of a Message Display on the Analysis Message Window" shows an example of amessage display on the analysis message window.
Figure 7.5-1 Example of a Message Display on the Analysis Message Window
The analysis message window displays analysis messages and has the following functions:
❍ Jump to indicated line
If you click the left side of the mouse on a file name in an analysis message, you can jump tothe line indicated by the analysis message.
If the file has not been opened, the file is opened before jumping.
❍ Pop-up menu
You can display a pop-up menu and use the following commands:
• Select All: Selects all character strings on the analysis message window.
• Copy: Saves the character strings selected on the analysis message window to theclipboard.
• Clear: Clears the display contents of the analysis message window.
• Find: Displays the Find dialog box that permits the user to search data on the analysismessage window and locate a specified character string.
Figure 7.5-2 Message Find Dialog Box
• Show/Hide Window: Displays or hides the analysis message window.
• Docking: Permits analysis window docking with the main window or restores it to the originalsize.
104
7.5 Analysis Message Window
• Save Text File: Displays the Save Text File dialog box that permits the user to save thecharacter strings displayed on the analysis message window as a text file.
Figure 7.5-3 Save Text File Dialog Box
Figure 7.5-4 Example of a Pop-up Menu on the Analysis Message Window
105
CHAPTER 7 VIEW
7.6 Analysis Information (Graph Flow)
The Analysis Information (Graph Flow) command displays the call relationships among functions in graph form on a Graph Flow window. The Graph Flow window has the following functions:• Focus• Logic flow• Summary information• Xreference• Max used stack
� Graph Flow Window
When the analysis of a source program ends normally, a Graph Flow window is displayedautomatically. For a project already analyzed, you can display the relevant Graph Flow windowwith the Analysis Information (Graph Flow) in the View menu.
Figure 7.6-1 "Example of Graph Flow Window" shows an example of display on the Graph Flowwindow.
Figure 7.6-1 Example of Graph Flow Window
The Graph Flow window has the following functions:
❍ Focus function
The Focus function focuses on a specified function on the Graph Flow window. You can selectthe functions that are called or call a specified function for display using the Focus function.
For details on the Focus function, see CHAPTER 14 "GRAPH FLOW".
106
7.6 Analysis Information (Graph Flow)
❍ Logic Flow function
The Logic Flow function visibly displays the internal structure of a function specified on theGraph Flow window. You can control the display of the control structure of if, for, and otherstatements, comment lines, and include files.
For details on the Logic Flow function, see CHAPTER 18 "LOGIC FLOW".
❍ Summary Information function
The Summary Information function displays the summary information on a function specified onthe Graph Flow window.
You can display information on the characteristics of a specified function, including the name ofthe function the specified function calls, the name of the function calling the specified function,and the number of if, for, and other statements appearing in the function.
For details on the Summary Information function, see CHAPTER 19 "SUMMARY".
❍ Xreference function
The Xreference function displays Xreference information on a function specified on the GraphFlow window, including the variables and functions used in the specified function and thedefinition status of tags and macros.
For details on the Xreference function, see CHAPTER 20 "CROSS REFERRENCE".
❍ Max Used Stack function
The Max Used Stack function displays stack usage information on each function displayed onthe Graph Flow window.
For details on the Max Used Stack function, see CHAPTER 22 "MAX USED STACK".
107
CHAPTER 7 VIEW
7.7 Analysis Information (Tree View)
The Analysis Information (Tree View) command displays the call relationships among functions in list form on a Call Tree window.
� Call Tree Window
The Call Tree window displays the call relationships among functions, the type of information,and the logical number of lines of each function in list form. Figure 7.7-1 "Example of a CallTree Window" shows an example of a display on the Call Tree window.
Figure 7.7-1 Example of a Call Tree Window
❍ Parameter information
The Call Tree window displays the number of parameters, the type of information, and the nameof the function.
❍ Logical number of lines
The Call Tree window displays the number of logical lines and the name of the function.
� Pop-up Menu on the Call Tree Window
The pop-up menu that can be displayed on the Call Tree window has the following commands:
❍ Open All command
This command opens all call relationships among functions on display.
❍ Close All command
This command closes all call relationships among functions on display.
❍ Find command
This command permits the user to search the function names on the Call Tree window andlocate a specified function name.
❍ Open The File command
This command opens the source file that includes a specified function call section on an edit
108
7.7 Analysis Information (Tree View)
window.
❍ Logic Flow command
This command displays the source file that includes a specified function call section on a LogicFlow window.
❍ Summary command
This command displays summary information on a specified function.
❍ Xreference command
This command displays Xreference information on a specified function.
Figure 7.7-2 Example of a Pop-up Menu on the Call Tree Window
109
CHAPTER 7 VIEW
7.8 Class Information
The Class Information function displays a class inheritance diagram showing the inheritance relationships among classes, class lists, and other information as follows:• Focus function• Class summary information• Class inheritance information• Class usage information• Friend information• Class list
� Focus Function
The Focus function focuses on a class or class inheritance relationship in the class inheritancediagram on display.
The following Focus commands are available:
❍ Focus (Base)
This command focuses on all base classes of a specified class.
❍ Focus (Derived)
This command focuses on all derived classes of a specified class.
❍ Focus (Base & Derived)
This command displays inheritance relationships among all base and derived classes of aspecified class.
❍ Focus (1 Level)
This command displays inheritance relationships among base and derived classes of aspecified class in a single level.
� Class Summary Information
Class summary information provides class type, member data, and other information on aspecified class.
� Class Inheritance Information
Class inheritance information provides inheritance information and base class information on aspecified class.
� Class Usage Information
Class usage information provides information on how a specified class has been referenced andused.
110
7.8 Class Information
� Friend Information
Friend information provides friend information on a specified class.
� Class List
The class list shows the class names used in source programs in list form.
111
CHAPTER 7 VIEW
7.9 Name Space
The Name Space function displays information on the name spaces used in source programs.
� Name Space Information
Name space information provides information on the name spaces used in a specified sourceprogram.
� Name Space Contents
Name space contents provide detailed information on a specified name space. The informationincludes the member name and alias definition of the name space.
112
7.10 Function List
7.10 Function List
The Function List functions displays the function names defined in a source program in list form on the Function List window.
� Function List Window
The Function List window displays the names of analyzed functions and the names of thesource files in which they are defined. If a function name is clicked, the color of the frame of therelevant function box on the Graph Flow window changes to red. If a function name is double-clicked, logic flow information on the relevant function is displayed. Figure 7.10-1 "Example ofFunction List Window" shows an example of a display on the Function List window.
Figure 7.10-1 Example of Function List Window
The Function List window has the following functions:
❍ Contents of display
• [T] attribute: "T" indicates that the function is at the top level and has no caller.
• Function name: This column shows the name of the function.
• File name: This column shows the name of the source file where the respective function isdefined.
• Call count: This column shows the number of functions the respective function calls.
• Nest level: This column shows the hierarchical level of function calling.
113
CHAPTER 7 VIEW
❍ Pop-up menu
• Graph Flow [Callee]: This command displays a selected function by the Focus [Callee]function on the Graph Flow window.
• Graph Flow [Caller]: This command displays a selected function by the Focus [Callee &Caller] function on the Graph Flow window.
• Show [All Functions]: This command displays all functions on the Function List window.
• Show [Top Level]: This command displays the top-level functions that are not called byanother function on the Function List window.
• Open the File: This command displays the edit window for a selected function.
• Logic Flow: This command displays the Logic Flow window for a selected function.
Figure 7.10-2 Example of a Pop-up Menu on the Function List Window.
114
7.11 Max Used Stack
7.11 Max Used Stack
The Max Used Stack function displays information on a maximum used stack on a Graph Flow window:• Max Used Stack• Max Used Stack Route
� Max Used Stack Command
The Max Used Stack command displays information on a maximum used stack in each functionbox on a Graph Flow window so as to provide maximum used stack information on theapplication and each function.
� Max Used Stack Route Command
The Max Used Stack Route command displays the maximum used stack route based on thecalculation of a maximum used stack in the function-call relation display on the Graph Flowwindow so as to provide the functions that determine the maximum used stack for theapplication and each function as a route.
For details on the Max Used Stack function, see CHAPTER 22 "MAX USED STACK".
Note:
To calculate the maximum size of stack used, the user must create a stack information filefor each C/C++ source file with the compilation function of the C/C++ Analyzer.
115
CHAPTER 7 VIEW
7.12 Find
The Find function permits the user to search data on an active analysis window or edit window and locate a specified character string.• Find• Find Prev• Find Next• Replace• Find in Files
� Locate Operations on an Analysis Window
❍ Find
If you choose the Find command from the View menu when an analysis window is active, theFind dialog box appears.
The following conditions can be set in the Find dialog box:
• Find What
• Match Case
• Direction
Figure 7.12-1 "Find Dialog Box (Analysis Window)" shows an example of a display of the Finddialog box for the analysis window.
Figure 7.12-1 Find Dialog Box (Analysis Window)
❍ Find Prev
The Find Prev command searches data in backward direction on the analysis window to locatea specified character string.
❍ Find Next
The Find Prev command searches data in forward direction on the analysis window to locate aspecified character string.
� Find Operations on an Edit Window
116
7.12 Find
❍ Find
If you choose the Find command from the View menu when an edit window is active, the Find inCurrent File dialog box appears.
The following conditions can be set in the Find in Current File dialog box:
• Find What
• Match Whole Word Only
• Match Case
• Normal Expression
• Ambiguous Expression
• Direction
• Position
Figure 7.12-2 "Find in Current File Dialog Box (Edit Window)" shows an example of a display ofthe Find in Current File dialog box for the analysis window.
Figure 7.12-2 Find in Current File Dialog Box (Edit Window)
❍ Replace
The Replace command permits the user to replace a specified character string with a newcharacter string on an edit window.
If you choose the Replace command, the Replace dialog box appears. On the Replace dialogbox, enter the character string to be replaced in the Find What field and the character string toreplace it in the Replace With field.
If you choose the Replace command when an edit window is active, the Replace dialog boxappears.
The following conditions can be set in the Replace dialog box:
• Find What
• Replace With
• Match Whole Word Only
• Match Case
• Normal Expression
• Ambiguous Expression
• Direction
• Position
Figure 7.12-3 "Replace Dialog Box (Edit Window)" shows an example of a display of theReplace dialog box.
117
CHAPTER 7 VIEW
Figure 7.12-3 Replace Dialog Box (Edit Window)
❍ Find in Files
If you choose the Find in Files command from the Edit menu when an edit window is active, theFind in Files dialog box appears.
The following conditions can be set in the Find in Files dialog box:
• Find What
• In files
• In folder
• Match whole word only
• Match case
Figure 7.12-4 "Find in Files Dialog Box" shows an example of a display of the Find in file dialogbox.
Figure 7.12-4 Find in Files Dialog Box
118
CHAPTER 8 COMPILE
This chapter explains the Compile functions.
8.1 "Compile Menu"
8.2 "Setting Options for fcc911s"
8.3 "Setting Options for fcc935s"
8.4 "Setting up ANSI C/C++ Compiler Options"
119
CHAPTER 8 COMPILE
8.1 Compile Menu
You can compile source programs registered in a project using the following commands in the Compile menu:Start Compilation commandInterrupt Compilation commandOption command
� Compile Menu
Figure 8.1-1 "Compile Menu" shows the Compile menu.
Figure 8.1-1 Compile Menu
❍ Start Compilation command
The Start Compilation command starts compilation of source programs registered in a specifiedproject.
❍ Interrupt Compilation command
The Interrupt Compilation command cancels the compilation operation in progress.
❍ Option command
The Option command permits the user to set options for the compiler.
120
8.2 Setting Options for fcc911s
8.2 Setting Options for fcc911s
This section explains how to set compilation options for the fcc911s compiler.
� Compile Option Dialog Box for fcc911s
Figure 8.2-1 "Compile Option Dialog Box for fcc911s" shows the Compile Option dialog box forthe fcc911s compiler.
Figure 8.2-1 Compile Option Dialog Box for fcc911s
The following settings can be made in the Compile Option dialog box:
❍ Target Compiler
One of the following two types of compiler can be specified.
• C/C++ compiler (fcc911s) for the FR Family
• C/C++ compiler (fcc935s) for the FR-V Family
• ANSI C/C++ compiler
121
CHAPTER 8 COMPILE
❍ Translation Controller
One of the following two ranges of compilation can be specified. The default is the execution ofprocesses up to compilation.
• Only Pre-Processing: Translation processes up to preprocessing are executed.
• Run Compilation: Translation processes up to compilation are executed.
❍ Chip Classifcation
The Family Name of your MCU can be specified.
❍ Optimization Level
One of the following seven optimization levels can be specified. The default is level 2.
• None: No optimization
• Level 1: Optimization in level 1
• Level 2: Optimization in level 2
• Level 3: Optimization in level 3
• Level 4: Optimization in level 4
• Priority to speed: Optimization with priority to speed
• Priority to size: Optimization with priority to size
❍ Warning Level
One of the following nine warning levels can be specified.
The default is level 1.
• Level 0: No output of warning messages
• Level 1: Output of warning messages in level 1
• Level 2: Output of warning messages in level 2
• Level 3: Output of warning messages in level 3
• Level 4: Output of warning messages in level 4
• Level 5: Output of warning messages in level 5
• Level 6: Output of warning messages in level 6
• Level 7: Output of warning messages in level 7
• Level 8: Output of warning messages in level 8
❍ Target MCU
One of the MCU Number can be specified.
❍ Output DEBUG information
You can specify whether to output debug information. The default is no output.
❍ Not reading default option file
You can specify whether to read the default option file. The default is no reading.
❍ Output STACK information
You can specify whether to output a stack information file. The default is no output.
122
8.2 Setting Options for fcc911s
❍ Details
• Preprocessor: Specifies the setting of detailed options for the preprocessor.
• Language: Specifies the setting of detailed options for language specifications.
• Optimization: Specifies the setting of detailed options for optimization.
• Output: Specifies the setting of detailed options for output.
❍ Other Options’ Description
Other options available for the compiler can be entered in this field.
❍ Buttons
• Confirm button: Permits the user to check the settings of compiler options.
• OK button: Validates the settings made in the dialog box.
• Cancel button: Cancels the settings made in the dialog box.
• Help button: Displays help information.
123
CHAPTER 8 COMPILE
8.2.1 Detailed Options for Preprocessor (fcc911s Compiler)
This section explains how to set detailed options for the preprocessor of the fcc911s compiler using the Preprocessor - fcc911s Compiler dialog box. This dialog box has two setting screens: Include Paths and Macro Definition screens.
� Include Paths Screen of Preprocessor - fcc911s Compiler Dialog Box
Figure 8.2-2 "Include Paths Screen" shows the Include Paths screen.
Figure 8.2-2 Include Paths Screen
❍ Path field
This field shows the include path to be used for compilation.
❍ List of registered include paths list box
This box lists registered include paths.
The registered include paths will be passed to the preprocessor sequentially from the top in thisbox.
124
8.2 Setting Options for fcc911s
❍ Browse button
This button displays the window to select a path from existing include paths.
The path selected on the window is displayed in the Path field.
❍ Add button
This button adds the include path shown in the Path field in the List of registered paths box.
❍ Delete button
This button deletes a selected include path from the List of registered paths box.
❍ Move Upward button
This button moves the order of a selected include path, which is registered in the List ofregistered paths box, one place up.
❍ Move Downward button
This button moves the order of a selected include path, which is registered in the List ofregistered paths box, one place down.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
❍ Leave a comment in the preprocessing result check box
If this check box is clicked, a comment can be left in the preprocessing result.
125
CHAPTER 8 COMPILE
� Macro Definition Screen of Preprocessor - fcc911s Compiler Dialog Box
Figure 8.2-3 "Macro Definition Screen" shows the Macro Definition screen.
Figure 8.2-3 Macro Definition Screen
Items and buttons of the Macro Definition screen are as follows:
❍ Name field
This field permits the user to specify the name of the macro to be registered for compilation.
❍ Value field
This field permits the user to enter the value of the macro.
❍ List of Registered Macro Definition list box
This box lists registered macro names.
The registered macros will be passed to the preprocessor sequentially from the top in this listbox.
❍ Add button
This button adds the macro specified in the Name field in the List of Registered Macro Definitionbox.
❍ Delete button
This button deletes a selected macro from the List of Registered Macro Definition box.
126
8.2 Setting Options for fcc911s
❍ Move Upward button
This button moves the order of a selected macro, which is registered in the List of RegisteredMacro Definition box, one place up.
❍ Move Downward button
This button moves the order of a selected macro, which is registered in the List of RegisteredMacro Definition box, one place down.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
❍ Leave a comment in the preprocessing result check box
If this check box is clicked, a comment can be left in the preprocessing result.
127
CHAPTER 8 COMPILE
8.2.2 Detailed Options for Language Specifications (fcc911s Compiler)
This section explains how to set the detailed options for the language specifications of the fcc911s compiler using the Specification of Language - fcc911s Compiler dialog box.
� Specification of Language - fcc911s Compiler Dialog Box
Figure 8.2-4 "Specification of Language - fcc911s Compiler Dialog Box" shows the Specificationof Language - fcc911s Compiler dialog box.
Figure 8.2-4 Specification of Language - fcc911s Compiler Dialog Box
The following items can be set in the Specification of Language - fcc911s Compiler dialog box:
❍ Sign of plain "char"
An unsigned or signed format can be selected for character-type data.
The default is "Unsigned."
❍ Sign of bit field of "int"
An unsigned or signed format can be selected for integer-type bit field.
The default is "Unsigned."
❍ Language
You can specify the level of language specification.
The default is "Embedded C++."
❍ INLINE expansion of a function qualified with "_interrupt"
You can specify whether to execute inline expansion of the function related to interrupt. Thedefault is execution of inline expansion (a check mark is displayed).
128
8.2 Setting Options for fcc911s
❍ Regard a valuable qualified with "_io" as volatile
You can specify whether to regard each "_io" type qualifier to be volatile. The default isregarding it to be volatile (a check mark is displayed).
❍ INLINE expansion of an ITRON system-call functions
You can specify whether to execute inline expansion of the function related to interrupt. Thedefault is non-execution of inline expansion (no check mark is displayed).
129
CHAPTER 8 COMPILE
8.2.3 Detailed Options for Optimization (fcc911s Compiler)
This section explains how to set the detailed optimization options for the fcc911s compiler using the Option on Optimization [fcc911s] - fcc911s Compiler dialog box.
� Option on Optimization [fcc911s] - fcc911s Compiler Dialog Box
Figure 8.2-5 "Option on Optimization [fcc911s] - fcc911s Compiler Dialog Box" shows theOption on Optimization [fcc911s] - fcc911s Compiler dialog box.
Figure 8.2-5 Option on Optimization [fcc911s] - fcc911s Compiler Dialog Box
The following items can be set in the Option on Optimization [fcc911s] - fcc911s Compiler dialogbox:
❍ Address size of external symbols on the code section
You can specify the address size of the external symbols on the code section. The default is"32 bits."
130
8.2 Setting Options for fcc911s
❍ Address size of external symbols on data section
You can specify the address size of the external symbols on the data section. The default is "32bits."
❍ Minimal alignment boundary for static variables
You can specify the value of the minimal alignment boundary for static variables. The default is"1 byte."
❍ Method of allocation of an argument area
You can specify the static or dynamic method for the allocation of an argument area. Thedefault is "static."
❍ Type of floating constant without suffix
You can specify the type of the floating constant without suffix. The default is "double."
❍ Optimization of changing the evaluation method of arithmetic operation
You can specify whether to execute optimization to change the method of evaluating arithmeticoperations. The default is non-execution of the optimization (no check mark is displayed).
❍ Optimization of pointer aliasing
You can specify whether to execute optimization of the data indicated by the pointer. Thedefault is execution of optimization (a check mark is displayed).
❍ Instruction scheduling
You can specify whether to execute instruction scheduling. The default is execution ofscheduling (a check mark is displayed).
❍ Loop unrolling
You can specify whether to execute loop unrolling. The default is execution of loop unrolling (acheck mark is displayed).
❍ Inline expansion of standard library functions/replacement to other equivalent functions
You can specify whether to execute inline expansion of standard functions or replacement withother functions. The default is no execution of inline expansion or replacement (no check markis displayed).
❍ Specified functions
If you have turned on this check box, specify the functions as the targets of inline expansion inthe field below. The default of this item is "off."
❍ All functions
If you turn on this check box, specify the number of lines of the functions subjected to inlineexpansion. The check box is unchecked by default.
❍ Specify the limitation of line numbers of functions to be inlined
If you have turned on this check box, specify the number of lines of the functions as targets ofinline expansion. The default of this item is "off."
131
CHAPTER 8 COMPILE
8.2.4 Detailed Options for Output (fcc911s Compiler)
This section explains how to set the detailed output options for the fcc911s compiler using the Options for outputs [fcc911s] - fcc911s Compiler dialog box.
� Options for Outputs [fcc911s] - fcc911s Compiler Dialog Box
Figure 8.2-6 "Options for Outputs [fcc911s] - fcc911s Compiler Dialog Box" shows the Optionsfor outputs [fcc911s] - fcc911s Compiler dialog box.
Figure 8.2-6 Options for Outputs [fcc911s] - fcc911s Compiler Dialog Box
You can set the following items in the Options for outputs [fcc911s] - fcc911s Compiler dialogbox:
❍ Insert the comment lines of C/C++ source files into assembler lines
You can specify whether to insert C or C++ source files as comment lines into assembler sourcefiles (*.asm). The default is no insertion (no check mark is displayed).
132
8.2 Setting Options for fcc911s
❍ Output assembler lists
You can specify whether to output assembler lists. The default is no output (no check mark isdisplayed).
❍ Put "static" variables into memory in source sequential order
You can specify whether to be stored in memory static variables in order in while they describedin the source. The default is storing in memory according to the order of variable alignment (nocheck mark is displayed).
❍ Automatically instantiated templates
Check this check box to specify the method of instantiate templates.
❍ Use Old for loop initialization scooping
Check this check box to applies the scope of the declaration in the initialization type of for ismade a specification before ANSI.
❍ Use alternative keywords.
Check this check box to use the keywords of alternative.
❍ Generation type of a virtual function table
Check this check box to make a virtual function table.
❍ Specify the sections of compiler - outputs
You can specify changes in the output sections of the compiler. To specify a section, enter thename, type, and address of the section in the respective fields.
133
CHAPTER 8 COMPILE
8.3 Setting Options for fcc935s
This section explains how to set compilation options for the fcc935s compiler.
� Compile Option Dialog Box for fcc935s
Figure 8.2-1 "Compile Option Dialog Box for fcc935s" shows the Compile Option dialog box forthe fcc935s compiler.
Figure 8.3-1 Compile Option Dialog Box for fcc935s
The following settings can be made in the Compile Option dialog box:
❍ Target Compiler
One of the following two types of compiler can be specified.
• C/C++ compiler (fcc911s) for the FR Family
• C/C++ compiler (fcc935s) for the FR-V Family
• ANSI C/C++ compiler
134
8.3 Setting Options for fcc935s
❍ Translation Controller
One of the following two ranges of compilation can be specified. The default is the execution ofprocesses up to compilation.
• Only Pre-Processing: Translation processes up to preprocessing are executed.
• Run Compilation: Translation processes up to compilation are executed.
❍ Chip Classifcation
The Family Name of your MCU can be specified.
❍ Optimization Level
One of the following seven optimization levels can be specified. The default is level 2.
• None: No optimization
• Level 1: Optimization in level 1
• Level 2: Optimization in level 2
• Level 3: Optimization in level 3
• Level 4: Optimization in level 4
• Priority to speed: Optimization with priority to speed
• Priority to size: Optimization with priority to size
❍ Warning Level
One of the following nine warning levels can be specified.
The default is level 1.
• Level 0: No output of warning messages
• Level 1: Output of warning messages in level 1
• Level 2: Output of warning messages in level 2
• Level 3: Output of warning messages in level 3
• Level 4: Output of warning messages in level 4
• Level 5: Output of warning messages in level 5
• Level 6: Output of warning messages in level 6
• Level 7: Output of warning messages in level 7
• Level 8: Output of warning messages in level 8
❍ Target MCU
One of the MCU Number can be specified.
❍ Output DEBUG information
You can specify whether to output debug information. The default is no output.
❍ Not reading default option file
You can specify whether to read the default option file. The default is no reading.
❍ Output STACK information
You can specify whether to output a stack information file. The default is no output.
135
CHAPTER 8 COMPILE
❍ Details
• Preprocessor: Specifies the setting of detailed options for the preprocessor.
• Language: Specifies the setting of detailed options for language specifications.
• Optimization: Specifies the setting of detailed options for optimization.
• Output: Specifies the setting of detailed options for output.
❍ Other Options’ Description
Other options available for the compiler can be entered in this field.
❍ Buttons
• Confirm button: Permits the user to check the settings of compiler options.
• OK button: Validates the settings made in the dialog box.
• Cancel button: Cancels the settings made in the dialog box.
• Help button: Displays help information.
136
8.3 Setting Options for fcc935s
8.3.1 Detailed Options for Preprocessor (fcc935s Compiler)
This section explains how to set detailed options for the preprocessor of the fcc935s compiler using the Preprocessor - fcc935s Compiler dialog box. This dialog box has two setting screens: Include Paths and Macro Definition screens.
� Include Paths Screen of Preprocessor - fcc935s Compiler Dialog Box
Figure 8.2-2 "Include Paths Screen" shows the Include Paths screen.
Figure 8.3-2 Include Paths Screen
❍ Path field
This field shows the include path to be used for compilation.
❍ List of registered include paths list box
This box lists registered include paths.
The registered include paths will be passed to the preprocessor sequentially from the top in thisbox.
❍ Browse button
This button displays the window to select a path from existing include paths.
137
CHAPTER 8 COMPILE
The path selected on the window is displayed in the Path field.
❍ Add button
This button adds the include path shown in the Path field in the List of registered paths box.
❍ Delete button
This button deletes a selected include path from the List of registered paths box.
❍ Move Upward button
This button moves the order of a selected include path, which is registered in the List ofregistered paths box, one place up.
❍ Move Downward button
This button moves the order of a selected include path, which is registered in the List ofregistered paths box, one place down.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
❍ Leave a comment in the preprocessing result check box
If this check box is clicked, a comment can be left in the preprocessing result.
138
8.3 Setting Options for fcc935s
� Macro Definition Screen of Preprocessor - fcc935s Compiler Dialog Box
Figure 8.2-3 "Macro Definition Screen" shows the Macro Definition screen.
Figure 8.3-3 Macro Definition Screen
Items and buttons of the Macro Definition screen are as follows:
❍ Name field
This field permits the user to specify the name of the macro to be registered for compilation.
❍ Value field
This field permits the user to enter the value of the macro.
❍ List of Registered Macro Definition list box
This box lists registered macro names.
The registered macros will be passed to the preprocessor sequentially from the top in this listbox.
❍ Add button
This button adds the macro specified in the Name field in the List of Registered Macro Definitionbox.
❍ Delete button
This button deletes a selected macro from the List of Registered Macro Definition box.
139
CHAPTER 8 COMPILE
❍ Move Upward button
This button moves the order of a selected macro, which is registered in the List of RegisteredMacro Definition box, one place up.
❍ Move Downward button
This button moves the order of a selected macro, which is registered in the List of RegisteredMacro Definition box, one place down.
❍ Recognize lines starting with // as comment in C source
The comment on C/C++ style can be treated in the source file.
The comment on /**/ style and the comment on // style can be written.
❍ Leave a comment in the preprocessing result check box
If this check box is clicked, a comment can be left in the preprocessing result.
140
8.3 Setting Options for fcc935s
8.3.2 Detailed Options for Language Specifications (fcc935s Compiler)
This section explains how to set the detailed options for the language specifications of the fcc935s compiler using the Specification of Language - fcc935s Compiler dialog box.
� Specification of Language - fcc935s Compiler Dialog Box
Figure 8.2-4 "Specification of Language - fcc935s Compiler Dialog Box" shows the Specificationof Language - fcc935s Compiler dialog box.
Figure 8.3-4 Specification of Language - fcc935s Compiler Dialog Box
The following items can be set in the Specification of Language - fcc935s Compiler dialog box:
❍ Sign of plain "char"
An unsigned or signed format can be selected for character-type data.
The default is "Unsigned."
❍ Sign of bit field of "int"
An unsigned or signed format can be selected for integer-type bit field.
The default is "Unsigned."
❍ Language
You can specify the level of language specification.
The default is "Embedded C++."
❍ INLINE expansion of a function qualified with "_interrupt"
You can specify whether to execute inline expansion of the function related to interrupt. Thedefault is execution of inline expansion (a check mark is displayed).
141
CHAPTER 8 COMPILE
❍ Regard a valuable qualified with "_io" as volatile
You can specify whether to regard each "_io" type qualifier to be volatile. The default isregarding it to be volatile (a check mark is displayed).
142
8.3 Setting Options for fcc935s
8.3.3 Detailed Options for Optimization (fcc935s Compiler)
This section explains how to set the detailed optimization options for the fcc935s compiler using the Option on Optimization [fcc935s] - fcc935s Compiler dialog box.
� Option on Optimization [fcc935s] - fcc935s Compiler Dialog Box
Figure 8.2-5 "Option on Optimization [fcc935s] - fcc935s Compiler Dialog Box" shows theOption on Optimization [fcc935s] - fcc935s Compiler dialog box.
Figure 8.3-5 Option on Optimization [fcc935s] - fcc935s Compiler Dialog Box
The following items can be set in the Option on Optimization [fcc935s] - fcc935s Compiler dialogbox:
❍ Minimal alignment boundary for static variables
You can specify the value of the minimal alignment boundary for static variables.
The default is "1 byte."
143
CHAPTER 8 COMPILE
❍ Type of floating point constant without suffix
You can specify the type of the floating constant without a suffix.
The default is "double."
❍ Instruction scheduling
You can specify whether to execute instruction scheduling.
The default is execution of scheduling (a check mark is display).
❍ Scheduling of great area
You can specify whether to applied for global scheduling for instruction transfer beyond thebranch.
The default is "off."
❍ Output non-executing instruction
You can specify the whether to output Non-Excepting instruction.
The default is Not-doing (no check mark is displayed).
❍ Optimization of changing the evaluation method of arithmetic operation
You can specify whether to execute optimization to change the method of evaluating arithmeticoperations.
The default is non-execution of the optimization (no check mark is displayed).
❍ Optimization of pointer aliasing
You can specify whether to execute optimization of the data indicated by the pointer.
The default is execution of optimization (a check mark is displayed).
❍ Loop unrolling
You can specify whether to execute loop unrolling.
The default is execution of loop unrolling (a check mark is displayed).
❍ Software pipelining
You can specify whether to execute software pipelining.
The default is execution of software pipelining (a check mark is displayed).
❍ Output conditional instruction
You can specify whether to output conditional instruction.
The default is not output of conditional instruction (no check mark is displayed).
144
8.3 Setting Options for fcc935s
❍ In-line expansion of standard library functions / replacement to other equivalent function
You can specify whether to execute in-line expansion of standard functions or replacement withother functions.
The default is not execution of in-line expansion or replacement (no check mark is displayed).
❍ Specified function
If you have turned on this check box, specify the functions as the targets of in-line expansion inthe field below.
The default of the item "off."
❍ All functions
If you turn on this check box, specify the number of lines of the functions subjected to inlineexpansion. The check box is unchecked by default.
❍ Specify the limitation of line numbers of functions to be in-lined
If you have turned on this check box, specify the number of lines of the functions as targets ofin-line expansion.
The defaults of this item is "off."
145
CHAPTER 8 COMPILE
8.3.4 Detailed Options for Output (fcc935s Compiler)
This section explains how to set the detailed output options for the fcc935s compiler using the Options for outputs [fcc935s] - fcc935s Compiler dialog box.
� Options for Outputs [fcc935s] - fcc935s Compiler Dialog Box
Figure 8.2-6 "Options for Outputs [fcc935s] - fcc935s Compiler Dialog Box" shows the Optionsfor outputs [fcc935s] - fcc935s Compiler dialog box.
Figure 8.3-6 Options for Outputs [fcc935s] - fcc935s Compiler Dialog Box
146
8.3 Setting Options for fcc935s
You can set the following items in the Options for outputs [fcc935s] - fcc935s Compiler dialogbox:
❍ Insert the comment lines of C/C++ source files into assembler lines
You can specify whether to insert C or C++ source files as comment lines into assembler sourcefiles (*.asm). The default is no insertion (no check mark is displayed).
❍ Output assembler lists
You can specify whether to output assembler lists. The default is no output (no check mark isdisplayed).
❍ Put "static" variables into memory in source sequential order
You can specify whether to be stored in memory static variables in order in while they describedin the source. The default is storing in memory according to the order of variable alignment (nocheck mark is displayed).
❍ Automatically instantiated templates
Check this check box to specify the method of instantiate templates.
❍ Use Old for loop initialization scooping
Check this check box to applies the scope of the declaration in the initialization type of for ismade a specification before ANSI.
❍ Use alternative keywords
Check this check box to use the keywords of alternative.
❍ Generation type of a virtual function table
Check this check box to make a virtual function table.
❍ Line up the divergence label
Check this check box to specify the method of the line of the divergence label.
❍ Specify the sections of compiler - outputs
You can specify changes in the output sections of the compiler. To specify a section, enter thename, type, and address of the section in the respective fields.
147
CHAPTER 8 COMPILE
8.4 Setting up ANSI C/C++ Compiler Options
The ANSI C/C++ compiler is compiled in a full ANSI mode of fcc911s.
� Dialog box for setting up the ANSI C/C++ compiler options
Figure 8.4-1 "Compile Option Dialog Box for ANSI C/C++" shows the Compile Option dialog boxfor the ANSI C/C++ compiler.
Figure 8.4-1 Compile Option Dialog Box for ANSI C/C++
The following settings can be made in the Compile Option dialog box:
❍ Target Compiler
One of the following two types of compiler can be specified.
• C/C++ compiler (fcc911s) for the FR Family
• C/C++ compiler (fcc935s) for the FR-V Family
• ANSI C/C++ compiler
148
8.4 Setting up ANSI C/C++ Compiler Options
Reference:
The menu which can be set when the ANSI C/C++ is selected by the option of thecompilation becomes only the use language and a pre-processor.
❍ Details
• Preprocessor: Specifies the setting of detailed options for the preprocessor. Pease see"8.2.1 Detailed Options for Preprocessor (fcc911s Compiler)" for details.
❍ Buttons
• Confirm button: Permits the user to check the settings of compiler options.
• OK button: Validates the settings made in the dialog box.
• Cancel button: Cancels the settings made in the dialog box.
• Help button: Displays help information.
149
CHAPTER 8 COMPILE
150
CHAPTER 9 CHECK
This chapter explains the check feature.
9.1 "Check Menu"
9.2 "Displaying Inline Expansion Candidate Feature"
151
CHAPTER 9 CHECK
9.1 Check Menu
Programs can be checked using the check command. The check command can be executed from the check menu as follows:• [Inline] command
� Check Menu
Figure 9.1-1 Check Menu
152
9.2 Displaying Inline Expansion Candidate Function
9.2 Displaying Inline Expansion Candidate Function
Click the [Inline] command displayed in the [Check] menu. An inline expansion candidate function for which the expanded line count is equal to or less than the line count specified in the [Upper limit of inline candidate executable statement size] in the [Option] dialog box is retrieved.When no function that can be used as the inline expansion candidate exists, a message that indicates the no-function state is displayed.
� Displaying Inline Expansion Candidate Function
The names of all functions to be analyzed and used as inline expansion candidates aredisplayed in the [Candidate for Inline function] window (see Figure 9.2-1 "[Candidate for InlineFunction] Window").
Figure 9.2-1 [Candidate for Inline Function] Window
The [Candidate for Inline function] window shows the following information:
❍ Function name:
Name of analyzed function used as inline expansion candidate
❍ Executable statement count:
Number of executable statements for functions used as inline expansion candidates
❍ File:
Name of files in which functions as inline expansion candidates are defined
Functions can be used as inline expansion candidates when the following conditions aresatisfied:
• The function is called from a function in a source program.
• The function is defined in a source program.
• The real argument type of the function is the same as the dummy argument type.
• The number of real arguments in the function is the same as the number of dummyarguments.
• The arguments of the function do not have classes (C++).
• The arguments of the function do not have structures or unions.
153
CHAPTER 9 CHECK
• The function is not recursively called.
• The function does not call the setjmp function.
• "try," "throw," or "catch" statements are not included in the function. (C++)
• The function is not a virtual function. (C++)
• The function was not called by referencing the address.
• The line count of the function is equal to or less than the line count specified in [Upper limit ofinline candidate executable statement size].
Reference:
A source program can be edited using the editor, which is called by double-clicking thesource file name displayed in the [Candidate for Inline function] window. For an explanationof the editor, see CHAPTER 21 "PROGRAM EDITING".
The upper limit of the inline candidate executable statement size must be specifiedaccording to the size of the area to be used.
154
CHAPTER 10 GLOBAL INFORMATION
This chapter explains the operation of global information.
10.1 "Selecting Global Information"
10.2 "Displaying Global Variable Information"
10.3 "Pointing to const-Type Qualification Declaration Candidate"
10.4 "Pop-up Menu of Global Information"
10.5 "Searching for Text"
155
CHAPTER 10 GLOBAL INFORMATION
10.1 Selecting Global Information
Select the [Global] menu in the window. In the [Global] menu, one of the following commands can be specified:• Global (C++)• Candidate for const
� Selecting Global Information
Figure 10.1-1 "[Global] Menu" shows an example of selecting global information.
Figure 10.1-1 [Global] Menu
❍ [Global (C++)] command
Displays information on the global variable used in the source program to be analyzed.
❍ [Candidate for const] command
Displays the global variable to be used in the source program to be analyzed and as the const-type qualification candidate.
156
10.2 Displaying Global Variable Information
10.2 Displaying Global Variable Information
Click the [Global (C++)] command in the [Global] menu. The function using the global variable used in the analyzed program is displayed.When no global variables are being used, the message indicating the no-global-variable state is displayed.
� Displaying C/C++ Global Variable Information
Figure 10.2-1 "Example of C/C++ Global Variable Display Window" shows an example of the C/C++ global variable display window.
Figure 10.2-1 Example of C/C++ Global Variable Display Window
❍ Name
Name of global variable used in all parts of an analyzed program
❍ Type
Declared type of global variable
❍ Function name
Name of function in which the global variable is used
157
CHAPTER 10 GLOBAL INFORMATION
10.3 Pointing to const-Type Qualification Declaration Candidate
Click the [Candidate for const] command in the [Global] menu. The global variables used in the analyzed program and to be optimized with the const-type qualification declaration are displayed.When no const-type candidates are found, the message indicating the no-candidate status is displayed.
� Specifying const-type Qualification Declaration Candidate
Figure 10.3-1 "Example of Window for const-type Qualification Declaration Candidate Display"shows an example of the window for const-type qualification declaration candidate display.
Figure 10.3-1 Example of Window for const-type Qualification Declaration Candidate Display
❍ Name
Name of variables used as const-type qualification declaration candidates in all parts of theanalyzed program
❍ Type
Declared type of variable used as const-type qualification declaration candidate
158
10.4 Pop-up Menu of Global Information
10.4 Pop-up Menu of Global Information
Click the right side of the mouse while in the Global Variable window to display a pop-up menu in the window.
� Pop-up Menu of Global Information
Figure 10.4-1 "Global Variable Window Pop-up Menu" shows the Global Variable window pop-up menu.
Figure 10.4-1 Global Variable Window Pop-up Menu
❍ [Copy] command
Saves a selected character string onto the clip board. This command has the same function asthe [Copy] command in the [Edit] menu.
❍ [Select All] command
Selects all characters displayed in the global information window. This command has the samefunction as the [Select All] command in the [Edit] menu.
❍ [Find] command
Searches for text displayed in the cross reference information window. This command has thesame function as the [Find] command in the [View] menu.
Remarks
The [Logic Flow] command cannot be used for a global information display.
159
CHAPTER 10 GLOBAL INFORMATION
10.5 Searching for Text
Searches for text displayed as global information.
� Searching for Text
Click the [Find] command in the [View] menu or click the [Find] command in the pop-up menu ofthe Global Variable window.
The [Find] dialog box shown in Figure 10.5-1 "[Find] Dialog Box for Global Information" isdisplayed.
Figure 10.5-1 [Find] Dialog Box for Global Information
Enter the text to be searched for in the [Find what:] box, specify the search direction and clickthe [Find Next] button to search for the specified text in the specified direction.
When the [Find Prev] command in the [View] menu is clicked, the text is searched for in thebackward direction. When the [Find Prev] command or [Find Next] command in the [View]menu is clicked, the text is searched for in the direction specified by the selected command.
160
CHAPTER 11 SETUP
This chapter explains the setup operation.
11.1 "Setup Menu"
11.2 "Editor Customization"
11.3 "Environment of Compilers"
161
CHAPTER 11 SETUP
11.1 Setup Menu
The standard editor and compiler environment can be set up using setup commands. The following setup commands can be used from the [Setup] menu:• [Editor Customize] command• [Editor Setup] command• [Compilation Environment] command
� Setup Menu
Figure 11.1-1 Setup Menu
❍ [Editor Customize] command
Displays the setup dialog box for the editor to be used in C/C++ analyzer.
❍ [Editor Setup] command
Displays the setup dialog box for the standard editor contained in the C/C++ analyzer.
This command can only be used if the standard editor is selected.
❍ [Compilation Environment] command
Specifies the compilation environment that will use the C/C++ analyzer compilation function.
To use this command, the Softune compiler must be installed in advance.
162
11.2 Editor Customization
11.2 Editor Customization
The C/C++ analyzer has the standard editor function. An external editor can also be called using the customization function. This section explains how to set up the external editor.
� Setting External Editor
With the graph flow window not displayed, select the [Editor Customize] command displayed inthe [Setup] menu to display the CUSTOMIZE dialog box.
Figure 11.2-1 CUSTOMIZE Dialog Box
Check the [Use External Editor] check box to register and use a familiar external editor.
❍ Editor name
Register the name of the editor used.
163
CHAPTER 11 SETUP
❍ Full path of the executive file
Specify the full-path of the execution file of the editor.
❍ Current directory for the editor
Specify the directory which starts the editor.
❍ Opening command-line
Specify the argument passed to the editor.
❍ List
The registration situation of the editor is displayed.
164
11.3 Environment of Compiler
11.3 Environment of Compiler
A compiler can be activated from the C/C++ analyzer. After the environment of the compiler is set up, the compiler can be activated. This section explains how to set up the environment of the compiler.
� Environment of Compiler
Select the [Compilation Environment] command displayed in the [Setup] menu. TheEnvironment of the compiler] dialog box is displayed.
Figure 11.3-1 [Environment of the compiler] Dialog Box
The Environment of the compiler] dialog box has the following features:
❍ Install Directory
Specify the name of the directory in which the compiler is installed.
❍ Environmental variables adopted in compilation
• Table Name: Enter the name of the environmental variable to be registered.
• Value: Enter the value of the environmental variable to be registered.
• List of registered environmental variables: Displays the environment variables alreadyregistered.
• [Register] button: Adds the environment variable (entered in the environmental variableinput field) to the list of registered environmental variables.
• [Remove] button: Deletes an environmental variable already registered in the list of
165
CHAPTER 11 SETUP
registered environment variables. To delete the environmental variable, select theenvironmental variable to be deleted, click the left button of the mouse, then press the[Remove] button.
• [Upward] button: Moves the target environmental variable upwards in the list ofenvironmental variables.
• [Downward] button: Moves the target environmental variable downwards in the list ofenvironmental variables.
Note:
To use the compilation function, a compiler manufactured by Fujitsu must be installed inadvance. If a Fujitsu compiler is not installed, a message indicating a no-compiler-installedstate is displayed when the compiler environment function is used.
166
CHAPTER 12 WINDOWS
This chapter explains window display and operation.
12.1 "[Window] Menu"
167
CHAPTER 12 WINDOWS
12.1 [Window] Menu
Windows can be operated and the window display method can be changed using window commands. The [Window] menu has the following commands:• [Cascade] command• [Tile Horizontally] command• [Tile Vertically] command• [Arrange Icons] command• [Close all] command• [window-name-1, 2, ...] commands
� [Window] Menu
Figure 12.1-1 [Window] Menu
❍ [Cascade] command
Displays two or more windows overlapping.
❍ [Tile Horizontally] command
Displays two or more windows horizontally.
❍ [Tile Vertically] command
Displays two or more windows vertically.
❍ [Arrange Icons] command
Arranges the iconized windows at the bottom of the application main window. When the filewindow is open and overlapping the bottom part of the main window, the icons under thiswindow cannot be viewed.
❍ [Close all] command
Closes all the displayed windows.
❍ [window-name-1, 2, ...] commands
Displays a list of various windows currently opened by the C/C++ analyzer. This list is displayedat the bottom field of the [Window] menu.
168
CHAPTER 13 HELP
This chapter explains the display and operation of the help function.
13.1 "[Help] Menu"
169
CHAPTER 13 HELP
13.1 [Help] Menu
Help topics can be searched for using the help command.The [Help] menu has the following commands:• [Help Topics] command• [About C/C++ Analyzer] command
� [Help] Menu
Figure 13.1-1 [Help] Menu
❍ [Help Topics] command
Displays the outline of the C/C++ analyzer function and the table of contents of the help data.The printing and keyword searching of help files can also be performed.
❍ [About C/C++ Analyzer] command
Displays version and copyright information on the C/C++ analyzer.
170
CHAPTER 14 GRAPH FLOW
This chapter explains the display and operation of a graph flow.
14.1 "Displaying Graph Flow"
14.2 "Pop-up Menu of Graph Flow"
14.3 "Enlargement/Reduction Display"
14.4 "Focus Display"
14.5 "Displaying Undefined Functions"
14.6 "Outputting Bitmap File"
171
CHAPTER 14 GRAPH FLOW
14.1 Displaying Graph Flow
A graph flow shows the call relationship between functions contained in a program. When there are recursive functions and undefined functions, the type of the function is displayed.
� Displaying Graph Flow
The [Graph Flow] window shows the call relationship between functions in a program.
If the graph flow analysis is terminated normally, the [Graph Flow] window is displayedautomatically.
An analyzed project can be opened, and its [Graph Flow] window can be opened using the[Display Analysis Information] command in the [Analyze] menu.
Figure 14.1-1 Graph Flow
A box indicates a function.
A line indicates a function-calling relation.
A red line indicates a call from a lower box (function) to an upper box (function) or indicates arecursive call to the box (function) itself.
When a function recursively calls itself, a red-line box is displayed in the upper-right corner ofthe box as shown in Figure 14.1-2 "Example of a Recursive Call".
172
14.1 Displaying Graph Flow
Figure 14.1-2 Example of a Recursive Call
Boxes and lines will not be displayed in the following cases:
• The source program has a function call but the function is not found in the analyzed sourceprogram. (Example: C library, system call)
• To display such functions as boxes, click the [All functions] command displayed in the[View] menu.
• A function is called using a pointer.
173
CHAPTER 14 GRAPH FLOW
14.2 Pop-up Menu of Graph Flow
Place the mouse pointer into the function box displayed in the [Graph Flow] window and click the right side of the mouse. A pop-up menu is displayed in the [Graph Flow] window.
� Graph Flow Pop-up Menu
Figure 14.2-1 Graph Flow Pop-up Menu (Displayed Outside the Box)
Figure 14.2-2 Graph Flow Pop-up Menu (Displayed Inside the Box)
• [Previous Focus Level] and [Top Focus Level] commands: See Section 14.4 "FocusDisplay".
• [Zoom] command: See Section 14.3 "Enlargement/Reduction Display".
174
14.2 Pop-up Menu of Graph Flow
• [Open the File] command: Displays the specified function in the edit window.
• [Focus [Callee]] command and [Focus [Callee & Caller]] command: See Section 14.4 "FocusDisplay".
• [Logic Flow] command: See CHAPTER 18 "LOGIC FLOW".
• [Summary] command: See CHAPTER 19 "SUMMARY".
• [Xreference] command: See CHAPTER 20 "CROSS REFERENCE".
• [Show Max Used Stack] command: See CHAPTER 22 "MAX USED STACK".
• [Max Used Stack Route] command: See CHAPTER 22 "MAX USED STACK".
• [Tree-viewed Graph Flow] command: See Section 7.7 "Analysis Information (Tree View)".
• [All Functions] command: See Section 14.5 "Displaying Undefined Functions".
• [Focus [Max Used Stack Route]] command: See CHAPTER 22 "MAX USED STACK".
• [Find..] command: See Section 7.2 "Tool Bar".
• [Output Bitmap File...] command: See Section 14.6 "Outputting Bitmap File".
175
CHAPTER 14 GRAPH FLOW
14.3 Enlargement/Reduction Display
A graph flow can be displayed with a specified magnification factor by clicking the [Zoom] command in the pop-up menu of the Graph Flow window.
� Enlarging Graph Flow
Figure 14.3-1 "Example of Enlarged Graph Flow" shows an example of an enlarged graph flow.
Figure 14.3-1 Example of Enlarged Graph Flow
� Reducing Graph Flow
Figure 14.3-2 "Example of Reduced Graph Flow" shows an example of a reduced graph flow.
176
14.3 Enlargement/Reduction Display
Figure 14.3-2 Example of Reduced Graph Flow
Reference:
When the original size is 100%, an enlarged size (125%, 150%, 175%, or 200%) or reducedsize (75% or 50%) can be displayed. When a 50% size is displayed, the information insideeach box in the graph flow is not displayed and call-relation-indicating boxes and lines onlyare displayed.
177
CHAPTER 14 GRAPH FLOW
14.4 Focus Display
Place the mouse pointer in the base function box in the [Graph Flow] window, display the graph flow pop-up menu, and click the [Focus [Callee]] or [Focus [Callee & Caller]] command to display a graph flow starting from the specified function.
� Selecting Focus
Figure 14.4-1 "Pop-up Menu of Graph Flow (Focus Selection)" shows an example of focusselection.
Figure 14.4-1 Pop-up Menu of Graph Flow (Focus Selection)
� Displaying Focus
Focus display can be classified as follows:
• Display of calling relationship from specified function
• Display of calling relationship from and to specified function
When the [Focus [Callee]] command in the graph flow pop-up menu is clicked, the screenshown in Figure 14.4-2 "Display Example of Graph Flow Using the [Focus [Callee]] Command"is displayed.
178
14.4 Focus Display
Figure 14.4-2 Display Example of Graph Flow Using the [Focus [Callee]] Command
When the [Focus [Callee & Caller]] command in the graph flow pop-up menu is clicked, thescreen shown in Figure 14.4-3 "Display Example of a Graph Flow Using the [Focus [Callee &Caller]] Command" is displayed. The name of the base calling function is displayed in the box inthe color green.
Figure 14.4-3 Display Example of a Graph Flow Using the [Focus [Callee & Caller]] Command
These operations can be executed consecutively. The [Focus [Callee]] display can becombined with the [Focus [Callee & Caller]] display. The operation count is displayed in the[Focus Level] field at the left top of the Graph Flow window. (The initial value of the Focus Levelis 0.)
To return the display to its previous state, click the [Previous Focus Level] command displayedin the graph flow pop-up menu. To return the display to its initial state (focus level 0), click the[Top Focus Level] command in the graph flow pop-up menu.
179
CHAPTER 14 GRAPH FLOW
14.5 Displaying Undefined Functions
Click the [All Functions] command in the graph flow pop-up menu. The call relationship of function boxes in the analyzed source program and the function boxes whose procedures are not contained in the source program are displayed. The bottoms of these boxes are displayed in yellow.
� Displaying Undefined Functions
Usually only function boxes contained in the analyzed source program are displayed. Functionboxes called but whose procedures are not contained in the source program (e.g., C standardlibrary or operating system call) are not displayed.
However, when the [All Functions] command in the graph flow pop-up menu is clicked, both thefunction boxes contained in the analyzed source program and the function boxes that are calledbut whose procedures are not contained in the source program are displayed. The functionboxes called but whose procedures are not contained in the source program are displayed. Thebottom of these boxes are displayed in yellow.
Figure 14.5-1 Display Example of Undefined Functions
180
14.6 Outputting Bitmap File
14.6 Outputting Bitmap File
The window image of a graph flow can be saved in a bitmap file by clicking the [Output Bitmap File...] command in the pop-up menu of the Graph Flow window.
� Outputting Bitmap File
The window image of a graph flow can be saved in a bitmap file. Figure 14.6-1 "Example ofselecting the [Output Bitmap File...] command" shows an example of selecting the [OutputBitmap File...] command.
Figure 14.6-1 Example of selecting the [Output Bitmap File...] command
Figure 14.6-2 "Display of saving a bitmap file" shows a display for saving a bitmap file.
Figure 14.6-2 Display of saving a bitmap file
181
CHAPTER 14 GRAPH FLOW
182
CHAPTER 15 CALL TREE
This chapter explains the display and operation of a call tree.
15.1 "Displaying Call Tree"
15.2 "Call Tree Pop-up Menu"
183
CHAPTER 15 CALL TREE
15.1 Displaying Call Tree
Display the graph flow and select the [Analysis Information [Tree View]] command displayed in the [View] menu to display a Call Tree window.
� Displaying Call Tree
A call tree is a list structure that indicates the function call relationship.
Figure 15.1-1 Display Example of Call Tree
Each box in the call tree shows a function in the program. Its function name and arguments arealso displayed. A value enclosed in parentheses indicates the number of logical lines of thefunction.
: It is shown that the function is displayed from the above to line the omittedfunction call ahead.
Functions with a recursive call are shown with an arrow (see Figure 15.1-2 "Example ofFunction with Recursive Call").
Figure 15.1-2 Example of Function with Recursive Call
<Detail> <Detail>
184
15.2 Call Tree Pop-up Menu
15.2 Call Tree Pop-up Menu
Place the mouse pointer in a function box in the Call Tree window. Click the right side of the mouse to display a pop-up menu in the call tree. Click the left side of the mouse to display the function box in red.
� Call Tree Pop-up Menu
Figure 15.2-1 Call Tree Pop-up Menu (Outside Box)
Figure 15.2-2 Call Tree Pop-up Menu (Inside Box)
• [Open The File] command: Displays the edit window of the source program that includes aspecified function definition. For details, See CHAPTER 21 "PROGRAM EDITING".
• [Logic Flow] command: Displays the logic flow window that contains a specified functiondefinition. For details, See CHAPTER 18 "LOGIC FLOW".
• [Summary] command: Displays statistical information on a specified function. For details,See CHAPTER 19 "SUMMARY".
• [Xreference] command: Displays cross reference information on a specified function. Fordetails, See CHAPTER 20 "CROSS REFERENCE".
• [Open All] command: Displays all the windows in the Call Tree window.
185
CHAPTER 15 CALL TREE
• [Close All] command: Displays only the top-level function in the Call Tree window.
• [Find..] command: Searches for a function name in the Call Tree window.
186
CHAPTER 16 CLASS INFORMATION
This chapter explains the display and operation of class information.
16.1 "Displaying Class Information"
16.2 "Class Inheritance Diagram"
16.3 "Class Statistical Information"
16.4 "Class Inheritance Information"
16.5 "Class Usage Information"
16.6 "Friend Information"
187
CHAPTER 16 CLASS INFORMATION
16.1 Displaying Class Information
Class information visually indicates the inheritance relationship between classes in a program.
� Displaying Class Information
When analysis is terminated normally and a graph flow is displayed, the following classinformation can be referenced:
❍ Class inheritance diagram
Visually indicates the inheritance relationship between classes. This information can bedisplayed by specifying a base class or a derived class.
❍ Class name list
Indicates a list of the names of classes used in the source program. This list is interlocked withthe class inheritance relationship diagram. A class name can be easily retrieved.
❍ Class statistical information
Indicates statistical information on a specific class. Logic flow can also be displayed.
❍ Class inheritance information
Indicates the inheritance information on a specified class. Single inheritance information, multi-inheritance information, and inheritance levels are also displayed.
❍ Class usage information
Indicates usage information on a specified class.
❍ Friend function
Indicates friend information on a specified class.
188
16.2 Class Inheritance Diagram
16.2 Class Inheritance Diagram
The class inheritance diagram indicates inheritance relationships between classes.The class inheritance relationship diagram includes the following information concerning class inheritance relationships:• Inheritance relationship between all used classes• Search results of an arbitrary class• Base class of a specified class• Derived class of a specified class
� Displaying Class Inheritance Diagram
After analysis terminates, click the [Class Hierarchy] command displayed in the [View] menu todisplay the Class Inheritance window.
Figure 16.2-1 Class Inheritance Diagram
� Class Inheritance Diagram Pop-up Menu
• [Previous Focus Level] command and [Top Focus Level] command: See Section 16.2.2"Focus Display".
• [Zoom] command: See Section 16.2.1 "Enlargement/Reduction Display".
• [Focus [Base]], [Focus [Derived]], [Focus [Base & Derived]], and [Focus [1 Level]]commands: See Section 16.2.2 "Focus Display".
• [Logic Flow] command: See CHAPTER 18 "LOGIC FLOW".
• [Class Summary] command: See Section 16.3 "Class Statistical Information".
• [Class Inheritance] command: See Section 16.4 "Class Inheritance Information".
• [Class Usage] command: See Section 16.5 "Class Usage Information".
• [Friends] command: See Section 16.6 "Friend Information".
• [All Classes] command: See Section 16.2.3 "Displaying Undefined Classes".
189
CHAPTER 16 CLASS INFORMATION
• [Find..] command: See Section 17.2 "Searching."
• [Output Bitmap File...] command: See Section 14.6 "Outputting Bitmap File".
190
16.2 Class Inheritance Diagram
16.2.1 Enlargement/Reduction Display
Click the [Zoom] command of the pop-up menu of the Class Inheritance window. The displayed class inheritance diagram is enlarged or reduced to a specified magnification factor.
� Enlarging the Class Inheritance Diagram
Figure 16.2-2 "Example of Enlarged Class Inheritance Diagram" is an example of an enlargedclass inheritance diagram.
Figure 16.2-2 Example of Enlarged Class Inheritance Diagram
� Reduced Class Inheritance Diagram
Figure 16.2-3 "Example of Reduced Class Inheritance Diagram" is an example of a reducedclass inheritance diagram.
191
CHAPTER 16 CLASS INFORMATION
Figure 16.2-3 Example of Reduced Class Inheritance Diagram
Reference:
When the original size is 100%, an enlarged size (125%, 150%, 175%, or 200%) or reducedsize (75% or 50%) can be displayed. When a 50% size is displayed, the information insideeach box in the graph flow is not displayed and the call-relation-indicating boxes and linesonly are displayed.
192
16.2 Class Inheritance Diagram
16.2.2 Focus Display
In the Class Inheritance window, place the mouse pointer in a box of the basic class. Display the pop-up menu. Click the [Focus [Base]], [Focus [Derived]], [Focus [Base & Derived]], or [Focus [1 Level]] command to display the class inheritance relationship from the specified class.
� Selecting Focus
Figure 16.2-4 "Class Inheritance Diagram Pop-up Menu (Focus Selection)" is an example offocus selection.
Figure 16.2-4 Class Inheritance Diagram Pop-up Menu (Focus Selection)
� Displaying Focus
Focus display can be classified as follows:
• Display of base class of a specified class
• Display of derived class of a specified class
• Display of all base classes and derived classes of a specified class
• Display of 1-level base class and derived class of a specified class
Figure 16.2-5 "Example of Focus Display Using [Focus [Base]] Command" is an example of afocus display when the [Focus [Base]] command in the class inheritance pop-up menu isclicked.
Focus operations can be performed consecutively. The number of focus operations is displayedin the [Focus Level] field at the top left of the Class Inheritance window. (The initial value of thefocus level is 0.)
The current focus level display can be returned to the previous state by clicking the [PreviousFocus Level] command in the class inheritance pop-up menu. The current focus level displaycan be returned directly to the first state (focus level 0) by clicking the [Top Focus Level]command in the class inheritance pop-up menu.
193
CHAPTER 16 CLASS INFORMATION
Figure 16.2-5 Example of Focus Display Using [Focus [Base]] Command
194
16.2 Class Inheritance Diagram
16.2.3 Displaying Undefined Classes
Click the [All Classes] command in the class inheritance pop-up menu. The box of classes not defined in the source program are also displayed.
� Displaying Undefined Classes
Usually only the boxes of classes contained in the analyzed source program are displayed. Theboxes of classes inherited but not defined in the source program (e.g., the box of a class library)are not displayed.
Click the [All Classes] command in the class inheritance pop-up menu. The boxes of classescontained in the analyzed source program and the boxes of the classes not defined in thesource program are displayed. The bottoms of these non-class-defined boxes are displayed inyellow.
Figure 16.2-6 Display Example of Undefined Class
195
CHAPTER 16 CLASS INFORMATION
16.2.4 Class Name List
A list of the class names displayed in the class inheritance diagram can be displayed. The class name list is interlocked with the class inheritance diagram. When the contents of the class inheritance relationship change, the contents of the class name list are also updated.
� Class Name List
Click the [Class Name List] command in the View menu of the class inheritance diagram todisplay the Class List window.
A list of the names of the classes used in the source program is displayed.
Figure 16.2-7 Display Example of Class Name List
❍ Display items
The analyzed classes and the names of the source files in which the classes are defined aredisplayed. Move the mouse pointer to the displayed class name or source file name and clickthe mouse. The frame color of the corresponding class displayed in the Class Inheritancewindow changes to red.
The class list displays the names of the classes displayed in the class inheritance diagram.When the classes displayed in the class inheritance diagram are changed, the correspondingclasses displayed in the class name list are also updated.
196
16.3 Class Statistical Information
16.3 Class Statistical Information
The following information on each class can be displayed to show the characteristics of the class:• Class type• Name, attribution, and type of data members used in the class• Name, attribution, and type of members used in the class
� Class Statistical Information
Select the [Class Summary] command in the class inheritance pop-up menu. The ClassSummary Information window is displayed.
Figure 16.3-1 Example of Class Summary Information Window
❍ Display items
• Class Name: Name of class
• File Name: Name of source file in which the class is defined
• Type: Type of class
• Data Member: Information on following data members declared in this class:
• Member Name: Name of data member
• Access attribution: Access control type of data member
• Type: Type of data member
• Member Functions: Information on following member functions declared in this class:
• Member Name: Name of member function
• Access Attribution: Access control type of member function
• Type: Type of member function
• Special: Type of member (constructor, destructor, or conversion function)
197
CHAPTER 16 CLASS INFORMATION
❍ [Open the file] button
Displays the source file of a specified data member or member function in the edit window.
198
16.4 Class Inheritance Information
16.4 Class Inheritance Information
The following information on the base class of a specified class can be displayed:• Name of base class• Inheritance level of base class• Name of source file in which the base class is declared• Type and attribution of base class
� Class Inheritance Information
Select the [Class Inheritance] command in the class inheritance pop-up menu. The ClassInheritance Information window is displayed. When there is no base class, the messageindicating there is no base class is displayed.
Figure 16.4-1 Example of Class Inheritance Information Window
❍ Display items
• Inheritance Type: Single inheritance or multiple inheritance
• Base Class Name: Name of base class
• Inheritance Level: Inheritance level of base class
• Source File Name: Name of source file in which the base file is declared
• Base Class Type: Type of base class
• Base Class Attribution: Attribution of base class
Double-click an inheritance information line in the Class Inheritance Information window. Thesource file in which the corresponding base class is declared is displayed.
199
CHAPTER 16 CLASS INFORMATION
16.5 Class Usage Information
The function names and line numbers of the source file in which a specified class is used can be displayed. Using the class usage information, the part that uses a specified class can be retrieved.
� Class Usage Information
Select the [Class Usage] command in the class inheritance pop-up menu to display the ClassUsage Information window.
Figure 16.5-1 Example of Class Usage Information Window
❍ Display items
• File Name: Name of source file in which the class is used
• Function Name: Name of function in which the class is used
• Line: Number representing the line on which the class is used
Double-click the source file name displayed in the Class Usage Information window. The part ofthe source file that uses the class is displayed in the edit window.
200
16.6 Friend Information
16.6 Friend Information
The friend declaration information (i.e., friend name, attribution, and type) of a specified class can be displayed. Using the friend information, the friend declaration of an arbitrary class can be known.
� Friend Information
Select the [Friends] command displayed in the class inheritance pop-up window. The FriendInformation window is displayed. When there is no friend information, a message indicatingthere is no friend information is displayed.
Figure 16.6-1 Example of Friend Information Window
❍ Display items
• File Name: Name of source file in which a friend is declared
• Friend Name: Name of friend
• Friend Attribution: Attribution (function, class, etc.) of friend
• Type: Type of friend
Double-click a source file name displayed in the Friend Information window. The source file isdisplayed in the edit window.
201
CHAPTER 16 CLASS INFORMATION
202
CHAPTER 17 NAME SPACE
This chapter explains the display and operation of the name space information.
17.1 "Displaying Name Space Information"
203
CHAPTER 17 NAME SPACE
17.1 Displaying Name Space Information
The information on a name space used in the C/C++ program can be displayed.
� Displaying Name Space Information
When a graph flow is displayed, the information on a name space can be referenced.
� Name Space Information
The names of the name spaces used in the analyzed C++ program are displayed.
Figure 17.1-1 "Example of Name Space Information Window" is an example of the Name SpaceInformation window.
Figure 17.1-1 Example of Name Space Information Window
❍ Name Spaces
A list of the name spaces used in the analyzed C/C++ program is displayed. When there aretwo or more source files, the source file names are also displayed in the Name Spaces field.
Click a name space name displayed in the Names Space field. The Name Space Contentwindow is displayed to show detailed information.
� Name Space Content
Detailed information on a specified name space is displayed.
Figure 17.1-2 "Example of the Name Space Content Window" is an example of the NameSpace Content window.
Figure 17.1-2 Example of the Name Space Content Window
204
17.1 Displaying Name Space Information
❍ Member
Member name of name space, identifier of name space alias definition, identifier of "using"declaration, or identifier of "using" command
❍ Type
Type of name space member
❍ File Name
The name of a source file in which the member name of a name space is declared
❍ Line
Number representing the source-file line on which the member name of a name space isdeclared
Double-click a file name displayed in the Name Space Content window to display the member-name-using part of the source file in the edit window.
205
CHAPTER 17 NAME SPACE
206
CHAPTER 18 LOGIC FLOW
This chapter explains how to display and operate Logic Flow
18.1 "Selecting Logic Flow"
18.2 "Display Logic Flow"
18.3 "Logic Flow Pop-Up Menu"
207
CHAPTER 18 LOGIC FLOW
18.1 Selecting Logic Flow
The pop-up menu is displayed by moving the mouse pointer to the function box displayed in the Graph Flow window, or the class box displayed in the Class Inheritance Relationships Diagram and clicking the right side of the mouse.
� Select Logic Flow
The Logic Flow window can be displayed from the following locations:
• Graph Flow window: Function box pop-up menu
• Class inheritance relationships diagram: Class box pop-up menu
• Summary window: Pop-up menu within the window
• Xreference: Pop-up menu within the window
• Call Tree window: Function pop-up menu
• Function List window: Function pop-up menu, or by double-clicking the mouse
Figure 18.1-1 "Graph Flow Pop-up Menu (Selecting Logic Flow)" shows an example of how toselect Logic Flow
Figure 18.1-1 Graph Flow Pop-up Menu (Selecting Logic Flow)
208
18.2 Display Logic Flow
18.2 Display Logic Flow
The source program file containing the specified function is displayed in an arranged format.
� Display Logic Flow
Figure 18.2-1 "Logic Flow Window Example" shows an example of the Logic Flow window
Figure 18.2-1 Logic Flow Window Example
The (line) column shows the source file line number.
The (inc) column shows the depth of the structure of the source program included using the#include pre-processing command.
These are displayed as if statements, for statements, switch statements, break statements, gotostatements, while statements, return statements, continue statements, class declarations,structure declarations, and shared structure declarations.
209
CHAPTER 18 LOGIC FLOW
Figure 18.2-2 Example of Statements and Declarations
210
18.3 Logic Flow Pop-Up Menu
18.3 Logic Flow Pop-Up Menu
The pop-up menu is displayed by clicking the right mouse button within the Logic Flow window.
� Logic Flow Pop-up Menu
Figure 18.3-1 Logic Flow Pop-up Menu
• "Comment" command: Specifies whether to display or not display the comment in the LogicFlow display.
• "User Include" command: Specifies whether to display or not display the contents of the UserInclude file in the Logic Flow display.
• "System Include" command: Specifies whether to display or not display the contents of theSystem Include file in the Logic Flow display.
• "Find" command: Searches for text in the Logic Flow window.
211
CHAPTER 18 LOGIC FLOW
212
CHAPTER 19 SUMMARY
This chapter explains how to display and operate Summary
19.1 "Selecting Summary"
19.2 "Displaying Summary"
19.3 "How to Measure and Use Complexity"
19.4 "Summary Pop-up Menu"
19.5 "Searching for Text"
213
CHAPTER 19 SUMMARY
19.1 Selecting Summary
The pop-up menu is displayed within Graph Flow by moving the mouse pointer to the function box displayed in the Graph Flow window and clicking the right side of the mouse.
� Selecting Summary
Figure 19.1-1 "Example of the Graph Flow Pop-up Menu (Selecting Summary)" shows anexample of selecting Summary
Figure 19.1-1 Example of the Graph Flow Pop-up Menu (Selecting Summary)
214
19.2 Displaying Summary
19.2 Displaying Summary
Displays the Summary for the function specified in the Graph Window.
� Displaying Summary
Figure 19.2-1 "Example of Summary Window" displays an example of the Summary window.
Figure 19.2-1 Example of Summary Window
The following information is displayed in the Summary.
❍ Function Name
Displays the function name
❍ File
Displays the name of the source file containing the function. Double-clicking the source filename will permit the user to edit the source file using an editor. For information on the editor,see "Editing the Program."
❍ Memory Classes
Displays function memory classes.
❍ Complexity
Displays complexity level. For information on complexity, see "How to Measure and UseComplexity."
❍ Number of Statements
Displays the number of statements that include functions.
215
CHAPTER 19 SUMMARY
❍ Callee Functions
Displays the name of the callee functions. If no function procedures exist in the analyzedsource program, an * mark is placed at the start of the callee function name.
❍ Caller Functions
Caller functions are displayed.
❍ If Statement
Displays the number of times the if statement appears.
❍ Switch Statement
Displays the number of times the switch statement appears.
❍ While Statement
Displays the number of times the while statement appears.
❍ Do-while Statement
Displays the number of times the do-while statement appears.
❍ For Statement
Displays the number of times the for statement appears.
❍ Continue Statement
Displays the number of times the continue statement appears.
❍ Break Statement
Displays the number of times the break statement appears.
❍ Return Statement
Displays the number of times the return statement appears.
❍ Goto Statement
Displays the number of times the go to statement appears.
❍ Asm Statement
Displays the number of times the asm statement appears.
❍ Labels
Displays the number of Labels that appear.
❍ Case Labels
Displays the number of Case labels that appear.
❍ Default
Displays the number of Default labels that appear.
216
19.3 How to Measure and Use Complexity
19.3 How to Measure and Use Complexity
The initial complexity value for each function is set to 1.
� Measuring Complexity
Complexity is increased according to the following rules:
• When an if statement, while statement, for statement, do-while statement, goto statement, orswitch statement appears, 1 is added.
• Where statement labels or case labels appear, the number is added.
� How to Use Complexity
If the complexity level is high, the control structure for that function is also complex, therebyincreasing the likelihood of bugs occurring.
217
CHAPTER 19 SUMMARY
19.4 Summary Pop-up Menu
The pop-up menu is displayed in the window by clicking the right side of the mouse in the Summary window.
� Summary Pop-up Menu
Figure 19.4-1 "Summary Pop-up Menu" is an example of the Summary pop-up menu.
Figure 19.4-1 Summary Pop-up Menu
• "Copy" command: Stores the selected text on the clipboard. Provides the same feature asthe "Copy" command from the "Edit" menu.
• "Select All" command: Selects the text displayed in the Summary window. Provides thesame feature as the "Select All" command from the "Edit" menu.
• "Logic Flow" command: Displays the logic flow of the specified function.
• "Find" command: Searches for text displayed in the Summary window. Provides the samefeature as the "Find" command from the "Display" menu.
218
19.5 Searching for Text
19.5 Searching for Text
Text displayed in the Summary window can be searched.
� Searching for Text
The "Find" dialog box is displayed using the "Find" command from the "Display" menu or byclicking the "Find" command from the Summary pop-up menu.
Figure 19.5-1 "Summary "Find" Dialog Box" shows the Summary "Find" dialog box.
Figure 19.5-1 Summary "Find" Dialog Box
Enter the text to be searched for into the "Find what" box, then click the "Find Next" button tostart the search in the specified order.
219
CHAPTER 19 SUMMARY
220
CHAPTER 20 CROSS REFERENCE
This chapter explains how to display and operate Cross Reference.
20.1 "Selecting Cross Reference"
20.2 "Displaying Cross Reference"
20.3 "Cross Reference Pop-up Menu"
20.4 "Searching for Text"
221
CHAPTER 20 CROSS REFERENCE
20.1 Selecting Cross Reference
The pop-up menu is displayed within the Graph Flow by moving the mouse pointer to the function box displayed in the Graph Flow window and clicking the right side of the mouse.
� Selecting Cross Reference
Figure 20.1-1 "Graph Flow Pop-up Menu Example (Selecting Cross Reference)" is an exampleof Cross Reference being selected
Figure 20.1-1 Graph Flow Pop-up Menu Example (Selecting Cross Reference)
222
20.2 Displaying Cross Reference
20.2 Displaying Cross Reference
Displays Cross Reference for the specified function within the Graph Flow window.
� Displaying Cross Reference
Figure 20.2-1 "Cross Reference Window Example" is an example of the Cross Referencewindow
Figure 20.2-1 Cross Reference Window Example
� Variable/Function Information
The following information is displayed for variable/function information.
❍ Name
Displays variable name, function name, parameter name, and enumerator name.
❍ Attributes
The following attributes are displayed.
• Variable
• Function
• Parameter
• Enumerator
223
CHAPTER 20 CROSS REFERENCE
Furthermore, in the case of an extern declaration, extern, in the case of a static declaration,static, in the case of a prototype declaration, prototype, in the case of a function definition,definition, and in the case of an implicit declaration, implicit is additionally displayed.
❍ Type
Displays variable type, function result type, and parameter type are displayed.
❍ Line Number
Displays the definitions, declarations, settings, and reference line numbers for variables,functions, parameters, and enumerators and uses thereof.
� Tag/Type Definition Information
The following information is displayed for tag/type definition information.
❍ Name
Displays structure tag names, shared structure tag names, enumerator tag names, and typedefdeclared names.
❍ Type
The following tag names and typedef-declared name types.
❍ Types
Tag and type definition base types are displayed.
❍ Definition
Defined line numbers are displayed.
� Macro Information
The following information is displayed.
❍ Macro Name
The name of the macro being used is displayed.
❍ Replacement Text
When defining a macro, the replacement text is displayed. If the macro is made invalid, this isleft blank.
❍ #define
When defining a macro, the defined line numbers are displayed. If the macro is made invalid,this is left blank.
❍ #undef
When making a macro invalid, the invalid line numbers are displayed. When defining a macro,these are left blank.
� File Name Information
The following information is displayed.
The name of source files or included source files containing variable names, function names,
224
20.2 Displaying Cross Reference
tag name or macro definitions, and reference numbers thereof.
In the case that the line numbers in which the variable names, function names, tag namedefinitions, and macro definitions appear are include file line numbers, the reference number isdisplayed directly after the line number. It is possible to know the name of files in which variablenames, function names, tag name definitions, and macro definitions appear by looking at thisreference number.
When there is no reference number placed next to the line number, the file name becomes thereference number (*0).
Reference:
By double-clicking the name of the source file in the Cross Reference window, it is possibleto edit the source program using an editor. See "Editing the Program" for information on theeditor.
225
CHAPTER 20 CROSS REFERENCE
20.3 Cross Reference Pop-up Menu
The pop-up menu is displayed in the window by moving the mouse pointer to the Cross Reference window and clicking the right side of the mouse.
� Cross Reference Pop-up Menu
Displays an example of the Cross Reference pop-up menu.
Figure 20.3-1 Cross Reference Pop-up Menu
❍ "Variable/Function Information" Command
Specifies whether or not to display information on Cross Reference variables and functions.
❍ "Tag/Type Information" Command
Specifies whether or not to display information on Cross Reference tags/types.
❍ "Macro Information" Command
Specifies whether or not to display information on Cross Reference macros.
❍ "File Name Information" Command
Specifies whether or not to display information on Cross Reference file names
❍ "Copy" Command
Places the selected text onto the clipboard. This has the same effect as the "Copy" commandfrom the "Edit" menu.
❍ "Select All" Command
Selects the text displayed in the Cross Reference window. This has the same effect as the"Select All" command from the "Edit" menu.
❍ "Logic Flow" Command
Displays the logic flow of the specified function.
226
20.3 Cross Reference Pop-up Menu
❍ "Find" Command
Searches for text displayed within the Cross Reference window. This has the same effect asthe "Find" command from the "Display" menu.
227
CHAPTER 20 CROSS REFERENCE
20.4 Searching for Text
Searches for text within the Cross Reference window.
� Searching for Text
The "Find" dialog box in Figure 20.4-1 "Cross Reference "Find" Dialog Box" is displayed byclicking the "Find" command from the "Display" menu or the "Find" command.
Figure 20.4-1 Cross Reference "Find" Dialog Box
Enter the text to be searched for in to the "Find What" box, specify the search direction, andclick the "Find next" button to start the search in the specified direction.
Clicking the "Find previous" command in the "Display" menu will start the search in the oppositedirection.
Furthermore, clicking the "Find previous" or "Find next" command in the "Display" menu will givesearch priority to the "Find previous" or "Find next" command from the "Display" menu.
228
CHAPTER 21 PROGRAM EDITING
This chapter explains how to start the standard editor and how to edit the program.
21.1 "Activate the Standard Editor"
21.2 "External Editor Setup"
21.3 "Standard Editor Setup"
21.4 "Standard Editor Pop-up Menu"
21.5 "Other Functions"
229
CHAPTER 21 PROGRAM EDITING
21.1 Activate the Standard Editor
Activate the standard editor by clicking the "New Edit File" command or the "Open Edit File" command from the "File" menu.It is also possible to activate and edit using the specified standard editor by double-clicking the name of the source file listed within each analysis window.
� Activate the Standard Editor
Specifying the "New Edit File" command from the "File" menu will display an untitled editwindow.
Figure 21.1-1 "Standard Editor Activation Screen Example" is an example of the screen of astandard editor upon activation.
Figure 21.1-1 Standard Editor Activation Screen Example
The standard editor can be started from the following analysis windows. See the explanationsfor the analysis windows for details on how to activate.
• Analysis Message Window
• Function Name List Window
• Inline Candidate Window
• Summary Window
• Xreference Window
230
21.2 External Editor Setup
21.2 External Editor Setup
The C/C++ analyzer has the standard editor function. An external editor can also be called using the customization function. This section explains how to set up the external editor.
� External Editor Setup
With the graph flow window not displayed, select the [Editor Customize] command displayed inthe [Setup] menu to display the CUSTOMIZE dialog box.
Figure 21.2-1 Customization Dialog Box Example
Check the [Use External Editor] check box to register and use a familiar external editor.
❍ Editor name
Register the name of the editor used.
231
CHAPTER 21 PROGRAM EDITING
❍ Full path of the executive file
Specify the full-path of the execution file of the editor.
❍ Current directory for the editor
Specify the directory which starts the editor.
❍ Opening command-line
Specify the argument passed to the editor.
❍ List
The registration situation of the editor is displayed.
232
21.3 Standard Editor Setup
21.3 Standard Editor Setup
With the standard editor selected, clicking the "Editor Customize" command from the "Setup" menu will display the standard editor setup dialog box.
� Standard Editor Setup (General)
Figure 21.3-1 "Standard Editor Setup Dialog Box (General)" shows the standard editor setupdialog box (General).
Figure 21.3-1 Standard Editor Setup Dialog Box (General)
The following display features can be set up and colors can be displayed from the standardeditor setup window (General).
❍ EOF
Displays the end of file symbol EOF.
❍ Line Number
Displays the logical line number on the left of the edit window.
❍ Return Character
Displays the return code with a special symbol.
❍ Ruler
Displays the ruler in the edit window.
233
CHAPTER 21 PROGRAM EDITING
❍ Wide Char Space
Displays wide char space with a special symbol.
❍ Comment
Emphasizes the comment section.
❍ Tab
Displays the tab code as a special character.
❍ Error Tag
Sets the tag display character according to the error jump.
❍ Tab & Indent
• Automatic Indent: Automatically matches the indent with the intent on the preceding line.
• Tab Display: Displays the tab as a special symbol.
• Tab: Displays the number of tab code skips.
� Standard Editor Setup (Key Words)
Figure 21.3-2 "Standard Editor Setup Dialog Box (Key Words)" shows the standard editor setupdialog box (Key Words)
Figure 21.3-2 Standard Editor Setup Dialog Box (Key Words)
Shows the emphasis for each key word. The display color can be set using the button on theright.
234
21.3 Standard Editor Setup
❍ C language keyword emphasis
Displays key words defined in the C language key word file in bold.
❍ C++ language keyword emphasis
Displays key words defined in the C++ language key word file in bold.
❍ ASM keyword emphasis
Displays key words defined in the ASM keyword file in bold.
❍ Extensional keyword
Displays key words defined in the extensional keyword file in bold.
❍ User defined-function
A REALOS system call etc. in the keyword defined as the keyword file in bold.
❍ Search Results
Displays search results in bold.
❍ Register Keyword Button
Displays the Registration of Keywords dialog box.
Figure 21.3-3 Registration of Keywords Dialog Box
Using the Registration of Keywords dialog box, each type of keyword file can be set up.
❍ Language
Sets the language type. You can choose C, C++, Assembler or Extensional.
❍ Initialize
Registers key word in its initial state.
❍ Add
Adds key word.
❍ Remove
Removes key word.
235
CHAPTER 21 PROGRAM EDITING
21.4 Standard Editor Pop-up Menu
The pop-up menu is displayed in the edit window by clicking the right side of the mouse in the standard editor edit window.
� Standard Editor Pop-up Menu
Figure 21.4-1 "Example of Standard Editor Pop-up Menu" shows the standard editor pop-upmenu.
Figure 21.4-1 Example of Standard Editor Pop-up Menu
❍ "Undo"
Cancels the most recent edit and the state is returned to that before the edit. When duplicatecharacters or duplicate lines are edited at the same time, the section is restored at the sametime.
❍ "Redo"
Cancels the edit carried out by the "Undo" command.
❍ "Cut"
Cuts the selected area and places the cut content onto the clipboard.
❍ "Copy"
Places the selected area onto the clipboard.
236
21.4 Standard Editor Pop-up Menu
❍ "Paste"
Pastes the text stored on the clipboard.
❍ "Delete"
Deletes the selected area but does not place it on the clipboard.
❍ "Select All"
Selects all of the displayed text.
❍ Find
The character sequence in the specified edit window is searched.
❍ Replace
The character sequence in the specified edit window is searched and replaced.
❍ Find in Files
It searches whether there is any character sequence specified in the specified file.
237
CHAPTER 21 PROGRAM EDITING
21.5 Other Functions
This section explains the various features available while the standard editor edit window is displayed.
� "File" Menu
❍ "New Edit File" command
Creates a new text file
❍ "Open Edit File" command
Opens a file for editing.
❍ "Close" command
Closes the active edit window.
❍ "Save" command
Saves the amended file.
❍ "Save as.." command
Saves the amended file with a new name.
� "Edit" Menu
❍ "Undo"
Cancels the most recent edit and the state is returned to that before the edit. Where duplicatecharacters or duplicate lines are edited at the same time, the section is restored at the sametime.
❍ "Cut"
Cuts the selected area and places the cut content onto the clipboard.
❍ "Copy"
Places the selected area onto the clipboard.
❍ "Paste"
Pastes the text stored on the clipboard.
❍ Find
The character sequence in the specified edit window is searched.
❍ Replace
The character sequence in the specified edit window is searched and replaced.
238
21.5 Other Functions
❍ Find in Files
It searches whether there is any character sequence specified in the specified file.
239
CHAPTER 21 PROGRAM EDITING
240
CHAPTER 22 MAX USED STACK
This chapter will explain how to display and operate the max used stack.
22.1 "Max Used Stack (Specified Function)"
22.2 "Max Used Stack (All Functions)"
22.3 "Max Used Stack Route (Specified Function)"
22.4 "Max Used Stack Route (All Functions)"
22.5 "Max Used Stack Route Focus"
241
CHAPTER 22 MAX USED STACK
22.1 Max Used Stack (Specified Function)
It is possible to show the max used stack for the function specified in the graph flow window.
� Display of Max Used Stack for Specified Function
Figure 22.1-1 Show Max Used Stack (Specified Function)
Proceed as follows to show the max used stack for the specified function:
1. Display undefined functions by clicking the "All Functions" command from the graph flowwindow pop-up menu.
2. In the "Graph Flow" window, move the mouse to the box of the function for which the maxused stack is to be displayed and choose "Show Max Used Stack" from the "Graph Flow"pop-up menu.
3. The max used stack can be displayed for the specified function. The max used stack of thecallee function is not taken into consideration at this time.
Note:
To calculate the max used stack, individual C/C++ source files must be created for usedstack information files using the C/C++ Analyzer compile feature.
242
22.2 Max Used Stack (All Functions)
22.2 Max Used Stack (All Functions)
Displays the max used stack for all function boxes in the graph flow window.
� Display of Max Used Stack for All Functions
Figure 22.2-1 Show Max Used Stack (All Functions)
Proceed as follows to show the max used stack for all functions:
1. Display undefined functions by clicking the "All Functions" command from the graph flowwindow pop-up menu.
2. Max used stack can be shown for all displayed functions by clicking the "Max Stack"command from the "Display" menu.
Note:
To calculate the max used stack, individual C/C++ source files must be created for usedstack information files using the C/C++ Analyzer compile feature.
243
CHAPTER 22 MAX USED STACK
22.3 Max Used Stack Route (Specified Function)
Based on the function specified in the graph flow window (as a base point), displays the route of the function that uses the largest number of stacks.
� Display of Max Used Stack Route for Specified Functions
Figure 22.3-1 Show Max Used Stack Route (Specified Function)
Proceed as follows to show the max used stack route for the specified function:
1. Display undefined functions by clicking the "All Functions" command from the graph flowwindow pop-up menu.
2. In the "Graph Flow" window, move the mouse to the box of the function for which the maxused stack route is to be displayed and choose "Max Used Stack Route" from the "GraphFlow" pop-up menu.
3. With the specified function as a base point, the route using the most stacks for that functionis displayed.
Note:
To calculate the max used stack, individual C/C++ source files must be created for usedstack information files using the C/C++ Analyzer compile feature.
244
22.4 Max Used Stack Route (All Functions)
22.4 Max Used Stack Route (All Functions)
Displays the route of the function using the most stacks in the program within the graph flow window.
� Display of Max Used Stack Route for All Functions
Figure 22.4-1 Display of Max Used Stack Route (All Functions)
Proceed as follows to show the max used stack route for all functions:
1. Display undefined functions by clicking the "All Functions" command from the graph flowwindow pop-up menu.
2. Max used stack can be shown for all displayed functions by clicking the "Max Stack"command from the "Display" menu.
3. The route for the function using the most stacks in the program can be shown by clicking the"Max Used Stack Route" command from the "Display" menu.
Note:
To calculate the max used stack, individual C/C++ source files must be created for usedstack information files using the C/C++ Analyzer compile feature.
245
CHAPTER 22 MAX USED STACK
22.5 Max Used Stack Route Focus
Focuses on the max used stack route displayed in the graph flow window.
� Display of Max Used Stack Route Focus
Figure 22.5-1 Max Used Stack Route Focus
Proceed as follows to focus on the max used stack route:
1. When the max used stack is not shown, show the max used stack for all functions displayedby clicking the "Max Used Stack" command from the "Display" menu.
2. Display the max used stack route using the "Max Used Stack Route" from the "Display"menu, or the "Max Used Stack Route" from the "Graph Flow" menu.
3. Display the "Graph Flow" pop-up menu and click the "Focus [Max Used Stack Route]"command.
4. This will focus on the max used stack route.
Note:
To calculate the max used stack, individual C/C++ source files must be created for usedstack information files using the C/C++ Analyzer compile feature. Furthermore, unless themax used stack route is displayed in advance, clicking the "Focus [Max Used Stack Route]"command will not display anything in the graph flow window. Clicking the "Focus [Max UsedStack Route]" command again will return the window to its previous state.
246
CHAPTER 23 USED STACK INFORMATION
This chapter explains used stack information and max used stack.
23.1 "Calculating Max Used Stack"
23.2 "Limitations on the Max Used Stack"
23.3 "Creating a Stack Information File"
247
CHAPTER 23 USED STACK INFORMATION
23.1 Calculating Max Used Stack
Calculation of the max used stack is explained as follows.
� Calculating Max Used Stack
To calculate the max used stack using C/C++ Analyzer, individual C and C++ source programsmust be created for used stack information files in advance using the C/C++ compiler.
� How to Calculate the Max Used Stack
The max used stack for the function func is calculated as follows:
1. The stack size secured by function func is n bytes.
2. The function func calls the functions sub0, sub1, ...., subn.
3. The max used stacks used by the functions called by the function func is s1, s2, ..., sn bytes.
4. Of the max used stacks of the functions called by function func, the largest is called smbytes.
5. The max used stack of the function func is n+sm bytes.
When the function func does not call functions, the max used stack for the function func equalsthe stack size secured by the function func.
248
23.2 Limitations on the Max Used Stack
23.2 Limitations on the Max Used Stack
This section explains the limitations on the max used stack.
� Limitations on the Max Used Stack
The following items exist as limitations on calculating the max used stack.
❍ When the asm statement exists within the C/C++ source program.
As the C/C++ compiler cannot obtain information for functions or secured stacks when an asmstatement is defined within the C/C++ source program, it cannot make an accurate calculationof the max used stack.
❍ Where recursive functions exist
When calculating the max used stack, the max used stack for called functions must be known.As a result, if there is a recursive function, the processing is never completed. The calculationfeature for the max used stack, therefore, considers the max used stack for recursively calledfunctions as being the stack size secured by that function and does not consider the max usedstack of functions called by that function. As a result, it cannot accurately calculate the maxused stack.
❍ Where a function is called by a pointer
When calculating the max used stack, the max used stack for called functions must be known.However, when calling the function from a pointer, it is not possible to ascertain the essence ofthe function, making it impossible to calculate the max used stack of called functions. Thecalculation feature for the max used stack, therefore, calculates the max used stack of functionscalled by a pointer to be 0 bytes. As a result, it cannot accurately calculate the max used stack.
❍ When there is a call to a REALOS system call function
As the C/C++ compiler cannot obtain information for calls to REALOS system call functionswithin the C/C++, it cannot make an accurate calculation of the max used stack.
❍ When calling a function for whom function definition information does not exist
When calculating the max used stack of called functions, function definition information for thosecalled functions must be known. When definition information does not exist for those calledfunctions, the max used stack calculation tool calculates the max used stack of those calledfunctions as 0 bytes. As a result, it cannot accurately calculate the max used stack.
❍ When standard library functions are used
The qsort function carries out recursive function calls. Therefore, the same limitations exist for"Where recursive functions exist."
Furthermore, the bsort, exit and qsort functions all make function calls using pointers.Therefore, the same limitations exist for "Where a function is called by a pointer."
Of the above limitation items, excepting "Where there is a call to a REALOS system callfunction", the max used stack calculation feature will output a relevant warning message withinthe C/C++ Analyzer analysis window when the above limitations occur.
249
CHAPTER 23 USED STACK INFORMATION
23.3 Creating a Stack Information File
This section explains how to create a stack information file. Methods of creating used stack information include using the C/C++ compiler used stack information display feature and using an editor.
� Method of Creating Using the C/C++ Compiler
The used stack information file is created using the C/C++ compiler and the C/C++ compilerused stack information display feature.
The used stack information file can be created using the C/C++ compiler used stack informationdisplay feature with the C/C++ source program.
The used stack information file created using the C/C++ compiler used stack information displayfeature can be used without modification as a used stack information file.
For details on the C/C++ compiler used stack information display feature, refer to the C/C++compiler manual.
� Method of Creating Using the Editor
To create a used stack information file using an editor, create a text file in the format describedbelow.
The numbers of characters per line used for the stack information file must be within 1,024including the line break character.
The used stack information file cannot consist of blank lines (lines consisting only of spaces).
❍ Comment line
The used stack information file can include comments.
If the first character of a line is the character "#", the line is recognized as a comment.
[Example]
#Comment
❍ Module name description line
Describes the module names (C source programs) defined by the functions that appear in thefunction definition information to follow.
When the first line starts with the "@" character, it is recognized as a module name description.
The module name description line describes the module names defined in the functions in thefunction definition information to follow.
It is not permitted to leave a space or tab between the "@" character and the module name.
When the stack information file is not in the same directory as the module name, use theabsolute path to describe the module name.
[Example]
@C:\demo\test.c
In the used stack information file output by the C compiler, a "!" character may be included in
250
23.3 Creating a Stack Information File
the first line as a module name description line, thereby indicating that the asm statement isincluded within the module. This is used by the max used stack calculation feature asinformation when outputting a warning message. Where a C source program used stackinformation file including an asm statement is edited using an editor, and it reflects informationconcerning the stack size secured by the asm statement or the function defined in the asmstatement, it is possible to prevent the output of unnecessary warning messages by changingthat section to "@".
❍ Function Definition Information Line
Describes the secured stack size, attributes, and name of a function.
When describing the function definition information line, the module descriptions must beincluded at the beginning.
Describes the secured stack size, attributes, and name of functions defined within the modulesincluded within the module name description line.
The function definition information line uses the following format.
secured stack size attributes Function name asm attributes
The stack size, attributes, and function name must be separated by one or more spaces or tabs.
• Secured Stack Size
• The secured stack size can be expressed in base 8, base 10, or base 16 formats.
• For the secured stack size, the total number of the greatest stack sizes for stack sizesecured at the beginning of that function and the stack size secured when the functionwas called is used.
• If the secured stack size starts with "0x", it will be recognized as being in base 16 format.
• If the secured stack size starts with "0", it will be recognized as being in base 8 format.
• In other cases, it will be recognized as being in base 10 format.
• Attributes
• Describes attributes of functions.
• External functions are indicated by "E", static functions as "S", and interrupt functions by"I".
• Furthermore, when the function is called using a pointer, a "*" is added to the symboldescribed above.
• Function Name
• The name of the function is described as a symbol in assembler source.
[Example]
• asm Attributes
• asm statements within a function are indicated by "A".
@C:\demo\test.c 20 E test 24 ER func 28 S* _sub
251
CHAPTER 23 USED STACK INFORMATION
[Example]
❍ Function Call Information Line
Describes the attributes and the name of functions called by the functions previously describedin the function definition information line.
The function call information line is expressed in the following format:
Function-call-information-line-reference attributes function-name
The function call information line reference, attributes, and function name must be separated byat least one space or tab.
When describing the function call information line, the function definition information line mustbe placed at the beginning.
• Function Call Information Line Reference
• "->" is used as a reference mark to indicate the function call information line.
• Attributes
• Describes the attributes of called functions.
• Among the called functions, external functions are indicated by "E", static functions as"S", and calls by pointers with "*".
• Function names
• The name of the called function is described as a symbol in assembler source.
• When the call takes place via a pointer, the function can be named anything but cannotbe omitted.
• Output from the C Compiler used stack display feature is output as "$pointer_call".
[Example]
❍ Function Calls Using a Pointer
When function calls using a pointer are recognized in advance, the max used stack can becalculated by describing a function call information line for all functions called by the pointerinstead of a function call information line for only the function called by the pointer. By makingthe same amendment to used stack information created using the C compiler, the max usedstack can be calculated.
!C:\demo\asm.c20 E test24 E func A28 S _sub
@C:\demo\test.c 20 E test -> E func -> S _sub 24 ER func -> E func 28 S _sub -> * $pointer_call
252
23.3 Creating a Stack Information File
[Example Sample C source program]
[Example Stack information file (before modification)]
#include <stdio.h>void fprintf( stdout,"func1\n");}void char buffer[255]; sprintf( buffer,"func2\n");}void printf( "func3\n" );}
void (*test[3])()={ func1, func2, func3};
void main(){ (*test[2])(); /* call for func3() using a pointer */}
@C:\demo\point.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# ...# 8 E _func1 -> E _fprintf# 264 E _func2 -> E _sprintf# 8 E _func3 -> E _printf# 8 E _main
-> * $pointer_call
253
CHAPTER 23 USED STACK INFORMATION
When using the C/C++ Analyzer max stack feature, the following type of message is output.
*** W1007N: A function call from a pointer has been detected in function "main"
[Example Stack information file (after modification)]
The function call information line "$pointer_call" is replaced by the function func3( ) function callinformation line, and the max used stack can be calculated.
It is necessary, however, to have a stack information file including the function definitioninformation line for function func3( ).
@C:\demo\point.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# ...# 8 E _func1 -> E _fprintf# 264 E _func2 -> E _sprintf# 8 E _func3 -> E _printf# 8 E _main -> E _func3
254
CHAPTER 24 PRINTING
This chapter explains the printing operation and features
24.1 "Printing the Analysis Window"
255
CHAPTER 24 PRINTING
24.1 Printing the Analysis Window
It is possible to print the content of each analysis window from C/C++ Analyzer.
� Printing Print Information
It is possible to print from the following analysis windows:
• Graph flow window
• Function name list window
• Global variable window
• Inline candidate window
• const candidate window
• Logic flow window
• Summary window
• Xreference window
• Standard editor edit window
� Printer Setup
The printer setup dialog box is displayed by clicking "Printer Setup" from the "Project" menu.
The following can be set from the "Printer Setup" dialog box.
❍ Printer Name:
A list of the printers set up in the computer are displayed.
❍ Properties:
Displays the currently selected printer. The properties dialog box is displayed.
❍ Output to file:
Outputs the document to a file rather than directly to a printer. A dialog box is displayed tospecify the file name and location.
❍ Select Print Area
Specifies the range to be printed.
• All (Prints the whole document)
• Pages (specifies the range of pages to print with two boxes)
• Selected area (prints the area currently selected in the document)
❍ Copies
Specifies the number of copies to print.
256
24.1 Printing the Analysis Window
Figure 24.1-1 Printer Setup Dialog Box
� "Print Preview" Window
Displays the content to be printed in the "Print Preview" window. The following items can be setin the "Print Preview" window.
❍ "Print" button:
Displays the "Print" dialog box.
❍ "Print Setup" button:
Sets the print format. When this button is selected, the "Print Setup" dialog box is displayed,and detailed settings for the printer can be specified.
This feature is only displayed when the standard editor is selected.
• Columns: Sets the number of columns. It is possible to set either 1, 2, 3 or 4 columns. Thedefault is 1.
• Print header : Sets whether or not to print a header. It is possible to set file names, pagenumbers and the date/time as headers. The default has no setting.
• Print footer : Sets whether or not to print a footer. It is possible to set file names, pagenumbers, and the date/time as footer. The default has no setting.
• Print line numbers: Sets whether to print line numbers or not. The default has no setting.
• Print key words in bold: Sets whether or not to print key words in bold. It is possible to set C/C++ language, assembler language, and extensions as key words. The default has nosetting.
• Top margin: Sets the top margin.
• Left margin: Sets the left margin.
❍ "Next page" button:
Displays a preview of the next page.
❍ "Previous page" button:
Displays a preview of the previous page.
❍ "Enlarge" button:
Shows the preview enlarged.
257
CHAPTER 24 PRINTING
❍ "Reduce" button:
Shows the preview reduced.
❍ "Close" button:
Closes the preview window.
Figure 24.1-2 Print Preview Window
258
APPENDIX
This appendix explains problems that may occur during the use of Softune C/C++ Analyzer.
Appendix A "Troubleshooting"
259
APPENDIX A TROUBLESHOOTING
APPENDIX A TROUBLESHOOTING
Solves technical problems that may be encountered when using Softune C/C++ Analyzer.• Activation problems• Development environment-related• Max stack-related• Standard editor-related• Compatibility with lower versions• Error messages• Frequently asked questions
� Activation Problems
❍ Unable to start Softune C/C++ Analyzer
Unable to start and the message "CPANALYZE.EXE file is linked to the missing exportOLEAUT32.DLL."
[Answer]
The cause of this problem is the use of an older version of Windows 95 that uses a library notcompatible with the ACTIVE X feature. Execute the attached upgrade command oleaut.exe.
❍ Period of use
The message "[0] day of trial remaining" appears.
[Answer]
The version of Softune C/C++ Analyzer being used is an evaluation version.
This version can be used for 45 days after installment. To continue use, the full version must bepurchased.
❍ Unable to analyze C/C++ source
After the message "Analysis has started", the error message "Analysis of C/C++ source hasfailed" is displayed.
[Answer]
The installation directory for C/C++ Analyzer may not be set in the FETOOL environmentvariable.
After setting the environment variable, run C/C++ Analyzer again from the command line.
Example
> set FETOOL=C:\Softune5
> %FETOOL%\bin\cpanalyze.exe
260
APPENDIX A TROUBLESHOOTING
� Development Environment-related
❍ "Compiler environment[C:\~] does not exist"
When trying to close the compiler environment dialog box displayed by the "CompilerEnvironment" command from the "Setup" menu, the dialog box "Compiler environment[C:\~]does not exist" is displayed.
[Answer]
The above message is displayed in an environment in which the Softune compiler is notinstalled.
Close this dialog box using the "Close" button.
❍ Can I use SAMBA?
Is it possible to analyze a UNIX source program on Windows using a SAMBA Server?
[Answer]
It is possible, but the following points must be noted.
• Kanji encoding
• Where the Kanji encoding is different between EUC and SJIS, the characters may not bedisplayed correctly when displaying the source program in the logic flow and standardeditor. I n this case, it is necessary to convert to SJIS.
• Standard file name
• As the upper case/lower case distinction for directory names and file names on the UNIXServer no longer exists, it is necessary to modify as appropriate.
� Max Stack-related
❍ Max stack is not displayed
When using the max stack feature, the max used stack is not displayed, even though an errormessage is not displayed.
[Answer]
The correct path name may not be set in the used stack information file header.
Resolve this problem by recreating the stack information file using the C/C++ Analyzer compilefeature or by editing as follows:
• Choose the "Open File" command from the pop-up menu in the function box for which themax stack is not displayed and confirm the name of the source program.
• Open the "STACK" pane from the "Project" window and double-click the applicable stackinformation file name.
• Edit the first line of the stack information file to the correct path name. (The path name mayalso be omitted).
[Example]
@C:\test\test.c 20 E test -> E func
261
APPENDIX A TROUBLESHOOTING
[Example]
❍ "Not Correct Max Stack Size"
When using the max stack feature, the message "Not Correct Max Stack Size" appears.
[Answer 1]
The display mode of Graph Flow is not set to "All Functions."
In the case of programs that include standard library functions, it is necessary to check "AllFunctions" within the Graph Flow pop-up menu.
[Answer 2]
One of the max stack feature limitations may apply.
If one of the following elements exist, the max used stack may not be correctly calculated.
• There is an ASM statement in the C/C++ source.
• There is a call to a recursive function.
• There is a function call from a pointer or there is a virtual function.
• There is a REALOS system call function call.
• There is a function call for which function definition information does not exist.
In these cases, a relevant message will appear within the C/C++ Analyzer.
For appropriate responses to these messages, see "Error messages output when using the maxstack feature", which follows.
� Standard Editor-related
❍ Cannot write to the edit window
When an edit window is activated from the standard editor, a blank edit screen is displayed.
[Answer]
The standard editor may not be registered in the system. Within explorer, drag the library fileSiiEd2.ocx included in the install directory and drop it over regsvr.exe.
If the message [DllRegisterServer in SiiEd2.ocx succeeded] is displayed, the window can beactivated normally.
❍ Member not found
Starting of an internal editor displays "Member not found".
[Answer]
The version of the editor of use may be old. Library file included to an installation directory byExplorer. And check that the version of SiiEd2.ocx is more than 2.3.2.6, drag & drop onregsvr32.exe.
If "DllRegisterServer in SiiEd2.ocx succeeded" is displayed, it is possible to start normally.
SiiEd2.ocx is the editor made by Fujitsu,Ltd. compatible with a higher rank. Please use the oneas new as possible.
@test.c 20 E test -> E func
262
APPENDIX A TROUBLESHOOTING
� Compatibility with Lower Versions
Analysis data files and projects created in Softune C/C++ Analyzer are not backwards-compatible with previous versions of Softune C Analyzer.
Create a new project and analyze from within Softune C/C++ Analyzer.
� Error Messages Output when Using the Max Stack Feature
The following messages may be output when using the C/C++ Analyzer Max Stack Feature.
As the name of the stack information file is displayed in the analysis window, the used stackinformation file can be edited directly by double-clicking the name of the file.
[Countermeasures]
The stack information file "C:\test.stk" may not exist.
Create the "C:\test.stk" file using the C/C++ Analyzer compile feature.
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is output if an asm statement exists within the source program.
To prevent this warning from appearing, open the stack information file test.stk, which is theapplicable file for test.c, in an editor and add amend the first line from !C:\test.c to @c:\text.c
[Before amending]
[After amending]
W1001N cannot open file ‘C:\test.stk’
W1002N unrecognized option ‘-s’
W1003N option ‘-model’ requires an argument
W1004N illegal sub-parameter ‘-cpu a’
W1005N module ‘C:\test.c’ has asm statement
!C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}
263
APPENDIX A TROUBLESHOOTING
See CHAPTER 23 "USED STACK INFORMATION" for information on how to edit the stack
information file.
@C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}
264
APPENDIX A TROUBLESHOOTING
[Countermeasures]
This message is output if there is a direct or indirect call to a recursive function.
To prevent this warning from appearing, open the stack information file with an editor and setthe stack size in the recursive call line to an estimated amount.
[Before amending]
[After amending]
C/C++ Analyzer sets the stack size for all recursive call functions for which a warning appears to0.
If an estimated stack size is used for the stack size required for the recursive call functions, as
in the example above, the warning can be prevented and the stack size level can be raised.
W1006N found recursive call ‘_func’
@C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 24 E _func -> E __addd -> E _sub <- Recursive call function#
12 E _sub -> E _func
# 8 E _main -> E _sub
@C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 24 E _func -> E __addd 32 E _sub <- Clearly specified# 12 E _sub -> E _func# 8 E _main -> E _sub
265
APPENDIX A TROUBLESHOOTING
[Countermeasures]
This message is output when there is a function call from a pointer.
To prevent this warning, open the stack information file in an editor and set the $pointer_callline to an appropriate function call information line.
[Before amending]
[After amending]
C/C++ Analyzer sets the stack size for all functions called by a pointer for which a warningappears to 0. Calls by C++ language virtual functions are treated as pointer calls.
If the function call line is specified as in the above example, the warning can be prevented and
the stack size level can be raised.
[Countermeasures]
This message is output when the function "func" used stack information cannot be found inthe specified stack information file.
To prevent this warning, register the source program defined in the function "func" in the
project.
W1007N found call by pointer in ‘_main’
W1008N not found used stack size information of function ‘_func’
@C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 8 E _func1# 8 E _func2# 8 E _main -> * $pointer_call <- Function call by a pointer
@C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 8 E _func1# 8 E _func2# 8 E _main -> * _func2
266
APPENDIX A TROUBLESHOOTING
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is not output in C/C++ Analyzer.
[Countermeasures]
This message is output when the contents of the stack information file "C:\test.stk" areabnormal.
Re-create the "C:\test.stk" file using the C/C++ Analyzer compile feature.
When editing the stack information file with an editor, use a tab to separate each line.
[Countermeasures]
This message is output when an asm statement is included within the source programfunctions. The message "There is an asm statement in the W2005N module "C:\test.c" isdisplayed. This message will not be output, however, if there are no functions includedwithin the asm statement.
To prevent the warning, open the stack information file using an editor, delete the asmattribute in the "func" function definition information line, and set the stack size for the asmstatement.
[Before amending]
W1009N Not found static function
W1010N Not found static function
W1011N Not found external function
W1012N Abnormal file ‘C:\test.stk’
W1013N Found asm statement in ‘_func’
!C:\test.c# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 24 E _test 20 E _func A <- Function including asm statement
267
APPENDIX A TROUBLESHOOTING
[After amending]
[Countermeasures]
This message is not output in the C/C++ Analyzer.
[Countermeasures]
This message is not output in the C/C++ Analyzer.
When output as a pop-up menu, the stack information file may not be registered in the
project. If not, register the file.
[Countermeasures]
This message is not output in the C/C++ Analyzer.
� Frequently Asked Questions
❍ Duplicate trees are displayed in the Graph Flow
[Cause]
If duplicate program units, such as two main function definitions, exist in a source file registeredas a project, two function boxes expressing these main functions will appear.
In the same way, a function without a callee creates a tree using this as its head.
[Countermeasures]
Opening the pop-up menu from the function box and using the focus feature will make it easierto see.
Furthermore, deleting from the project source files containing unnecessary function definitionswill result in the definitions being deleted simultaneously from the analysis information file.
E4001N Not read used stack size infomation
E4002N Not found used stack size information of function ‘_func’
F9001N Insufficient memory
@C:\test.c <- Amend ! to @# E=Extern S=Static I=Interrupt# {Stack} {E|S|I} {function name} [A]# -> {E|S} {call function}# 24 E _test 32 E _func <- Delete "A" and amend size.
268
APPENDIX A TROUBLESHOOTING
❍ The message "The size of a graph flow is too large to display the entire graph flow." is displayed
[Cause]
When the size of a source file registered as a project is too large, the above message isdisplayed. This message is displayed when the number of function trees and the number offunction boxes that can be displayed on the graph flow window exceed the limits specified byWindows.
However, only display of the graph flow is restricted; all internal data is still kept.
[Countermeasures]
Open the Function List window on the View menu and right-click an appropriate function. Thefunction tree of a selected function is then displayed on the graph flow window in a specifiedformat.
If the Top level function on the View menu is selected, only functions that cannot be called byothers are displayed.
269
APPENDIX A TROUBLESHOOTING
270
INDEX
INDEX
The index follows on the next page.This is listed in alphabetic order.
271
INDEX
Index
A
activate standard editor ........................................230activation problem ................................................260add file in project ..............................................13, 76all function, display of max used stack for............243all function, display of max used stack route for...245analysis information (graph flow)............................16analysis information (tree biew)..............................16analysis information, display of (graph flow window)
.....................................................................57analysis message window..........................5, 56, 104analysis option .......................................................14analysis option command.......................................50analysis option dialog box ......................................81analysis result data file, deleting ............................58analysis result data file, updating ...........................58analysis window .......................................................6analyze.........................................................9, 14, 56analyze menu...................................................46, 80arrange icon ...........................................................21
B
bar on window ........................................................46bitmap file, outputting ...........................................181
C
C/C++ analyzer ......................................................22C/C++ analyzer, effect of .........................................2C/C++ analyzer, starting ........................................43C/C++ compiler, method of creating using...........250C/C++ global variable information, displaying......157C/C++ option ..........................................................82call MUSC ..............................................................83call tree...................................................................23call tree function .....................................................28call tree pop-up menu ..........................................185call tree window....................................................108call tree, displaying...............................................184cascade..................................................................21check menu..........................................................152chip classification ...................................................83class hierarchy .......................................................16class information ....................................................23
class information, displaying................................ 188class inheritance diagram ...................................... 25class inheritance diagram pop-up menu.............. 189class inheritance diagram, displaying .................. 189class inheritance diagram, enlarging ................... 191class inheritance information ................. 25, 110, 199class list ......................................................... 25, 111class name list ............................................... 16, 196class statistical information .................................. 197class summary information ............................ 25, 110class usage information ................. 26, 110, 200, 201close all .................................................................. 21close project........................................................... 11compilation environment ........................................ 20compilation-target file............................................. 18compile..................................................................... 9compile menu................................................. 46, 120compile option dialog box for fcc911s.................. 121compile option dialog box for fcc935s.................. 134compiler, environment of...................................... 165complexity, measuring ......................................... 217complexity, using ................................................. 217confirmation dialog box.................................... 65, 75const declaration, candidate for ............................. 24const-type qualification declaration candidate,
specifying................................................... 158copy ....................................................................... 15cross reference pop-up menu.............................. 226cross reference, displaying .................................. 223cross reference, selecting.................................... 222cut .......................................................................... 15
D
delete file from project............................................ 13development environment-related ....................... 261dialog box................................................................. 8Dialog box for setting up the ANSI C/C++ compiler
option ......................................................... 148displaying C/C++ global variable information....... 157displaying focus ................................................... 178displaying graph flow ........................................... 172displaying inline expansion candidate function.... 153displaying undefined function............................... 180
272
INDEX
E
edit ........................................................................... 9edit menu ................................................. 46, 92, 238edit window .............................................................. 7editor customize..................................................... 20editor, method of creating using........................... 250enlarging graph flow............................................. 176error message output when using max stack feature
................................................................... 263existing analysis result displaying .......................... 58explorer, starting from ............................................ 42external editor setup ............................................ 231external editor, setting.......................................... 163
F
fcc911s compiler dialog box......................... 130, 132fcc911s compiler dialog box, macro definition screen
of preprocessor.......................................... 126fcc911s compiler dialog box, specification of
language .................................................... 128fcc911s optimization ............................................ 130fcc911s output, option for..................................... 132fcc935s compiler dialog box......................... 143, 146fcc935s compiler dialog box, macro definition screen
of preprocessor.......................................... 139fcc935s compiler dialog box, specification of
language .................................................... 141fcc935s optimization ............................................ 143fcc935s output, option for..................................... 146file ............................................................................ 9file from project deleting......................................... 77file menu .................................................. 46, 72, 238file name information............................................ 224find ................................................................... 15, 17find in files .............................................................. 15find next ................................................................. 17find operation on edit window .............................. 116find prev ................................................................. 17focus function....................................................... 110focus, display of max used stack route ................ 246focus, displaying .......................................... 178, 193focus, selecting ............................................ 178, 193folder reference dialog box .................................... 63frequently asked question .................................... 268friend information ........................................... 26, 111function being candidate for inline development,
condition for ................................................. 37function information.............................................. 223function list ............................................................. 17
function list window...............................................113
G
general mode....................................................51, 81global information ...................................................24global information function......................................33global information, pop-up menu of ......................159global information, selecting .................................156graph flow .........................................................16, 23graph flow function .................................................29graph flow pop-up menu.......................................174graph flow window ..........................................57, 106graph flow, displaying ...........................................172graph flow, enlarging ............................................176graph flow, reducing .............................................176
H
help.........................................................................10help menu.......................................................47, 170help topic ................................................................22
I
icon, starting with....................................................42include path ............................................................55initial window ..........................................................44inline expansion candidate function, displaying....153inline function, candidate for...................................24internal editor function ............................................34interrupt ............................................................14, 56interrupt compilation ...............................................18
L
language - fcc911s compiler dialog box, specification of ................................................................128
language - fcc935s compiler dialog box, specification of ................................................................141
language level ..................................................52, 84locate operation on analysis window....................116logic flow.................................................................23logic flow function ...................................................30logic flow, displaying.............................................209logic flow, selecting...............................................208lower version, compatibility with ...........................263
M
macro definition ......................................................55macro definition screen of preprocessor - fcc911s
compiler dialog box ....................................126
273
INDEX
macro definition screen of preprocessor - fcc935s compiler dialog box ....................................139
macro information ................................................224main window ............................................................3max stack-related.................................................261max used stack ................................................17, 24max used stack command ...................................115max used stack route .............................................17max used stack route command ..........................115max used stack, calculating .................................248max used stack, limitation on ...............................249max used stack, using calculate ..........................248maximum used stack route, display of ...................36maximum used stack, calculation of.......................36menu and bar on window .......................................46message bar ..........................................................16MS-DOS prompt, starting from...............................42mutual reference information .................................24mutual reference information function....................32
N
name space......................................................16, 23name space content.........................17, 27, 112, 204name space information.........................27, 112, 204name space information, displaying.....................204new file ...................................................................13new file creating .....................................................73new project.............................................................11new project creating ...............................................62
O
open file..................................................................13open project ...........................................................11opening file.............................................................74opening project.......................................................64option .....................................................................18other option ......................................................52, 84
P
paste ......................................................................15path dialog box.................................................48, 62pop-up menu on call tree window ........................108preprocessor setting...............................................82preprocessor setting dialog box, include path screen
of ..................................................................87preprocessor setting dialog box, macro definition
screen of ......................................................88preprocessor, include path screen of (fcc911s
compiler dialog box) ...................................124
preprocessor, include path screen of (fcc935s compiler dialog box)................................... 137
print ........................................................................ 11print preview..................................................... 12, 68print setup .............................................................. 12printer setup........................................................... 69printing ....................................................... 24, 39, 67program editing...................................................... 24project ................................................................ 9, 16project file............................................................... 11project file, specifying type of................................. 49project menu .................................................... 46, 60project name & path dialog box ....................... 48, 62project window ................................................. 4, 102
Q
quit C/C++ analyzer ............................................... 12
R
re-analyze ........................................................ 14, 56reduced class inheritance diagram ...................... 191reducing graph flow.............................................. 176replace ................................................................... 15
S
save file.................................................................. 13save file as ............................................................. 13save file as command ............................................ 75save file command................................................. 75save project............................................................ 11save project as....................................................... 11save project as command...................................... 65save project command........................................... 65saving analysis result data file ............................... 58select all ................................................................. 15select file dialog box............................. 48, 64, 74, 76selecting editor....................................................... 34selecting file ........................................................... 49selecting focus ..................................................... 178selecting global information ................................. 156setting external editor........................................... 163setup ........................................................................ 9setup menu .................................................... 46, 162specified function, display of max used stack for
................................................................... 242specified function, display of max used stack route for
................................................................... 244specifying const-type qualification declaration
candidate ................................................... 158
274
INDEX
standard editor pop-up menu............................... 236standard editor setup (general) ............................ 233standard editor setup (key word) ......................... 234standard editor-related......................................... 262start compilation..................................................... 18start menu, starting from ........................................ 42statement in inline function, maximum number of
......................................................... 54, 82, 86status bar ....................................................... 16, 101summary information ............................................. 23summary information function................................ 31summary pop-up menu ........................................ 218summary, displaying ............................................ 215summary, selecting .............................................. 214
T
tag/type definition information .............................. 224target compiler ....................................................... 83target MCU............................................................. 83text, searching for ................................ 160, 219, 228tile horizontally ....................................................... 21tile vertically ........................................................... 21tool bar ........................................................... 16, 100
tree biew .................................................................16type definition information.....................................224
U
undefined class. displaying...................................195undefined function, displaying ..............................180undo........................................................................15update dependence................................................11update dependence command ...............................66
V
variable being candidate for constant declaration, condition for..................................................38
variable/function information.................................223view ..........................................................................9view menu ........................................................46, 98
W
warning level.....................................................52, 84window......................................................................9window for analysis ................................................45window menu..................................................46, 168window name 1, 2...................................................21
275
INDEX
276
CM81-00309-4E
FUJITSU SEMICONDUCTOR • CONTROLLER MANUAL
FR-V/FR FAMILY
SOFTUNE C/C++ ANALYZER MANUAL
for V5
September 2002 the fourth edition
Published FUJITSU LIMITED Electronic Devices
Edited Technical Information Dept.