View previous topic :: View next topic |
Author |
Message |
hrocks n00b
Joined: 23 Nov 2002 Posts: 12 Location: Broken Arrow, OK
|
Posted: Mon Dec 30, 2002 4:18 pm Post subject: gdb 5.2.1 is not gnat Ada aware |
|
|
Thanks to help and answers in topic:
https://forums.gentoo.org/viewtopic.php?t=19151&start=0&postdays=0&postorder=asc&highlight=
I was able to get the latest gcc (3.2.1) installed with Ada (gnat) capability. gcc works fine as far as I can tell. However, when I attempted to debug my Ada program with gdb (5.2.1) I found that this version of gdb is not gnat Ada aware. I searched both the ftp://ftp.gnu.org/gnu and ftp://ftp.cs.nyu.edu/pub sites but didn't find any help.
Does gnu not consider gdb part of the gcc program suite?
Does cs.nyu.edu not support the gcc 3.x.x gnu program development suite?
i.e., Does every release of gdb need to be patched to make it Ada aware?
How can I get the latest gdb with gnat Ada source language capability? |
|
Back to top |
|
|
0xbadc0fee n00b
Joined: 20 Nov 2002 Posts: 7 Location: Finland
|
Posted: Tue Dec 31, 2002 7:22 am Post subject: gdb 5.3.x may be Ada aware |
|
|
Last time I checked (about month ago), the Ada language support was added to the gdb CVS repository at
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/?cvsroot=src
So I guess that it will be in the gdb 5.3.x or 6.x release. Until that you have to use the gdb patch in the gnat-3.15p source package. I haven't tried the patch though. |
|
Back to top |
|
|
hrocks n00b
Joined: 23 Nov 2002 Posts: 12 Location: Broken Arrow, OK
|
Posted: Tue Dec 31, 2002 3:20 pm Post subject: |
|
|
I have not extracted the 3.15p gnat distribution, only the 3.14p. I didn't see any gdb patches in it. Of course a gdb comes with the distribution but it never worked for me. See below. I'll check the 3.15p gnat distribution for a patch to gdb 5.2.1 soon.
I think I misdiagnosed the problem and so will provide a bit more detail too.
I applied the bugzilla patch to get Ada built into gcc 3.2.1 The problem appears to be here. When I run gdb 5.2.1 on the executable created I get an internal error - "unimplemented function unk_lang_create_fundamental_type called" when trying to set a breakpoint at a line in my Ada source. 'show lang' and 'info extensions' also seemed to indicate that gdb 5.2.1 was not "Ada aware".
However, when I compile my Ada program using the NYU gcc 2.8.1 the gdb 5.2.1 works and allows me to set breakpoints, etc. show lang still gives "auto; currently c" and info extensions doesn't show any gnat aware extensions, but it works none the less.
An interesting side issue is that the gdb provided with the NYU dist fails to execute; failing with libncurses.so.4 can't be found. This happens in my RH 7.2 Linux environment as well. |
|
Back to top |
|
|
0xbadc0fee n00b
Joined: 20 Nov 2002 Posts: 7 Location: Finland
|
Posted: Tue Dec 31, 2002 7:29 pm Post subject: |
|
|
Well, even the gnat 3.14p src package has a patch for the gdb. However, it is against old 4.17 version and is called gdb-4.17.gnat.diff. It contains several Ada language specific changes to gdb, that look very similar to what is in the current gdb development CVS repository.
It is very interesting that you managed to use gdb-5.2.1 with gnat-3.14p, but still the gdb-5.2.1 lacks support for Ada types and other features. |
|
Back to top |
|
|
hrocks n00b
Joined: 23 Nov 2002 Posts: 12 Location: Broken Arrow, OK
|
Posted: Thu Jan 02, 2003 3:49 pm Post subject: |
|
|
Apparently gcc default debug compilation changed.
gcc 2.8.x seems to have used ELF/stabs format
while gcc 3.2.x seems to use ELF/DWARF format.
I got this info from comp.lang.ada :
If I compile via gcc 3.2.1 using -gstabs option instead
of simply -g then I get an executable where I can set
breakpoints, step, etc. just as if I had used gcc 2.8 with
the simple -g option. So, since this is good enough
for me, and I certainly don't know enough to 'fix' gdb
myself, I'm satisfied with this solution. |
|
Back to top |
|
|
hrocks n00b
Joined: 23 Nov 2002 Posts: 12 Location: Broken Arrow, OK
|
Posted: Sat Jan 04, 2003 5:25 pm Post subject: |
|
|
Actually, I wrote too soon. I can set breakpoints and use the gdb continue to go to a breakpoint. Usually the gdb next command works. But, I actually tried to do some real Ada debugging and found it much easier to go back to using gcc 2.8.1 from the NYU gnat distribution. I think the biggest hassle was that the next command often didn't work and gave the unk_... error message. |
|
Back to top |
|
|
|