This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GDB with Ada doesn't print variables neither works with GPS


Hi,

It seems I'm unable to print variables properly in GDB when debugging
an Ada application. This is the best I can get:

(gdb) p /c Hello_String.all
$1 = (72 'H', 101 'e', 108 'l', 108 'l', 111 'o')

Any way I can solve this? =/


--------------------------------------------------------------------------------------------------------------


I used to be able to debug an Ada application using GNAT-GPS but after
some upgrades (kernel? libc?) things stopped working. Fortunately I
can still debug using GPS on the command line, but without an IDE it's
very hard due to Ada's complicator factor =[


Using GNAT-GPS:
file /path/to/app/hello
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(gdb) break hello.adb:72
Breakpoint 1 at 0x809a450: file /path/to/app/sources/hello.adb, line 72.
(gdb) start -i data.txt
Breakpoint 2 at 0x809a050: file /path/to/app/sources/hello.adb, line 46.
/dev/ptypd: No such file or directory.

Program exited with code 01.
You can't do that without a process to debug.
(gdb) run -i data.txt
/dev/ptypd: No such file or directory.

Program exited with code 01.
You can't do that without a process to debug.
(gdb)

(gdb) show version
GNU gdb 6.6-debian
Copyright (C) 2006 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 "i486-linux-gnu".


When I try to create the device, this is what I get:
cd /dev/ && MAKEDEV ptyp
udev active, devices will be created in /dev/.static/dev/




-----------------------------------------------------------

>From the command line:
foomatic@mothership$ gdb
GNU gdb 6.6-debian
Copyright (C) 2006 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 "i486-linux-gnu".

(gdb) file /path/to/app/hello
Reading symbols from /path/to/app/hello...done.
Using host libthread_db library "/lib/i686/cmov/libthread_db.so.1".
(gdb) break hello.adb:72
Breakpoint 1 at 0x809a450: file /path/to/app/sources/hello.adb, line 72.
(gdb) start -i data.txt
Breakpoint 2 at 0x809a050: file /path/to/app/sources/hello.adb, line 46.
Starting program: /path/to/app/hello -i data.txt
[Thread debugging using libthread_db enabled]
[New Thread -1217326432 (LWP 6648)]
[Switching to Thread -1217326432 (LWP 6648)]
hello () at /path/to/app/sources/hello.adb:46
46      procedure Parse_File is
(gdb)



Any idea on how to fix this?


My system:
uname -a
Linux foomatic 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/Linux

cat /proc/version
Linux version 2.6.21-2-686 (Debian 2.6.21-6) (waldi@debian.org) (gcc
version 4.1.3 20070629 (prerelease) (Debian 4.1.2-13)) #1 SMP Wed Jul
11 03:53:02 UTC 2007


-----------------------------------------------------------


Thank you very much.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]