× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



   I'm having trouble debugging a program that passes a data structure into a
   function.  I've managed to create a small bit of sample code that fails on
   a V5R2 machine.  Anyone know what the problem may be?

   Here is the code:

   H dftactgrp(*no)                                                          
                                                                             
    * Declare a stuff template.  Shouldn't use memory because it's based     
    * Right???                                                               
   Dstuff_t          ds                  based(@)                            
   D  alpha                        20                                        
   D  unsigned                     10i 0                                     
                                                                             
    * Declare an 'instance' of the stuff template.  This one should          
    * allocate static storage                                                
   D mystuff         ds                  likeds(stuff_t)                     
   D rc              s               n                                       
                                                                             
   D test            pr              n                                       
   D  stuff                              likeds(stuff_t)                     
    /free                                                                    
        rc = test(mystuff);                                                  
        eval *inlr = *on;     // Breakpoint 1 here
    /end-free                                                                
                                                                            
   **************************************************************************
   * Run a test...                                                          
   **************************************************************************
                                                                            
    test            b                                                       
    test            pi              n                                       
     stuff                              likeds(stuff_t)                     
                                                                            
    result          s               n                                       
   /free                                                                    
      stuff.alpha = 'Hello, World';                                         
      stuff.unsigned = 1;                                                   
      return *on;   // Breakpoint 2 here
   /end-free                                                                
    test            e                                                       

   I've compiled the code as DBGVIEW(*LIST) and added breakpoints as
   indicated in the code.

   The problem is that at breakpoint number 2, I can't review the 'stuff'
   data structure as I receive CPF7E12 'Identifier does not exist', as
   follows:

   EVAL stuff                             
   Identifier does not exist.             

   Of course, I can review 'mystuff' with no difficulty:

   EVAL mystuff                           
   MYSTUFF.ALPHA = 'Hello, World        ' 
   MYSTUFF.UNSIGNED = 1                   
                                          
   In my opinion, 'stuff' should be in the symbol template of the program.  I
   should not have to find the caller of the function to inspect it's
   variables, right?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.