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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5978c98b23dbfa0b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.213.99 with SMTP id nr3mr5578249pbc.2.1324488967559; Wed, 21 Dec 2011 09:36:07 -0800 (PST) Path: lh20ni48654pbb.0!nntp.google.com!news2.google.com!postnews.google.com!l19g2000yqc.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: Re: Debugging Ada Date: Wed, 21 Dec 2011 09:36:07 -0800 (PST) Organization: http://groups.google.com Message-ID: <56da68a5-1d00-4ec7-863b-c9a2a7a64f95@l19g2000yqc.googlegroups.com> References: <4b7ed906-dfbb-4f73-826e-f1c94ec320e7@k10g2000yqk.googlegroups.com> <5567da15-bd12-4dee-be27-b98525ea1323@x19g2000yqf.googlegroups.com> <1fcdb3e7-6125-4cdc-9514-dd3cff2a7350@h3g2000yqa.googlegroups.com> <0892748e-8943-41e3-8843-9121838b4465@f33g2000yqh.googlegroups.com> NNTP-Posting-Host: 192.91.173.42 Mime-Version: 1.0 X-Trace: posting.google.com 1324488967 9645 127.0.0.1 (21 Dec 2011 17:36:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 21 Dec 2011 17:36:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l19g2000yqc.googlegroups.com; posting-host=192.91.173.42; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-12-21T09:36:07-08:00 List-Id: Ah, I see what you are saying. I don't think that is what is going on in this situation. The code I'm working with is a mix of Ada and C, and it was originally written under Ada83. The 'SysConfig' package is importing a C character array: char g_cfg_file_names[100][128]; (up to 100 file names, 128 characters each) as: pragma Import( C, CFG_FILES, "g_cfg_file_names"); LAN_CFG is part of an enumeration defined in the SysConfig package to map to the index numbers of that array. SysConfig's Cfg_Filename function is: function Cfg_Filename( Cfg_File_Id : Cfg_File_Id_Type ) return String is begin return Interfaces.C.To_Ada( CFG_FILES(Cfg_File_Id), Trim_Nul => True); end Cfg_Filename; So back in the LAN package: procedure LAN is LAN_CFG_FILE : constant String := SysConfig.Cfg_Filename( LAN_CFG ); ... begin Process_Config_File( LAN_CFG_FILE ); end; I've placed breaks on the line where LAN_CFG_FILE is set and then where it is used. When it is set, I can print the value that is assigned, but I cannot print the address of the variable/constant LAN_CFG_FILE - which makes me think that the Ada compiler is just putting the string in the code where it is used at the Process_Config_File call, rather than storing it in the LAN_CFG_FILE variable. I can find a location in memory where the filename is stored - but there does not appear to be a 'LAN_CFG_FILE' variable anywhere...