From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20505 invoked by alias); 1 Aug 2007 06:40:54 -0000 Received: (qmail 20496 invoked by uid 22791); 1 Aug 2007 06:40:53 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 06:40:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6A6442AA193; Wed, 1 Aug 2007 02:40:49 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bT1T+2NC7gB7; Wed, 1 Aug 2007 02:40:49 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 29BE02AA10A; Wed, 1 Aug 2007 02:40:49 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 79791E7B54; Tue, 31 Jul 2007 23:44:04 -0700 (PDT) Date: Wed, 01 Aug 2007 06:40:00 -0000 From: Joel Brobecker To: mike tiberium Cc: gdb@sourceware.org Subject: Re: GDB with Ada doesn't print variables neither works with GPS Message-ID: <20070801064404.GA3619@adacore.com> References: <5fd4beb00707291452j430533b1q37f924b63fdc456c@mail.gmail.com> <5fd4beb00707291536k64988989t4d029e4390790ea0@mail.gmail.com> <20070729232307.GA3758@adacore.com> <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00005.txt.bz2 > 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