comp.lang.ada
 help / color / mirror / Atom feed
From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: Debugger difference between GPS 2008/2009 and 2010
Date: Sun, 5 Dec 2010 11:50:56 +0100
Date: 2010-12-05T11:50:56+01:00	[thread overview]
Message-ID: <4cfb6e90$0$5312$703f8584@news.kpn.nl> (raw)
In-Reply-To: <m24oattceu.fsf@pushface.org>

"Simon Wright" <simon@pushface.org> schreef in bericht 
news:m24oattceu.fsf@pushface.org...
> "ldries46" <bertus.dries@planet.nl> writes:
>
>> While debugging an ADA program in GPS I observed a rather annoying
>> difference between the older versions of 2008 and 2009 versus the
>> version of 2010. In the program I'm trying to create I do use a lot of
>> Unbounded Strings. Trying to display these strings in the older
>> versions I could use 'Debug' / 'Display "name"' which gave me a box
>> with four elements, next, previous, reference and last. The first two
>> are for internal use, the last presents the number of characters in
>> the string and reference gave a pointer to the string (in
>> blue). Clicking on that pointer revealed the stringunder the name of
>> reference.all . In GPS 2010 reference.all always presents a message
>> "unknown variable", however the unbounded string in the program itself
>> can be correctly used.
>> May be I used a wrong setting but I cannot find which, can anybody
>> help me.
>
> Same behaviour here on Mac OS X.
>
> With this program
>
>   with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
>   procedure Ubs is
>      S : Unbounded_String;
>   begin
>      for J in 1 .. 10 loop
>         S := S & "j";
>      end loop;
>   end Ubs;
>
> and setting a break on line 6, using GPS 'Debug > Print S' I get this in
> the debugger console window:
>   (gdb) print S
>   $3 = (
>     prev => 0x0,
>     next => 0x0,
>     reference => 0x1001000a0
>   )
>
> If *in the debugger console window* I type this
>   (gdb) p s.reference
>   $4 = (access ada.strings.unbounded.shared_string) 0x1001000a0
>
> and then this
>   (gdb) p s.reference.all
>   $5 = (
>     max_length => 20,
>     counter => 1,
>     last => 2,
>     data => "j"
>   )
>
> So you can get there, just not as easily as you would have hoped or as
> you used to.
>
> The same behaviour occurs with GNAT GPL 2009, so the situation is that
> GDB used to have (may still have!) special circuitry for dealing with
> Unbounded_String as it was in GNAT GPL 2009, but doesn't for 2010.
Thanks for the useful suggestion.  I have experimented somewhat further and 
typed
display s.reference.all
which resulted in printing the variable every time I stepped through the 
program 




  reply	other threads:[~2010-12-05 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 15:10 Debugger difference between GPS 2008/2009 and 2010 ldries46
2010-12-04 22:12 ` Simon Wright
2010-12-05 10:50   ` ldries46 [this message]
2010-12-21 17:54 ` John McCormick
2010-12-21 20:22   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox