comp.lang.ada
 help / color / mirror / Atom feed
* Ada Enumerates
@ 1998-07-07  0:00 palumbo
  1998-07-07  0:00 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 2+ messages in thread
From: palumbo @ 1998-07-07  0:00 UTC (permalink / raw)



I'm having trouble with Ada Enumerates causing a BUS error within the GNAT
library functions. I'm using GNAT 2.07 on an SGI. I only have the problem
when I attempt to link the Ada code with C code (with C having the "main"
routine). I don't have the problem when GNAT produces the executable itself
using an Ada test driver.

I'm attempting to read an enumerate value from a data file. I've got the line
        package HPRF_MODES_MODE_IO is new
                TEXT_IO.ENUMERATION_IO(HPRF_MODES_TYPE);

and I'm doing:
        HPRF_MODES_IO.GET(FILE => CURRENT_FILE,
                          ITEM => SENSOR_DATA(SENSOR_MODEL).HPRF_MODES
        );

but the program BUS Errors in the HPRF_MODES_MODES_IO.GET in the library
routine SYSTEM.VAL_ENUM.VALUE_ENUMERATION on the code below:

        For J in 0 .. Last_Pos loop
====>>>         if T(J).all = S(F .. L) Then
                        return J;
                end if;
        end loop;

It appears the S(F .. L) is the string from the file (read in correctly) so I
assume the problem is in the T(J).all. I assume this should be all the
possible strings this enumerate can be but I'm unable to view it within CVD.
T is declared as:  T : constant Enum_Table_Ptr := A_To_T (A); I also have a
BUS Error when I attempt to do a 'VALUE for this same enumerate.

Is there any way I can look at this Enum_Table to see that it is correct?

To compound the problem a few other enumerates are working fine (when reading
in from a file) but not all. I don't understand why this works on some
enumerates and not others and why this works fine when creating a completely
Ada executable but not always work when linking with C (I'm calling adainit()
prior to calling the Ada code).

Also, where can I find the complete gdb for Ada for IRIX release. I've only
seen "diff" files from previous versions. I've currently got 4.13.gnat.1.6 and
would like to find a newer version.

Any help would be appreciated.

Paul P.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Ada Enumerates
  1998-07-07  0:00 Ada Enumerates palumbo
@ 1998-07-07  0:00 ` David C. Hoos, Sr.
  0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos, Sr. @ 1998-07-07  0:00 UTC (permalink / raw)



palumbo@my-dejanews.com wrote in message
<6ntpm6$pfd$1@nnrp1.dejanews.com>...
>I'm having trouble with Ada Enumerates causing a BUS error within the GNAT
>library functions. I'm using GNAT 2.07 on an SGI. I only have the problem
2.07 is exceedingly old.
Get 3.10p from ftp://ftp.cs.nyu.edu/pub/gnat







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

end of thread, other threads:[~1998-07-07  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-07  0:00 Ada Enumerates palumbo
1998-07-07  0:00 ` David C. Hoos, Sr.

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