3. The Menu Bar
GPS provides a standard menu bar giving access to all operations. However, it is usually easier to access a feature using the various contextual menus provided throughout GPS: these give direct access to the most relevant actions in the current context (for example, a project, directory, file, or entity). Contextual menus pop up when you click the right mouse button or use the special open contextual menu key on most keyboards.
You can access the following entries from the menu bar:
File (see The File Menu)
Edit (see The Edit Menu)
Navigate (see The Navigate Menu)
Find (see The Find Menu)
View (see The View Menu)
Code (see The Code Menu)
VCS (see The VCS Menu)
Build (see The Build Menu)
Analyze (see The Analyze Menu)
Debug (see The Debug Menu)
SPARK (see The SPARK Menu)
CodePeer (see The CodePeer Menu)
GNATSAS (see The GNATSAS Menu)
Window (see The Window Menu)
Help (see The Help Menu)
3.1. The File Menu
File ‣ New Project…
Open a dialog to create a new project from an existing template
File ‣ Open Project…
Open the Open Project dialog
File ‣ Open Project from Host…
Open remote project
File ‣ Open Recent Projects
Use this menu to load one of the recently open projects.
File ‣ Project ‣ Add Complex File Naming Conventions…
Ask naming patterns to the user and run gnatname on the current project to add the files located in the project’s source directories matching these patterns to project’s sources files.
File ‣ Project ‣ Reload Project
Recompute the list of source files for the project. This should be used whenever you create or remove files outside of GNAT Studio. Can also be used to try to reload the previous invalid project.
File ‣ New File
Create a new empty editor
File ‣ New File View
Create a new view for the selected editor
File ‣ Open File…
Open an existing file
Shortcut: F3
File ‣ Open File from Host…
Open a file from a remote host
Shortcut: Ctrl+F3
File ‣ Save
Save the current editor
Shortcut: Ctrl+S
File ‣ Save As…
Save the current editor with a different name
File ‣ Save More ‣ All
Save all modified files and projects
File ‣ Save More ‣ Projects
Save all modified projects to disk
File ‣ Save More ‣ Desktop
Save the layout of the desktop to a file, so that it is restored when GNAT Studio is restarted later with the same project
File ‣ Change Directory…
Change the current directory
File ‣ Locations ‣ Export Locations to Editor
Export all messages listed in the Locations view to an editor.
File ‣ Print
Print the current editor
File ‣ Close
Close the currently selected window
Shortcut: Ctrl+W
File ‣ Close All
Close all open windows, asking for confirmation when relevant
File ‣ Close All Editors
Save and close all source editors.
File ‣ Close All Editors except Current
Save and close all source editors, except the curret one.
File ‣ Reset all perspectives
Reset all perspectives for all projects to their default. This also closes all editors.
File ‣ Exit
Exit GNAT Studio, after confirming whether to save modified files
Shortcut: Ctrl+Q
3.2. The Edit Menu
Edit ‣ Undo
Undo the last command
Shortcut: Ctrl+Z
Edit ‣ Redo
Redo the last command that was undone
Shortcut: Ctrl+R
Edit ‣ Cut
Cut the current selection to the clipboard
Shortcut: Ctrl+X or Shift+Delete
Edit ‣ Copy
Copy the current selection to the clipboard
Shortcut: Ctrl+C or Ctrl+Insert
Edit ‣ Paste
Paste the contents of the clipboard into the current text area
Shortcut: Ctrl+V or Shift+Insert
Edit ‣ Paste Previous
Cancel the previous Paste operation, and instead insert the text copied before through Copy To Clipboard
Shortcut: Shift+Ctrl+Insert
Edit ‣ Select All
Select the whole contents of the editor
Shortcut: Ctrl+A
Edit ‣ Cursors ‣ Add cursor and go down
Shortcut: Shift+Alt+Down
Edit ‣ Cursors ‣ Add cursor and go up
Shortcut: Shift+Alt+Up
Edit ‣ Cursors ‣ Cursor select next occurence of selection
Shortcut: Shift+Ctrl+N
Edit ‣ Cursors ‣ Cursor skip next occurence of selection
Shortcut: Ctrl+Alt+N
Edit ‣ Cursors ‣ Add cursors to all references of entity
Shortcut: Shift+Ctrl+E
Edit ‣ Insert File…
Insert the contents of the file into the current editor
Edit ‣ Compare ‣ Two Files…
Compare two files
Edit ‣ Compare ‣ Three Files…
Compare three files
Edit ‣ Increase Text Size
Increase the size of fonts in the source editors. This impacts the corresponding preferences.
Shortcut: Ctrl++
Edit ‣ Decrease Text Size
Decrease the size of fonts in the source editors. This impacts the corresponding preferences.
Shortcut: Ctrl+-
Edit ‣ Project Properties…
Open the project properties editor
Edit ‣ Preferences…
Open (or reuse if it already exists) the ‘Preferences’ view
3.3. The Navigate Menu
Navigate ‣ Back
Goto previous location
Shortcut: Shift+Ctrl+{ or Button_4
Navigate ‣ Forward
Goto next location
Shortcut: Shift+Ctrl+} or Button_5
Navigate ‣ Goto Declaration
Jump to the declaration of the current entity
Navigate ‣ Goto Body
Jump to the implementation/body of the current entity
Navigate ‣ Goto Matching Delimiter
Jump to the matching delimiter ()[]{}
Shortcut: Ctrl+’
Navigate ‣ Goto Line…
Open a dialog to select a line to go to
Shortcut: Ctrl+G
Navigate ‣ Goto File Spec<->Body
Open the corresponding spec or body file
Navigate ‣ Restart Language Server ‣ Ada
Restart the language server for Ada
Navigate ‣ Locate in Files view
Display the files view, and expand nodes to show the selected file
Navigate ‣ Lock or Unlock Current Editor
Lock or unlock the current editor. Locked editors can be used to maintain a given position in an editor. This is done by making editors insensitive to ‘jump to code’ events such as navigation actions, clicks on messages in the Locations view etc. Instead, a new unlocked editor will be opened for the same file.
Navigate ‣ Lock or Unlock Current Editor (split)
Lock or unlock the current editor, and put it in separate notebook. This will split the MDI in two if needed (i.e: when there is only one notebook available).
Navigate ‣ Add Bookmark
Create a bookmark at the current location in the editor
Navigate ‣ Start of Statement
Move to the beginning of the current statement
Shortcut: Alt+Up
Navigate ‣ End of Statement
Move to the end of the current statement
Shortcut: Alt+Down
Navigate ‣ Previous Subprogram
Move to the previous subprogram
Shortcut: Ctrl+Up
Navigate ‣ Next Subprogram
Move to the next subprogram
Shortcut: Ctrl+Down
Navigate ‣ Previous Locations Message
Move to the previous message in the category from the Locations window
Shortcut: Ctrl+<
Navigate ‣ Next Locations Message
Move to the next message in the category from the Locations window
Shortcut: Ctrl+>
3.4. The Find Menu
Find ‣ Find…
Open the search dialog. If you have selected the preference Search/Preserve search context, the same context will be selected, otherwise the context is reset depending on the active window
Shortcut: Ctrl+F
Find ‣ Replace…
Open the search dialog in the replace mode. If you have selected the preference Search/Preserve Search Context, the same context will be selected, otherwise the context is reset depending on the active window
Shortcut: Shift+Ctrl+F
Find ‣ Find Previous
Find the previous occurrence of the search pattern
Shortcut: Ctrl+P
Find ‣ Find Next
Find the next occurrence of the search pattern
Shortcut: Ctrl+N
Find ‣ Find Action
Search amongst the GNAT Studio commands, and execute the selected one
Find ‣ Find Bookmark
Search amongst all bookmarks
Find ‣ Find Build Target
Search amongst build targets
Find ‣ Find in Current Source
Search for references in the current editor
Find ‣ Find Entity
Searches amongst entities defined in the project.
Shortcut: Ctrl+T
Find ‣ Find File in Project
Search amongst the source files of the project or the run time files of the compiler. The following syntax is supported to open a file at a specific location:
<b>filename:line:column</b>
where the line and column are optional. Possible completions are found by testing the filename pattern with the base names of the source files, unless filename contains a ‘/’ or ‘', in which case the full name of the source file is used.
Shortcut: Shift+F3
Find ‣ Find Open Window
Search amongst opened windows
Find ‣ Find Plugin
Search amongst the GNAT Studio plugins, and display the associated page in the preferences editor dialog.
Find ‣ Find Preference
Search amongst the GNAT Studio preferences, and display the page containing it.
Find ‣ Find text in all sources
Search in the contents of all source files of the projects
Find ‣ Find All References
List all references to the selected entity in the Locations window
3.5. The View Menu
View ‣ Files
Open (or reuse if it already exists) the ‘Files’ view
View ‣ Project
Open (or reuse if it already exists) the ‘Project’ view
View ‣ Outline
Open (or reuse if it already exists) the ‘Outline’ view
View ‣ Bookmarks
Open (or reuse if it already exists) the ‘Bookmarks’ view
View ‣ Windows
Open (or reuse if it already exists) the ‘Windows’ view
View ‣ Locations
Open (or reuse if it already exists) the ‘Locations’ view
View ‣ Messages
Open (or reuse if it already exists) the ‘Messages’ view
View ‣ Browsers ‣ Dependency Browser
Open (or reuse if it already exists) the ‘Dependency Browser’ view
View ‣ Browsers ‣ Elaboration Circularities Browser
Open (or reuse if it already exists) the ‘Elaboration Circularities’ view
View ‣ Browsers ‣ Project Browser
Open (or reuse if it already exists) the ‘Project Browser’ view
View ‣ Call Trees
Open (or reuse if it already exists) the ‘Call Trees’ view
View ‣ Clipboard
Open (or reuse if it already exists) the ‘Clipboard’ view
View ‣ Cross Platforms ‣ Memory Usage
Open (or reuse if it already exists) the ‘Memory Usage’ view
View ‣ Cross Platforms ‣ Serial ports
Open (or reuse if it already exists) the ‘Serial Ports’ view
View ‣ File Switches
Open (or reuse if it already exists) the ‘Switches editor’ view
View ‣ Learn
Open (or reuse if it already exists) the ‘Learn’ view
View ‣ Remote
Open (or reuse if it already exists) the ‘Remote’ view
View ‣ Scenario
Open (or reuse if it already exists) the ‘Scenario’ view
View ‣ Tasks
Open (or reuse if it already exists) the ‘Tasks’ view
View ‣ Tests
Open (or reuse if it already exists) the ‘Tests’ view
View ‣ VCS ‣ Commits
Open (or reuse if it already exists) the ‘Commits’ view
View ‣ VCS ‣ History
Open (or reuse if it already exists) the ‘History’ view
View ‣ VCS ‣ Branches
Open (or reuse if it already exists) the ‘Branches’ view
View ‣ Python Console
Open (or reuse if it already exists) the ‘Python’ view
View ‣ OS Shell
Spawns the user’s shell as read from the environment variable SHELL
View ‣ Auxiliary Builds
Open the Auxiliary Builds console
View ‣ Background Builds
Open the Background Builds console
View ‣ Libadalang
Open (or reuse if it already exists) the ‘Libadalang’ view
View ‣ Log
Open (or reuse if it already exists) the ‘Log’ view
3.6. The Code Menu
Code ‣ Format file
Format the current file
Code ‣ Format Selection
Format the current line or selection
Code ‣ Selection ‣ Comment Lines
Comment the selected line(s) in the editor
Shortcut: Ctrl+/
Code ‣ Selection ‣ Uncomment Lines
Uncomment the selected line(s) in the editor
Shortcut: Ctrl+?
Code ‣ Selection ‣ Print
Print the current selection
Code ‣ Selection ‣ Refill
Reformat selected lines or current paragraph so that the list are shorter than the grey line on the right
Shortcut: Ctrl+=
Code ‣ Selection ‣ Sort
Sorts the current selection, in ascending order
Code ‣ Selection ‣ Sort Reverse
Sorts the current selection, in descending order
Code ‣ Selection ‣ Sort (no duplicate)
Sorts the current selection, in ascending order without duplicate
Code ‣ Selection ‣ Sort Reverse (no duplicate)
Sorts the current selection, in descending order without duplicate
Code ‣ Selection ‣ Move Right
- Move the current selection chars characters to the right. If chars is
negative, moves to the left. If there is no selection, indent the current line.
Shortcut: Ctrl+Alt+>
Code ‣ Selection ‣ Move Left
Shortcut: Ctrl+Alt+<
Code ‣ Selection ‣ Untabify
- Replace tab characters in the current selection (or the whole buffer) with
the correct amount of spaces. The tab stops are every n columns where n is specified by a preference in the Preferences dialog.
Code ‣ Selection ‣ Comment box
- Search backward for the first subprogram or package declaration. Before
the start of this declaration, insert a comment box containing the name of the subprogram. This provides helpful separations between subprograms, and is similar to the style used in the GNAT compiler or GPS themselves
Shortcut: Ctrl+H
Code ‣ Smart Completion
Complete current identifier based on advanced entities database
Shortcut: Ctrl+Space
Code ‣ More Completion ‣ Expand Alias
- Action to expand the alias under cursor
the editor
Shortcut: Ctrl+O
Code ‣ More Completion ‣ Complete Identifier
Complete current identifier based on the contents of the editor
Code ‣ More Completion ‣ Complete Block
End the current Ada block, by providing the appropriate “end” statement
Code ‣ Fold All Blocks
Fold all blocks (if, loops,…)
Code ‣ Unfold All Blocks
Unfold all blocks (if, loops,…)
Code ‣ Edit with External Editor
Edit the file with an external editor, as configued in the preferences
Code ‣ Generate Body
Run gnatstub on the selected Ada specification to generate a matching body.
Code ‣ Aliases…
Open the aliases editor
3.7. The VCS Menu
VCS ‣ Commits
Open (or reuse if it already exists) the ‘Commits’ view
VCS ‣ Branches
Open (or reuse if it already exists) the ‘Branches’ view
VCS ‣ View global history
Open (or reuse if it already exists) the ‘History’ view
VCS ‣ Show all local changes
Display all the local changes for the current version control system
3.8. The Build Menu
Build ‣ Check Syntax
Build target Check Syntax
Build ‣ Check Semantic
Build target Check Semantic
Build ‣ Compile File
Build target Compile File
Shortcut: Shift+F4
Build ‣ Bareboard
Actions to build bareboard code.
Build ‣ Project ‣ Build All
Build target Build All
Build ‣ Project ‣ Compile All Sources
Build target Compile All Sources
Build ‣ Project ‣ Build <current file>
Build target Build <current file>
Build ‣ Project ‣ Custom Build…
Build target Custom Build…
Shortcut: F9
Build ‣ Clean ‣ Clean All
Build target Clean All
Build ‣ Clean ‣ Clean Root
Build target Clean Root
Build ‣ Run ‣ Custom…
Build target Custom…
Build ‣ Makefile
Actions to launch Makefile targets - this is generated automatically when a Makefile is present next to the loaded project.
Build ‣ Settings ‣ Toolchains
Open the toolchains editor (for builds)
3.9. The Analyze Menu
Analyze ‣ GNAThub ‣ Display GNAThub Analysis
Load and display the GNAThub data present in the database.
Analyze ‣ GNAThub ‣ Remove GNAThub Database
Remove the GNAThub database and its associated messages
Analyze ‣ GNAThub ‣ Run…
Analyze ‣ Coverage ‣ GNATcoverage Source Traces ‣ Select prebuilt runtime
Select the .gpr project of an installed GNATcoverage prebuilt runtime.
Analyze ‣ Coverage ‣ Show Report
Display the coverage report (must load data first)
Analyze ‣ Coverage ‣ Load Data for All Projects
Load coverage data for all projects
Analyze ‣ Coverage ‣ Load Data for Current Project
Load coverage data for current project
Analyze ‣ Coverage ‣ Load Data for Current File
Load coverage data for current file
Analyze ‣ Coverage ‣ Clear Coverage from Memory
Clear coverage information from memory
Analyze ‣ Metrics ‣ Compute Metrics on Current File
Analyze ‣ Metrics ‣ Compute Metrics on Current Project
Analyze ‣ Metrics ‣ Compute Metrics on Current Project & Subprojects
Analyze ‣ Stack Analysis ‣ Analyze Stack Usage
Analyze ‣ Coding Standard ‣ Edit Rules File
Edit the coding standard file
Analyze ‣ Coding Standard ‣ Check Root Project & Subprojects
Check coding standard for the root project and its subprojects
Analyze ‣ Coding Standard ‣ Check Root Project
Check coding standard of the root project
Analyze ‣ GNATtest ‣ Generate Unit Test Setup
Run gnattest on root project
Analyze ‣ GNATtest ‣ Show not Implemented Tests
Analyze ‣ GNATtest ‣ Open Harness Project
Open harness project for current project
Analyze ‣ GNATtest ‣ Exit from Harness Project
Return to user project from current harness project
Analyze ‣ Documentation ‣ Generate Project
Launch GNATdoc on the current project
Analyze ‣ Automatic code reducer ‣ Collect sources in Sandbox Project
Collect the source files into a ‘sandbox’ project
Analyze ‣ Automatic code reducer ‣ Test the Oracle Script
Create the oracle script if it doesn’t exist, launch it if needed.
Analyze ‣ Automatic code reducer ‣ Launch Automatic Reducer
3.10. The Debug Menu
Debug ‣ Initialize ‣ no main file
Initialize the debugger, no file specified
Debug ‣ Debug ‣ Connect to Board…
Opens a simple dialog to connect to a remote board. This option is only relevant to cross debuggers.
Debug ‣ Debug ‣ Load File…
Opens a file selection dialog that allows you to choose a program to debug. The program to debug is either an executable for native debugging, or a partially linked module for cross environments (e.g VxWorks).
Debug ‣ Debug ‣ Add Symbols…
Add the symbols from a given file/module. This corresponds to the gdb command add-symbol-file. This menu is particularly useful under VxWorks targets, where the modules can be loaded independently of the debugger. For instance, if a module is independently loaded on the target (e.g. using windshell), it is absolutely required to use this functionality, otherwise the debugger won’t work properly.
Debug ‣ Debug ‣ Attach…
Attach to a running process
Debug ‣ Debug ‣ Detach
Detach the application from the debugger
Debug ‣ Debug ‣ Debug Core File…
Debug a core file instead of a running process
Debug ‣ Debug ‣ Kill
Kill the debuggee process
Debug ‣ Data ‣ Variables
Open the Variables view for the debugger
Debug ‣ Data ‣ Call Stack
Open the Call Stack window for the debugger
Debug ‣ Data ‣ Protection Domains
Open the ‘Protection Domains’ window for the debugger
Debug ‣ Data ‣ Threads
Open the ‘Threads’ window for the debugger
Debug ‣ Data ‣ Tasks
Open the ‘Tasks’ window for the debugger
Debug ‣ Data ‣ Assembly
Open the Assembly view for the debugger
Debug ‣ Data ‣ Breakpoints
Open the Breakpoints Editor for the debugger
Debug ‣ Data ‣ Registers
Open the Registers view for the debugger
Debug ‣ Data ‣ Execution
Open the Debugger Execution console
Debug ‣ Data ‣ Examine Memory
Examine the contents of the memory at the location of the selected variable
Debug ‣ Data ‣ Display Local Variables
Display the local variables in the Variables view
Debug ‣ Data ‣ Display Arguments
Display the arguments of the current subprogram in the Variables view
Debug ‣ Data ‣ Display Any Expression…
Display the value of any expression in the Variables view
Debug ‣ Run…
Choose the arguments to the program, and start running it
Shortcut: Shift+F9
Debug ‣ Step
Execute until program reaches a new line of source code
Shortcut: F5
Debug ‣ Step Instruction
Execute the program for one machine instruction only
Shortcut: Shift+F5
Debug ‣ Next
Execute the program until the next source line, stepping over subprogram calls
Shortcut: F6
Debug ‣ Next Instruction
Execute the program until the next machine instruction, stepping over subprogram calls
Shortcut: Shift+F6
Debug ‣ Finish
Continue execution until selected stack frame returns
Shortcut: F7
Debug ‣ Continue
Continue execution until next breakpoint. Start the debugger if not started yet
Shortcut: F8
Debug ‣ Continue Until
Continue execution until the given line.
Debug ‣ Interrupt
Asynchronously interrupt the debuggee program
Shortcut: Ctrl+Backslash
Debug ‣ Terminate Current
Terminate the current debugger
Debug ‣ Terminate
Terminate all running debugger
3.11. The SPARK Menu
SPARK
This menu is available if the SPARK toolset is installed on your system and available on your PATH. See Help ‣ SPARK ‣ Reference ‣ Using SPARK with GPS for more details.
3.12. The CodePeer Menu
CodePeer
This menu is available if the CodePeer toolset is installed on your system and available on your PATH. See your CodePeer documentation for more details.
3.13. The GNATSAS Menu
GNATSAS
This menu is available if the GNATSAS toolset is installed on your system and available on your PATH. See your GNATSAS documentation for more details.
3.14. The Window Menu
Window ‣ Perspectives ‣ Default
Window ‣ Perspectives ‣ Debug
Window ‣ Perspectives ‣ Analyze
Window ‣ Perspectives ‣ VCS
Window ‣ Perspectives ‣ Maximized Editors
Window ‣ Perspectives ‣ <create new>
Window ‣ Split Side-by-Side
Window ‣ Split Up-Down
Window ‣ Maximize
Window ‣ Unmaximize
Window ‣ Floating
Window ‣ Close
3.15. The Help Menu
Help ‣ Welcome
Open (or reuse if it already exists) the ‘Welcome’ view
Help ‣ Contents
Display a HTML page with a pointer to all documentation known to GNAT Studio
Help ‣ GNAT Studio ‣ Welcome
Load the documentation for ‘Welcome’ into an external web browser
Help ‣ GNAT Studio ‣ Tutorial
Load the documentation for ‘GNAT Studio Tutorial’ into an external web browser
Help ‣ GNAT Studio ‣ GNAT Studio User’s Guide
Load the documentation for ‘GNAT Studio User’s Guide’ into an external web browser
Help ‣ GNAT Studio ‣ Python extensions
Load the documentation for ‘GNAT Studio extensions for Python’ into an external web browser
Help ‣ GNAT Runtime
This menu is generated automatically, and provides pointers to the contents of the currently loaded runtime.
Help ‣ GNAT
This menu is generated automatically, and provides documentation for the compiler and accompanying tools, along with examples.
Help ‣ GPR ‣ GPR Tools User’s Guide
display documentation GPR Tools User’s Guide
Help ‣ GNU Tools
Manuals for the GNU Tools that come with your compiler.
Help ‣ Ada
This menu contains pointers to the Ada reference manuals.
Help ‣ Python ‣ Python Tutorial
Load the documentation for ‘Python tutorial’ into an external web browser
Help ‣ Python ‣ PyGTK Tutorial
Load the documentation for ‘PyGTK tutorial’ into an external web browser
Help ‣ Python ‣ PyGTK Reference Manual
Load the documentation for ‘PyGTK Reference Manual’ into an external web browser
Help ‣ GNATSAS
This menu is available if the GNATSAS toolset is installed on your system and available on your PATH. See your GNATSAS documentation for more details.
Help ‣ Create Bug Report
Create an archive containing information (logs, plugins file etc.) that can be used for bug reports.
Help ‣ About
Display the About dialog