Previous: Reporting Suggestions and Bugs, Up: Environment


17.6 Solving Problems

This section addresses some common problems that may arise when using or installing GPS.

Non-privileged users cannot start GPS
Q: I have installed GPS originally as super user, and ran GPS successfully, but normal users can't.

A: You should check the permissions of the directory $HOME/.gps and its subdirectories, they should be owned by the user.

GPS crashes whenever I open a source editor
This is usually due to font problems. Editing the file $HOME/.gps/preferences and changing the name of the fonts, e.g changing Courier by Courier Medium, and Helvetica by Sans should solve the problem.
GPS refuses to start the debugger
If GPS cannot properly initialize the debugger (using the menu Debug->Initialize), it is usually because the underlying debugger (gdb) cannot be launched properly. To verify this, try to launch the 'gdb' command from a shell (i.e outside GPS). If gdb cannot be launched from a shell, it usually means that you are using a wrong version of gdb (e.g a version of gdb built for Solaris 8, but run on Solaris 2.6).
GPS is frozen during a debugging session
If GPS is no longer responding while debugging an application you should first wait a little bit, since some communications between GPS and gdb can take a long time to finish. If GPS is still not responding after a few minutes, you can usually get the control back in GPS by either typing <Ctrl-C> in the shell where you've started GPS: this should unblock it; if it does not work, you can kill the gdb process launched by GPS using the ps and kill, or the top command under Unix, and the Task Manager under Windows: this will terminate your debugging session, and will unblock GPS.
My Ada program fails during elaboration. How can I debug it ?
If your program was compiled with GNAT, the main program is generated by the binder. This program is an ordinary Ada (or C if the -C switch was used) program, compiled in the usual manner, and fully debuggable provided that the -g switch is used on the gnatlink command (or -g is used in the gnatmake command itself).

The name of this package containing the main program is b~xxx.ads/adb where xxx is the name of the Ada main unit given in the gnatbind command, and you can edit and debug this file in the normal manner. You will see a series of calls to the elaboration routines of the packages, and you can debug these in the usual manner, just as if you were debugging code in your application.

How can I debug the Ada run-time library ?
The run time distributed in binary versions of GNAT hasn't been compiled with debug information. Thus, it needs to be recompiled before you can actually debug it.

The simplest is to recompile your application by adding the switches -a and -f to the gnatmake command line. This extra step is then no longer required, assuming that you keep the generated object and ali files corresponding to the GNAT run time available.

Another possibility on Unix systems is to use the file Makefile.adalib that can be found in the adalib directory of your GNAT installation and specify e.g -g -O2 for the CFLAGS switches.

The GPS main window is not displayed
If when launching GPS, nothing happens, you can try to rename the .gps directory (see Files) to start from a fresh set up.
My project have several files with the same name. How can I import it in GPS?
GPS's projects do not allow implicit overriding of sources file, i.e. you cannot have multiple times the same file name in the project hierarchy. The reason is that GPS needs to know exactly where the file is, and cannot reliably guess which occurrence to use.

There are several solutions to handle this issue:


GPS is very slow compared to previous versions under unix (GPS < 4.0.0)
GPS versions 4.x need the X RENDER extension when running under unix systems to perform at a reasonable speed, so you need to make sure your X server properly supports this extension.
Using the space key brings the smart completion window under Ubuntu
This is specific to the way GNOME is configured on Ubuntu distributions. To address this incompatibility, close GPS, then go to the GNOME menu System->Preferences->Keyboard (or launch gnome-keyboard-properties).

Select the Layout tab, click on Layout Options. Then click twice on Using space key to input non-breakable space character and then select Usual space at any level and then close the dialogs.