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]

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


> 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


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