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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7c0437014cb20f71,start X-Google-Attributes: gid103376,public From: jsanchor@my-dejanews.com Subject: System.Address_to_Access_Conversions Date: 1998/07/13 Message-ID: <6odddl$k94$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 371018231 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Jul 13 16:42:29 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (X11; U; SunOS 5.5.1 sun4u) Date: 1998-07-13T00:00:00+00:00 List-Id: Hello Everyone: In my program I have some system address and I have to move data to it. I am using access types to do this. I don't want to use Unchecked conversion. So I started looking at a new feature Ada95 has System.Address_to_Access_Conversions. I have type Dummy_Type is tagged private; type Ptr_to_Data_Type is access all Dummy_Type'class; private type Dummy_Type is tagged record checksum : Storage_Element; end record; Dummy : Dummy_Type; Ptr_to_Data : Ptr_to_Data_Type; I want Ptr_to_Data to point to some system address, say, 16#00E00000# with unchecked conversion I could say, function Convert_to_Pointer is new UNCHECKED_CONVERSION ( source => system.address, target => Ptr_to_Data_Type); Ptr_to_Data := Convert_to_Pointer(16#00E00000#); I tried using System.Address_to_Access_Conversions, package Convert_to_Pointer is new System.Address_to_Access_Conversions(system.address); Data_Ptr : Convert_to_Pointer.Object_Pointer; Data_Ptr := Convert_to_Pointer(16#00E00000#); --This is my problem!! -- I need a type Ptr_to_Data_Type, NOT Convert_to_Pointer.Object_Pointer I tried casting Ptr_to_Data := Ptr_to_Data_Type(Data_Ptr); --It compiled..but when I ran it SEGMENTATION FAULT ERROR showed up. Can anybody suggest how do I get the correct access type to point to memory. Thank you in advance. Jay S. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum