Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Ada arrays - a problem with aggregate notation.
@ 2007-03-25  0:24 jagorak
  2007-03-25  2:04 ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: jagorak @ 2007-03-25  0:24 UTC (permalink / raw)
  To: gdb

Hi,

The  GDB  manual  (Ninth  Edition,  for  gdb  version 6.6.50.20070317)
section 12.4.6.2 says:

== quote ==
There is limited support for [Ada] array and record aggregates. They are
permitted only on the right sides of assignments, as in these examples:
       set An_Array := (1, 2, 3, 4, 5, 6)
(...)
== end quote ==

The problem is, whenever I try to assign values to elements of an
array using the aggregate notation (e.g. (1, 2, 3, 4, 5, 6) as in example
above), I'm getting an error message like this one:
       A syntax error in expression, near ` 2, 3, 4, 5, 6)'.

Setting values of individual elements does work
       set An_Array(1) := 1
       set An_Array(2) := 55
       etc.

but using aggregate would be far more convenient...

I have no idea what I might be doing wrong here / what limitation
prevents me from using an aggregate notation.

Any ideas please?

Many thanks,
Jan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ada arrays - a problem with aggregate notation.
  2007-03-25  0:24 Ada arrays - a problem with aggregate notation jagorak
@ 2007-03-25  2:04 ` Joel Brobecker
  2007-03-25  4:14   ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2007-03-25  2:04 UTC (permalink / raw)
  To: jagorak; +Cc: gdb, Paul Hilfinger

> == quote ==
> There is limited support for [Ada] array and record aggregates. They are
> permitted only on the right sides of assignments, as in these examples:
>        set An_Array := (1, 2, 3, 4, 5, 6)
> (...)
> == end quote ==

Hmmm, I think the documentation might be inaccurate. We implemented
support for array aggregates only recently (about a year ago), and
it required a relatively large change. Unfortunately, we're not
contributing our changes in terms of the Ada mode as fast as we'd like,
so it hasn't made it to the FSF yet. We will get to it eventually.

In the meantime, if you'd like to debug Ada, you might want to have
a look at building our version of GDB: It has the latest Ada support
in it: https://libre.adacore.com/GDB/.

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ada arrays - a problem with aggregate notation.
  2007-03-25  2:04 ` Joel Brobecker
@ 2007-03-25  4:14   ` Eli Zaretskii
  2007-03-26  2:16     ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2007-03-25  4:14 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: jagorak, gdb, hilfinger

> Date: Sat, 24 Mar 2007 22:05:44 -0400
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gdb@sourceware.org, Paul Hilfinger <hilfinger@adacore.com>
> 
> > == quote ==
> > There is limited support for [Ada] array and record aggregates. They are
> > permitted only on the right sides of assignments, as in these examples:
> >        set An_Array := (1, 2, 3, 4, 5, 6)
> > (...)
> > == end quote ==
> 
> Hmmm, I think the documentation might be inaccurate.

What would be the accurate way of describing the current support?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ada arrays - a problem with aggregate notation.
  2007-03-25  4:14   ` Eli Zaretskii
@ 2007-03-26  2:16     ` Joel Brobecker
  2007-03-26 18:09       ` Re[2]: " jagorak
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2007-03-26  2:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jagorak, gdb, hilfinger

> > > There is limited support for [Ada] array and record aggregates. They are
> > > permitted only on the right sides of assignments, as in these examples:
> > >        set An_Array := (1, 2, 3, 4, 5, 6)
> > > (...)
> > > == end quote ==
> > 
> > Hmmm, I think the documentation might be inaccurate.
> 
> What would be the accurate way of describing the current support?

Actually, I take that back, I tried on a simple example, and the
assignment went smoothly. I'm pretty busy these days, but if Jan
could send more details, I'll do my best to look at this (sources,
build command, platform, GDB version, and a copy/paste of the GDB
session).

-- 
Joel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: Ada arrays - a problem with aggregate notation.
  2007-03-26  2:16     ` Joel Brobecker
@ 2007-03-26 18:09       ` jagorak
  0 siblings, 0 replies; 5+ messages in thread
From: jagorak @ 2007-03-26 18:09 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Eli Zaretskii, gdb, hilfinger


JB> Actually, I take that back, I tried on a simple example, and the
JB> assignment went smoothly. I'm pretty busy these days, but if Jan
JB> could send more details, I'll do my best to look at this (sources,
JB> build command, platform, GDB version, and a copy/paste of the GDB
JB> session).

Ah...  a  hundred apologies! - my mistake. Yes - the assignments using
aggregates  work  fine.  After your post Joel I realized that I was
using   version  6.3 of the GDB (which I was not aware of at the time,
even though I quoted exact version of the manual in my original post...).

I've just tried with version 6.5 and everything works fine and I'm
sure it will be the case with 6.6.


Many thanks,
Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-26 18:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-25  0:24 Ada arrays - a problem with aggregate notation jagorak
2007-03-25  2:04 ` Joel Brobecker
2007-03-25  4:14   ` Eli Zaretskii
2007-03-26  2:16     ` Joel Brobecker
2007-03-26 18:09       ` Re[2]: " jagorak

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