--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: gnat library compiled with bad path to sources
- From: Jake Hamby <jehamby@anobject.com>
- Date: Thu, 17 Feb 2000 10:23:47 -0800 (PST)
- Message-id: <Pine.LNX.3.96.1000217100118.21882A-100000@buk.buk.org>
Package: gnat
Version: 3.12p-4
When I try to debug a program compiled with gnat, either by calling gdb
directly, or with the gnatmem leak checker, I get errors that the debugger
can't find the location of any Ada library source files. For example, for
this simple "hello, world" program:
with Text_IO;
use Text_IO;
procedure Hello is
begin
Put_Line("Hello, world!");
end Hello;
$ gnatmake -g hello
.. compiling ..
$ gdb hello
GNU gdb 19990928
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break hello.adb:6
Breakpoint 1 at 0x8048f93: file hello.adb, line 6.
(gdb) run
Starting program: /home/jehamby/Code/hello
Breakpoint 1, _ada_hello () at hello.adb:6
6 Put_Line("Hello, world!");
(gdb) step
ada__text_io__put_line__2 (item={P_ARRAY = 0x8049eac, P_BOUNDS = 0x8049ebc})
at a-textio.adb:1089
1089 a-textio.adb: No such file or directory.
(gdb)
A similar error occurs with gnatmem, but that appears to be a different
problem which I'll file in a separate bug report:
$ gnatmem hello
443 a-except.adb: No such file or directory.
### incorrect user program termination detected.
following data may not be meaningful
Global information
------------------
Total number of allocations : 0
Total number of deallocations : 0
Final Water Mark (non freed mem) : 0 Bytes
High Water Mark : 0 Bytes
By running strace, I was able to determine that GDB is looking for the
files in /home/sam/Debian/gnat/gnat-3.12p/ada/rts/ instead of
/usr/lib/gcc-lib/i486-linux/2.8.1/adainclude/
As an ugly workaround, I can create a symlink from
/usr/lib/gcc-lib/i486-linux/2.8.1/adainclude/ into
/home/sam/Debian/gnat/gnat-3.12p/ada/rts/ so GDB can find the files, but
clearly, the correct solution is to build GNAT in such a way that
libgnat.so contains the correct locations for its source files.
I'm using Debian 2.3 (woody), kernel version 2.2.14, libc6 version
2.1.3-2, and gdb version 4.18.19990928-1.
-Jake
--- End Message ---