comp.lang.ada
 help / color / mirror / Atom feed
From: palumbo@my-dejanews.com
Subject: Ada Enumerates
Date: 1998/07/07
Date: 1998-07-07T00:00:00+00:00	[thread overview]
Message-ID: <6ntpm6$pfd$1@nnrp1.dejanews.com> (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




             reply	other threads:[~1998-07-07  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-07  0:00 palumbo [this message]
1998-07-07  0:00 ` Ada Enumerates David C. Hoos, Sr.
replies disabled

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