* GDB with Ada doesn't print variables neither works with GPS
[not found] <5fd4beb00707291452j430533b1q37f924b63fdc456c@mail.gmail.com>
@ 2007-07-29 23:20 ` mike tiberium
2007-07-30 3:21 ` Joel Brobecker
2007-08-01 0:10 ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
0 siblings, 2 replies; 6+ messages in thread
From: mike tiberium @ 2007-07-29 23:20 UTC (permalink / raw)
To: gdb
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB with Ada doesn't print variables neither works with GPS
2007-07-29 23:20 ` GDB with Ada doesn't print variables neither works with GPS mike tiberium
@ 2007-07-30 3:21 ` Joel Brobecker
[not found] ` <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>
2007-08-01 0:10 ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2007-07-30 3:21 UTC (permalink / raw)
To: mike tiberium; +Cc: gdb
> 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')
The only thing that you are missing here is the fact that this string
is not printed as a usual string but instead an array of characters.
I suspect that the reason that GDB does not identify your object as
a string is incomplete/incorrect debugging info.
What does ptype Hello_String.all say? It should say "array of
character". If it doesn't then, the GDB output is expected.
For your GPS issues, it's most likely an issue with your kernel
configuration, but I can't help you with that.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
* debugging the multithreads on PPC embedded platfom
2007-07-29 23:20 ` GDB with Ada doesn't print variables neither works with GPS mike tiberium
2007-07-30 3:21 ` Joel Brobecker
@ 2007-08-01 0:10 ` Jayasri Sangu
2007-08-01 3:15 ` Eli Zaretskii
2007-08-01 3:22 ` Daniel Jacobowitz
1 sibling, 2 replies; 6+ messages in thread
From: Jayasri Sangu @ 2007-08-01 0:10 UTC (permalink / raw)
To: gdb
Hi,
I am using gdb-6.6,and trying to do remote debugging of
multithreaded application.
On the borad I am running the commnad
./gdbserver-6.6 localhost:12345 --attach 190 &
And on from my linux system I am starting the gdb
./gdb-6.6 EclipseMSW.elf
GNU gdb 6.6
Copyright 2004 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 "--host=i686-pc-linux-gnu
--target=powerpc-linux"...0x3000f430 in ?? ()
(gdb)
Why I am getting 0x3000f430 in ?? ()?
Thanks
Jayasri
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: debugging the multithreads on PPC embedded platfom
2007-08-01 0:10 ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
@ 2007-08-01 3:15 ` Eli Zaretskii
2007-08-01 3:22 ` Daniel Jacobowitz
1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2007-08-01 3:15 UTC (permalink / raw)
To: Jayasri Sangu; +Cc: gdb
> Date: Tue, 31 Jul 2007 17:09:58 -0700
> From: "Jayasri Sangu" <JayasriS@aaesys.com>
>
> This GDB was configured as "--host=i686-pc-linux-gnu
> --target=powerpc-linux"...0x3000f430 in ?? ()
> (gdb)
>
>
> Why I am getting 0x3000f430 in ?? ()?
One possibility is that this program was stripped, so there are no
symbols for GDB to show you, and it can only show addresses.
What happens if you type "bt"? Can you get GDB to print any symbolic
function names if you type "finish" repeatedly?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: debugging the multithreads on PPC embedded platfom
2007-08-01 0:10 ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
2007-08-01 3:15 ` Eli Zaretskii
@ 2007-08-01 3:22 ` Daniel Jacobowitz
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2007-08-01 3:22 UTC (permalink / raw)
To: Jayasri Sangu; +Cc: gdb
On Tue, Jul 31, 2007 at 05:09:58PM -0700, Jayasri Sangu wrote:
> Why I am getting 0x3000f430 in ?? ()?
Does it work after that? Some versions of GDB display that prompt
before loading shared libraries.
If it still does not work, please read:
http://sourceware.org/gdb/current/onlinedocs/gdb_16.html#SEC153
http://sourceware.org/gdb/current/onlinedocs/gdb_18.html#SEC162
(In older versions of GDB it's "set solib-absolute-prefix" instead of
"set sysroot".)
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GDB with Ada doesn't print variables neither works with GPS
[not found] ` <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>
@ 2007-08-01 6:40 ` Joel Brobecker
0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2007-08-01 6:40 UTC (permalink / raw)
To: mike tiberium; +Cc: gdb
> I've built my application like this:
> gnatmake -f -g hello
> And also tried:
> gnatmake -f -g -gnatdA -gnatdV hello
> What am I missing here?
Nothing. This is the proper way to build your program. But the compiler
you are using is producing incomplete debugging information. I get
the proper result when I use GNAT Pro (the compiler supported by Ada
Core).
This is confirmed by:
> > What does ptype Hello_String.all say? It should say "array of
> > character". If it doesn't then, the GDB output is expected.
>
>
> For these variables I get:
>
> Hello_String: constant STRING := "Hello, world! - string variable";
> (gdb) ptype Hello_String
> type = array (1 .. 31) of <1-byte integer>
>
> Bye_String : String_Access := new String'("Bye! - string access");
> (gdb) ptype Bye_String
> type = array (<>) of <1-byte integer>
This confirms that the debugging info is incomplete. The debugger
cannot guess that the "1-byte integer" is a character, and thus
prints the array as an array rather than a string.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-08-01 6:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <5fd4beb00707291452j430533b1q37f924b63fdc456c@mail.gmail.com>
2007-07-29 23:20 ` GDB with Ada doesn't print variables neither works with GPS mike tiberium
2007-07-30 3:21 ` Joel Brobecker
[not found] ` <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>
2007-08-01 6:40 ` Joel Brobecker
2007-08-01 0:10 ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
2007-08-01 3:15 ` Eli Zaretskii
2007-08-01 3:22 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox