This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB with Ada doesn't print variables neither works with GPS
- From: Joel Brobecker <brobecker at adacore dot com>
- To: mike tiberium <mike dot tiberium at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 31 Jul 2007 23:44:04 -0700
- Subject: Re: GDB with Ada doesn't print variables neither works with GPS
- References: <5fd4beb00707291452j430533b1q37f924b63fdc456c@mail.gmail.com> <5fd4beb00707291536k64988989t4d029e4390790ea0@mail.gmail.com> <20070729232307.GA3758@adacore.com> <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>
> 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