From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4f703f0b0ac81b7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!pfeed08.wxs.nl!newsfeed.kpn.net!pfeed14.wxs.nl!pfeed15.wxs.nl!not-for-mail From: "ldries46" Newsgroups: comp.lang.ada References: <4cf513fe$0$390$703f8584@news.kpn.nl> In-Reply-To: Subject: Re: Debugger difference between GPS 2008/2009 and 2010 Date: Sun, 5 Dec 2010 11:50:56 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 14.0.8117.416 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416 Message-ID: <4cfb6e90$0$5312$703f8584@news.kpn.nl> NNTP-Posting-Host: 77.168.179.107 X-Trace: 1291546256 news.kpn.nl 5312 77.168.179.107:61904 X-Complaints-To: abuse@planet.nl Xref: g2news2.google.com comp.lang.ada:16786 Date: 2010-12-05T11:50:56+01:00 List-Id: "Simon Wright" schreef in bericht news:m24oattceu.fsf@pushface.org... > "ldries46" 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