Georg Bauhaus | 22 Jul 11:13 2013
Picon

Integrated Help

Hi,

some good questions about how to use GPS and GNAT pop
up every now and then. Curiously, they are all answered
very well in the User's Guide (source naming scheme,
paths, etc.) of which the inquirer is, unfortunately, unaware.

What would you think about GPS offering a recurring, nice
visual hint at the built-in tutorial documentation? For example,
about placing a badge-like help button in the Tips dialogue.
Or what about a How-To menu with entries pointing at the right
places in the introductory sections of the guides. (The choice
of entries might reflect the hit list of FAQs.)

Georg
Steve Kappel | 14 Apr 16:52 2013
Picon

Problem with remote debugging

For GNAT GPL 2012 on OS X...

When using a remote, either Solaris or another OS X box, when I try to debug I get
an error about /dev/ttys003 not found and the debugged program dies.

In looking at the remote debug session log I see that GPS is sending "tty /dev/ttys003" to gdb.

This doesn't exist on the remote system and is actually on OS X where GPS is running.
Ludovic Brenta | 9 Apr 15:45 2012

Debian Bug#666958: gnat-gps: GPS isn't looking in /usr/share/ada/adainclude for installed packages

While investigating http://bugs.debian.org/666958, I discovered a bug in
prj_editor/src/creation_wizard-dependencies.adb; the fix is:

--- a/prj_editor/src/creation_wizard-dependencies.adb
+++ b/prj_editor/src/creation_wizard-dependencies.adb
 <at>  <at>  -278,8 +278,9  <at>  <at> 
          --  Make sure the path isn't duplicated
          Found := False;

-         for K in Project_Path'Range loop
+         for K in Project_Path'First .. J - 1 loop
             if Project_Path (J) = Project_Path (K) then
+               --  We've already processed the same path before.  Abort.
                Found := True;
                exit;
             end if;

If you look in the sources, you will see that, without the patch, the
condition "Project_Path (J) = Project_Path (K)" is always true at least
once (i.e. when J = K) and therefore Found always becomes True and the
rest of the loop is never executed.  Also, there is a risk that a path
that appears twice (or more) in the Project_Path array is *never*
processed.  The patch carefully ensures that a duplicated path is
processed once.

--

-- 
Ludovic Brenta.
Felix Krause | 2 Dec 23:21 2011

Python and GTK-OSX

Hi everyone,

I'm trying to compile GPS and link it against GTK-OSX (http://live.gnome.org/GTK%2B/OSX/Building),
which provides a more native interface on MacOSX. So far, I succeeded in compiling the binary, but when I
try to start it, it always fails to initialize Python (I linked against the Python framework that comes
with MacOSX Lion). My first attempt looked like this:

$ ~/gtk/inst/bin/gps

Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
ImportError: No module named site

I guess the Gtk-WARNING can be ignored for now. The problem here is that Python does not know the directory
where its modules are located. So I did:

$ export PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7  
$ ~/gtk/inst/bin/gps                                                                      

Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line
555, in <module>
    main()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line
537, in main
    known_paths = addusersitepackages(known_paths)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line
268, in addusersitepackages
(Continue reading)

John Marino | 11 Oct 13:49 2011

[patch] python support configuration for FreeBSD64 broken, other BSDs not supported

Hi,

I discovered python support wasn't getting compiled into GPS 5.0.1 on an
AMD64 FreeBSD machine even though it was explicitly requested.  The log
said the configure test failed due to use of "-ldl" which isn't
available on FreeBSD.  Looking at the configure script, it was obvious
that targets such as x86_64-unknown-freebsd8.2 were hitting a
way-too-general x86_64-*-* case before it could reach the *-freebsd* case.

The quick solution is to put the freebsd case in front of the x86_64
case.  At the same time, missing support for NetBSD, OpenBSD, and
DragonFly can be added.

The proposed patches are attached.

Regards,
John
--- gnatlib/aclocal.m4.orig	2010-07-19 10:57:13.000000000 +0200
+++ gnatlib/aclocal.m4	2011-10-11 03:05:28.000000000 +0200
 <at>  <at>  -452,6 +452,18  <at>  <at> 
           *-darwin* )
              PYTHON_LIBS="-ldl -lm ${PYTHON_LIBS}"
              ;;
+          *-freebsd* )
+             PYTHON_LIBS="-lm -lutil ${PYTHON_LIBS}"
+             ;;
+          *-dragonfly* )
+             PYTHON_LIBS="-lm -lutil ${PYTHON_LIBS}"
(Continue reading)

Francesco Piraneo G. | 28 Sep 10:23 2010
Picon

OT: Mailing lists where we can discuss about ADA itself

Gentleman,

I'm afraid to post an OT message here; just to ask if there is any mailing list where we can discuss about ADA language itself.

I know that there is a newsgroup comp.lang.ada but I cannot get access to any newserver with my provider.

Thank you very much for your precious help.
Francesco
_______________________________________________
gps-devel mailing list
gps-devel <at> lists.adacore.com
http://lists.adacore.com/mailman/listinfo/gps-devel
Ludovic Brenta | 2 Jan 22:30 2010

Copyright violation in GPS GPL Edition

Hello and hapy new year.

I am sorry to be the bearer of bad news but once again AdaCore's policy
of bundling third-party software in the GPL Edition and the public
Subversion repository is causing trouble.

In this case, GPS bundles Source Navigator (Copyright (c) 2000 Red Hat
Inc, licensed under GPL 2 or later) which bundles Berkeley DB version
1.85.  The source files are under kernel/src_info/sn/snsrc/db and
contain the 4-clause "original BSD" license:

/*-
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Margo Seltzer.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	 <at> (#)ndbm.h	8.1 (Berkeley) 6/2/93
 */

As most of you probably know, this license is incompatible with the
GPL[1].  This makes it a copyright violation for Source Navigator to
link with Berkeley DB 1.85; this is obviously not AdaCore's fault but
Red Hat's.  However AdaCore not only propagate the violation, they
illegally change the 4-clause BSD license to the GPL[2].

[1] http://www.fsf.org/licensing/licenses/gpl-faq.html#OrigBSD

[2] "Everything (tools, runtime, libraries) in the GNAT GPL Edition is
    licensed under the General Public License (GPL)."
    http://libre.adacore.com/libre/gnat-faq/

I have determined that all GPL Editions since 2005 contain this mistake.

I believe that a rather straightforward way to correct this mistake
would be to replace Berkeley DB 1.85 with version 2.7.7 available from
[3], using the 1.x compatibility API.  Oracle, who now own the copyright
for Berkeley DB, have a dual-licensing policy similar to that of
AdaCore; their Open Source license for Berkeley DB[4] is compatible with
the GPL[5].  Therefore, upgrading to Berkeley DB 2.7.7 would solve the
problem.

[3] http://www.oracle.com/technology/software/products/berkeley-db/db/index.html
[4] http://www.oracle.com/technology/software/products/berkeley-db/htdocs/oslicense.html
[5] http://www.oracle.com/technology/software/products/berkeley-db/htdocs/licensing.html

Of course, upgrading to Berkeley DB 2.7.7 would not change the license
of Berkeley DB to the GPL, so the claim[2] that "Everything (tools,
runtime, libraries) in the GNAT GPL Edition is licensed under the
General Public License (GPL)" would still be incorrect even after such
an upgrade; this is the second, unsolved part of the problem[6].

[6] "Of course, releasing an application which includes Berkeley DB
    [...] under an open source license does not change the requirements
    of our open source license, and the Berkeley DB source code remains
    subject to the terms of the open source license governing its use
    and redistribution. Our open source license is compatible with the
    GPL, so GPL'ed software can incorporate Berkeley DB [...] without
    violating the terms of either license."

I interpret the above paragraph as: "you may bundle Berkeley DB in
GPL'ed software but you may not change the license of Berkeley DB."

Note: the Open Source license for Berkeley DB is "viral" in the same way
as the GPL (pursuant to clause 3 in the first section).  While this does
not harm GNAT GPL Edition, it may be a problem if GPS is under GMGPL
rather than GPL (i.e. GNAT Pro).

A more radical way to comply with all licenses would be to not bundle
Berkeley DB at all and replace the portions of Source Navigator used in
GPS by clean Ada code owned by AdaCore or the FSF :)

Source Navigator NG[7] seem to have migrated to Berkeley DB version 4
with the same effects, license-wise, as an upgrade to 2.7.7.  There are
however incompatible API changes in addition to the license change.

[7] http://sourcenav.berlios.de/

--

-- 
Ludovic Brenta.
_______________________________________________
gps-devel mailing list
gps-devel <at> lists.adacore.com
http://lists.adacore.com/mailman/listinfo/gps-devel
Pascal MALAISE | 28 Nov 09:23 2009
Picon

"Invalid context for this action" when hitting space after gdb command

Hi,
on Ubuntu 8.04 and 9.10 I have the following bug with GPS 4.3.1
(20090114) hosted on i686-pc-linux-gnu GNAT GPL 2009 (20090519):

- I start "gps --debug=<exe>"
- I click in the start/run (">") button to start execution
- The run/start popup window appears, I clock in OK
- The program breaks in the main, so far so good
- In the debugger console, (after the prompt (gdb)) I type
"p " (p and the space key)
- gps switches to the messages window with the error:
[2009-11-28 09:08:52] Invalid context for this action

Occures with all commands typed in the console window, just after
typeing <space>.

Note that I haven't open any menu.

Workaround: Before (or even after) the problem occurs, I open and close
the "Edit" menu by clicking twice on the "Edit" button.
This works only with the Edit menu buDoes not work with any ottton, not
with the other menu buttons of GPS.
Arnaud Charlet | 2 Mar 20:45 2008

Re: Building on Fedora 8

> Thank you.  It is not clear at all to me that those two source 
> directories are different.

Well, in case of doubt, you should follow the instructions from the
INSTALL file to the letter.

> When I read link to sources, I looked on my 
> system to find sources and it seemed to have the right files.

As you can see, this is not the case, most sources are missing.

> What could be wrong with the version of Glib?  What version of Glib is 
> expected?

Again, you haven't followed the instructions from the INSTALL file apparently:
<<
- You need to use the SVN version of GtkAda matching GPS sources (same date/tag)
>>

and are using some other version of GtkAda instead it seems.

Arno
R. B. Love | 2 Mar 18:20 2008
Picon
Picon

Building on Fedora 8

I'm trying to get a version working on my Fedora 8 AMD-64 machine.   So 
far when I try to build, it fails at the point of building the main.   
I've gotten by many things before this but here I don't see what to do 
to point it to prj.ads.  I can find the file in the gnat subdirectory 
but why can the project file and Make find it?

Building project gnatlib_gtk
gnatmake: objects up to date.
gnatmake -Pgps gps-main.adb
gcc -c -g -gnatec=/home/rlove/gps/gps/gnat_debug.adc -g -O1 -gnata 
-gnatVa -gnatQ -gnaty -gnatwaCJe -gnat05 -I- -gnatA 
/home/rlove/gps/gps/src/gps-main.adb
gps-main.adb:55:06: file "prj.ads" not found
gps-main.adb:55:06: "PROJECTS (spec)" depends on "PRJ (spec)"
gps-main.adb:55:06: "ENTITIES (spec)" depends on "PROJECTS (spec)"
gps-main.adb:55:06: "PROJECTS (spec)" depends on "NAMET (spec)"
gps-main.adb:55:06: "GPS.MAIN (body)" depends on "DDE (spec)"
gps-main.adb:55:06: "DDE (spec)" depends on "GPS.KERNEL (spec)"
gps-main.adb:55:06: "GPS.KERNEL (spec)" depends on "ENTITIES (spec)"
gps-main.adb:55:06: "ENTITIES (spec)" depends on "PROJECTS.REGISTRY (spec)"
gps-main.adb:55:06: "PROJECTS.REGISTRY (spec)" depends on "PRJ (spec)"
gps-main.adb:76:06: file "prj.ads" not found
gps-main.adb:76:06: "PROJECTS.EDITOR (spec)" depends on "PRJ 
(spec)"                                              [/home/rlove/gps]
gps-main.adb:76:06: "GPS.MAIN (body)" depends on "PROJECTS.EDITOR (spec)"
gps-main.adb:76:06: "PROJECTS.EDITOR (spec)" depends on "OUTPUT (spec)"
gps-main.adb:596:37: "Signal_Child_Selected" is undefined
gps-main.adb:599:37: "Signal_Child_Title_Changed" is undefined
[deleted]

src_editor_buffer.ads:797:56: "Signal_Name" is not visible (more 
references follow)
src_editor_buffer.ads:797:56: non-visible declaration at 
glib-object.ads:207
gnatmake: "/home/rlove/gps/gps/src/gps-main.adb" compilation error
make[1]: *** [internal-build] Error 4
make: *** [default] Error 2
Per Sandberg | 27 Nov 06:23 2007
Picon

Some handy plug-ins that mad my life easier.

AutoGenerateObjectDirs.py
    Creates output directories while loading a project similar to 
gnatmake -p.

project_changing.py <cid:part1.04070004.02000208 <at> bredband.net>
    Makes it possible to add customization per project or directory tree.

/Please feel free to use it
/Per

"""This macro will create missing object-directories for a
 project tree when loading it into GPS.
 To install just copy the file to one of the plug-in directories in GPS.
 ${HOME}/.gps/plug-ins
 ${GPS_ROOT}/share/gps/plug-ins

"""

import GPS
import os
from os.path import *
import string
def on_project_changed(self):
    CreatedDirs=False
    if GPS.Preference ("Auto-Create-Dirs").get():
        prjs=GPS.Project.root().dependencies(True)
        prjs.append(GPS.Project.root())
        created=[]
        for i in prjs :        
           dirs=[i.get_attribute_as_string("Exec_Dir"),
                i.get_attribute_as_string("Library_Dir"),
                i.get_attribute_as_string("Object_Dir"),
                i.get_attribute_as_string("Library_Src_Dir")]
           for j in dirs:
               if i and i not in [".",""," "]:
                   dir=join(dirname(i.file().name()),j).strip()
                   if dir[-1:] not in ["\\","/"]:
                       if not exists(dir):
                           os.makedirs(dir)
                           created.append(dir)
                           CreatedDirs=True
        if CreatedDirs:
           GPS.Console("").clear()
           GPS.Console("").write("Created missing dirs\n")
           GPS.Console("").write(string.join(created,"\n"))
           GPS.Console("").write("\n")
           GPS.Project.recompute()

def on_gps_started(hook):
    try:
        GPS.Preference ("Auto-Create-Dirs").get()
    except:
        GPS.Preference ("Auto-Create-Dirs").set(True)
    GPS.Hook("project_view_changed").add(on_project_changed)
    on_project_changed(hook)

GPS.parse_xml("""   
   <preference name="Auto-Create-Dirs"
                page="General"
                label="Auto Create Missing Dirs"
                tip="Automaticly creates missing Directories."
                default="True"
                type="boolean" />""")

GPS.Hook("gps_started").add(on_gps_started)

"""
This module provides a framework for project specific customisation of GPS
it will set the variable:
 * "GPS.Project.project_changing_to" to the name of the project to be loaded.

then try to load configuration files in order.
 * "gps_cfg.py" in all enclosing direcorories closest last.
 * "project_name.py" next to the root project.
 * "project_name.xml" next to the root project. 
"""
import GPS
import os
from os.path import *
import string
import sys

    
def project_changing(this,project):
    def importCode(code,name,add_to_sys_modules=False):
        import new
        module=new.module(name)
        if add_to_sys_modules:
            import sys
            sys.modules[name]=module
        exec code in module.__dict__
        return module

    xmlfile=splitext(project.name())[0] + ".xml"
    pyfile=splitext(project.name())[0]  + ".py"
    files=[]
    dir=dirname(project.name())

    while True:
        f=join(dir,"gps_cfg.py")
        if exists(f):files.append(f)
        if dirname(dir)==dir:break
        dir=dirname(dir)
    files.reverse()
    if exists(pyfile):files.append(pyfile)

    GPS.Project.project_changing_to = project.name()

    for i in files:
        f=file(i)
        sys.stdout.write('loading: "' + i + '" ')
        try:
            importCode(f,splitext(basename(i))[0])
            sys.stdout.write('OK.\n')
        except:
            sys.stdout.write('Fail.\n')               
        f.close()

    if exists(xmlfile):
        f=file(xmlfile)
        buffer=f.read()
        f.close()
        sys.stdout.write('loading: "' + xmlfile)
        try:
            GPS.parse_xml(buffer)
            sys.stdout.write('" OK.\n')
        except:
            sys.stdout.write('" Fail.\n')

GPS.Hook("project_changing").add(project_changing)
_______________________________________________
gps-devel mailing list
gps-devel <at> lists.adacore.com
http://lists.adacore.com/mailman/listinfo/gps-devel

Gmane