MODULE dum$stand_alone_functions;                                                                             
?? RIGHT := 110 ??                                                                                            
                                                                                                              
{ PURPOSE:                                                                                                    
{                                                                                                             
{   This module contains SCL functions which are independent of the dump                                      
{   environment and therefore common code can be shared between Analyze Dump and                              
{   Analyze System.                                                                                           
{                                                                                                             
{ DESIGN:                                                                                                     
{                                                                                                             
{   The SCL function processors contained in this module are intended to be                                   
{   called from both the Analyze Dump and Analyze System utilities.  Therefore,                               
{   they must be able to provide their results without accessing the dump                                     
{   environment of the restart file.                                                                          
{                                                                                                             
{   Some of the functions (e.g.  $symbol_address) access the linker debug table                               
{   through Object Code Utility procedures (e.g.  ocp$find_debug_address).  The                               
{   opening and closing of the linker debug tables is performed by Analyze Dump                               
{   and Analyze System commands external to this module using other Object Code                               
{   Utility procedures (e.g.  ocp$define_linker_debug_table).                                                 
                                                                                                              
?? NEWTITLE := 'External Definitions', EJECT ??                                                               
?? PUSH (LISTEXT := ON) ??                                                                                    
*copyc due$exception_condition_codes                                                                          
*copyc clt$work_area                                                                                          
*copyc ost$caller_identifier                                                                                  
?? POP ??                                                                                                     
*copyc clf#make_clt$integer_value                                                                             
*copyc clf#make_record_header_value                                                                           
*copyc clp#add_record_field                                                                                   
                                                                                                              
*copyc clp$evaluate_parameters                                                                                
*copyc clp$make_integer_value                                                                                 
*copyc clp$make_name_value                                                                                    
*copyc ocp$find_debug_address                                                                                 
*copyc ocp$find_debug_entry_point                                                                             
*copyc osp$append_status_integer                                                                              
*copyc osp$set_status_abnormal                                                                                
*copyc pmp$convert_binary_unique_name                                                                         
*copyc pmp$convert_unique_to_binary                                                                           
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'Global Definitions', EJECT ??                                                                 
                                                                                                              
  TYPE                                                                                                        
    t$address = record                                                                                        
      case boolean of                                                                                         
                                                                                                              
      = FALSE =                                                                                               
        int: integer,                                                                                         
                                                                                                              
      = TRUE =                                                                                                
        fill: 0 .. 0ffff(16),                                                                                 
        pva: ost$pva,                                                                                         
      casend,                                                                                                 
    recend;                                                                                                   
                                                                                                              
?? TITLE := 'dup$$bit_function', EJECT ??                                                                     
                                                                                                              
{                                                                                                             
{ This function returns a boolean value of true if the specified bit in the                                   
{ specified word is a binary one; otherwise, a false value is returned.                                       
{                                                                                                             
                                                                                                              
  PROCEDURE [XDCL] dup$$bit_function                                                                          
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $bit (                                                                                             
{   word: integer = $required                                                                                 
{   bit_number: integer 0..63 = $required                                                                     
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 2] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 2] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
      type2: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 3, 23, 16, 0, 4, 589],                                                                               
    clc$function, 2, 2, 2, 0, 0, 0, 0, ''], [                                                                 
    ['BIT_NUMBER                     ',clc$nominal_entry, 2],                                                 
    ['WORD                           ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [2, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0],                                                                                                      
{ PARAMETER 2                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [clc$min_integer, clc$max_integer, 10]],                                       
{ PARAMETER 2                                                                                                 
    [[1, 0, clc$integer_type], [0, 63, 10]]];                                                                 
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$word = 1,                                                                                             
      p$bit_number = 2;                                                                                       
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 2] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      bits: packed array [0 .. 63] of boolean;                                                                
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$boolean;                                                                             
    p_value^.boolean_value.kind := clc$true_false_boolean;                                                    
    #UNCHECKED_CONVERSION (pvt [p$word].value^.integer_value.value, bits);                                    
    p_value^.boolean_value.value := bits [pvt [p$bit_number].value^.integer_value.value];                     
                                                                                                              
  PROCEND dup$$bit_function;                                                                                  
?? TITLE := 'dup$convert_unique_name', EJECT ??                                                               
                                                                                                              
  PROCEDURE [XDCL] dup$convert_unique_name                                                                    
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_result: ^clt$data_value;                                                                           
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $convert_unique_name, $conun, $cun (                                                               
{   unique_name: any of                                                                                       
{       string #SIZE(ost$binary_unique_name)                                                                  
{       string #SIZE(ost$name)                                                                                
{       name #SIZE(ost$name)..#SIZE(ost$name)                                                                 
{     anyend = $required                                                                                      
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$union_type_qualifier,                                                                  
        type_size_1: clt$type_specification_size,                                                             
        element_type_spec_1: record                                                                           
          header: clt$type_specification_header,                                                              
          qualifier: clt$string_type_qualifier,                                                               
        recend,                                                                                               
        type_size_2: clt$type_specification_size,                                                             
        element_type_spec_2: record                                                                           
          header: clt$type_specification_header,                                                              
          qualifier: clt$string_type_qualifier,                                                               
        recend,                                                                                               
        type_size_3: clt$type_specification_size,                                                             
        element_type_spec_3: record                                                                           
          header: clt$type_specification_header,                                                              
          qualifier: clt$name_type_qualifier,                                                                 
        recend,                                                                                               
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 1, 17, 13, 8, 10, 64],                                                                               
    clc$function, 1, 1, 1, 0, 0, 0, 0, ''], [                                                                 
    ['UNIQUE_NAME                    ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 45, clc$required_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$union_type], [[clc$name_type, clc$string_type],                                               
    TRUE, 3],                                                                                                 
    8, [[1, 0, clc$string_type], [#SIZE(ost$binary_unique_name), #SIZE(ost$binary_unique_name), FALSE]],      
    8, [[1, 0, clc$string_type], [#SIZE(ost$name), #SIZE(ost$name), FALSE]],                                  
    5, [[1, 0, clc$name_type], [#SIZE(ost$name), #SIZE(ost$name)]]                                            
    ]];                                                                                                       
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$unique_name = 1;                                                                                      
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    TYPE                                                                                                      
      converter_type = record                                                                                 
        case boolean of                                                                                       
        = TRUE =                                                                                              
          name: ost$name,                                                                                     
        = FALSE =                                                                                             
          unique_name: ost$binary_unique_name,                                                                
        casend,                                                                                               
      recend;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      binary_name_size: integer,                                                                              
      converter: converter_type,                                                                              
      name: ost$name,                                                                                         
      p_value: ^clt$data_value;                                                                               
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
                                                                                                              
    IF status.normal THEN                                                                                     
      p_value := pvt [p$unique_name].value;                                                                   
      binary_name_size := #SIZE (converter.unique_name);                                                      
      NEXT p_result IN p_work;                                                                                
                                                                                                              
      IF (p_value^.kind = clc$string) AND (STRLENGTH (p_value^.string_value^) = binary_name_size) THEN        
        p_result^.kind := clc$name;                                                                           
        converter.name (1, binary_name_size) := p_value^.string_value^;                                       
        pmp$convert_binary_unique_name (converter.unique_name, p_result^.name_value, status);                 
      ELSE                                                                                                    
        p_result^.kind := clc$string;                                                                         
        NEXT p_result^.string_value: [binary_name_size] IN p_work;                                            
        IF (p_value^.kind = clc$name) THEN                                                                    
          name := p_value^.name_value;                                                                        
        ELSE                                                                                                  
          name := p_value^.string_value^;                                                                     
        IFEND;                                                                                                
        converter.name := '';                                                                                 
        pmp$convert_unique_to_binary (name, converter.unique_name, status);                                   
        p_result^.string_value^ (1, binary_name_size) := converter.name (1, binary_name_size);                
      IFEND;                                                                                                  
    IFEND;                                                                                                    
  PROCEND dup$convert_unique_name;                                                                            
?? TITLE := 'dup$$module_function', EJECT ??                                                                  
                                                                                                              
  PROCEDURE [XDCL] dup$$module_function                                                                       
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $module (                                                                                          
{   pva: integer 0..0ffffffffffff(16) = $required                                                             
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 3, 23, 17, 41, 46, 952],                                                                             
    clc$function, 1, 1, 1, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]]];                                                  
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1;                                                                                              
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address,                                                                                     
      found: boolean,                                                                                         
      module_name: pmt$program_name,                                                                          
      offset: ost$segment_offset,                                                                             
      offset_in_section: ost$segment_offset,                                                                  
      section_name: pmt$program_name,                                                                         
      seg: ost$segment;                                                                                       
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    address.int := pvt [p$pva].value^.integer_value.value;                                                    
    seg := address.pva.seg;                                                                                   
    offset := address.pva.offset;                                                                             
    ocp$find_debug_address (seg, offset, found, module_name, section_name, offset_in_section, status);        
                                                                                                              
    IF NOT status.normal THEN                                                                                 
      IF (status.condition = oce$e_debug_table_not_open) THEN                                                 
        osp$set_status_abnormal (duc$dump_analyzer_id, due$debug_table_not_avail, '', status);                
      IFEND;                                                                                                  
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF NOT found THEN                                                                                         
      osp$set_status_abnormal (duc$dump_analyzer_id, due$no_entry_for_address, '', status);                   
      osp$append_status_integer (osc$status_parameter_delimiter, address.int, 16, TRUE, status);              
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$string;                                                                              
    NEXT p_value^.string_value: [STRLENGTH (module_name)] IN p_work;                                          
    p_value^.string_value^ := module_name;                                                                    
                                                                                                              
  PROCEND dup$$module_function;                                                                               
?? TITLE := 'dup$$nil_pva_function', EJECT ??                                                                 
                                                                                                              
  PROCEDURE [XDCL] dup$$nil_pva_function                                                                      
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $nil_pva, $np (                                                                                    
{   pva: integer 0..0ffffffffffff(16) = $optional                                                             
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [106, 10, 24, 16, 56, 52, 936],                                                                           
    clc$function, 1, 1, 0, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]]];                                                  
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1;                                                                                              
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address;                                                                                     
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF pvt [p$pva].specified THEN                                                                             
      address.int := pvt [p$pva].value^.integer_value.value;                                                  
                                                                                                              
      NEXT p_value IN p_work;                                                                                 
      p_value^.kind := clc$boolean;                                                                           
      p_value^.boolean_value.kind := clc$true_false_boolean;                                                  
      p_value^.boolean_value.value := (address.pva.ring = osc$max_ring) AND                                   
            (address.pva.seg = osc$maximum_segment) AND (address.pva.offset < 0);                             
    ELSE                                                                                                      
      p_value := clf#make_clt$integer_value (0ffff80000000(16), 16, TRUE, p_work)                             
    IFEND                                                                                                     
                                                                                                              
  PROCEND dup$$nil_pva_function;                                                                              
?? TITLE := 'dup$$offset_function', EJECT ??                                                                  
                                                                                                              
  PROCEDURE [XDCL] dup$$offset_function                                                                       
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $offset, $off (                                                                                    
{   pva: integer 0..0ffffffffffff(16) = $required                                                             
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 3, 27, 9, 8, 41, 313],                                                                               
    clc$function, 1, 1, 1, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]]];                                                  
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1;                                                                                              
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address;                                                                                     
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    address.int := pvt [p$pva].value^.integer_value.value;                                                    
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$integer;                                                                             
    p_value^.integer_value.value := address.pva.offset;                                                       
    p_value^.integer_value.radix := 16;                                                                       
    p_value^.integer_value.radix_specified := TRUE;                                                           
  PROCEND dup$$offset_function;                                                                               
?? TITLE := 'dup$$ring_function', EJECT ??                                                                    
                                                                                                              
  PROCEDURE [XDCL] dup$$ring_function                                                                         
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $ring (                                                                                            
{   pva: integer 0..0ffffffffffff(16) = $optional                                                             
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 9, 1, 7, 24, 38, 924],                                                                               
    clc$function, 1, 1, 0, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]]];                                                  
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1;                                                                                              
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address,                                                                                     
      caller_id: ost$caller_identifier;                                                                       
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    { Since this function is the same name as a $system function this causes confusion.                       
    { If the parameter is omitted, perform the same code as the $system function.                             
                                                                                                              
    IF NOT pvt [p$pva].specified THEN                                                                         
      #CALLER_ID (caller_id);                                                                                 
      clp$make_integer_value (caller_id.ring, 10, FALSE, p_work, p_value);                                    
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    address.int := pvt [p$pva].value^.integer_value.value;                                                    
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$integer;                                                                             
    p_value^.integer_value.value := address.pva.ring;                                                         
    p_value^.integer_value.radix := 16;                                                                       
    p_value^.integer_value.radix_specified := TRUE;                                                           
                                                                                                              
  PROCEND dup$$ring_function;                                                                                 
?? TITLE := 'dup$$section_function', EJECT ??                                                                 
                                                                                                              
  PROCEDURE [XDCL] dup$$section_function                                                                      
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $section, $sec (                                                                                   
{   pva: integer 0..0ffffffffffff(16) = $required                                                             
{   return_option: key                                                                                        
{       (string, s)                                                                                           
{       (record, r)                                                                                           
{     keyend = string                                                                                         
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 2] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 2] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
      type2: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$keyword_type_qualifier,                                                                
        keyword_specs: array [1 .. 4] of clt$keyword_specification,                                           
        default_value: string (6),                                                                            
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [102, 3, 21, 13, 10, 39, 795],                                                                            
    clc$function, 2, 2, 1, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1],                                                 
    ['RETURN_OPTION                  ',clc$nominal_entry, 2]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0],                                                                                                      
{ PARAMETER 2                                                                                                 
    [2, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 155,                        
  clc$optional_default_parameter, 0, 6]],                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]],                                                   
{ PARAMETER 2                                                                                                 
    [[1, 0, clc$keyword_type], [4], [                                                                         
    ['R                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                   
    ['RECORD                         ', clc$nominal_entry, clc$normal_usage_entry, 2],                        
    ['S                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                   
    ['STRING                         ', clc$nominal_entry, clc$normal_usage_entry, 1]]                        
    ,                                                                                                         
    'string']];                                                                                               
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1,                                                                                              
      p$return_option = 2;                                                                                    
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 2] of clt$parameter_value;                                                             
                                                                                                              
    TYPE                                                                                                      
      ascii_characters = set of 0 .. 255;                                                                     
                                                                                                              
    VAR                                                                                                       
      address: t$address,                                                                                     
      attribute_record_index: 0 .. clc$max_fields,                                                            
      attribute_record_p: ^clt$data_value,                                                                    
      blank: ascii_characters,                                                                                
      found: boolean,                                                                                         
      index: integer,                                                                                         
      module_name: pmt$program_name,                                                                          
      length: integer,                                                                                        
      offset: ost$segment_offset,                                                                             
      offset_in_section: ost$segment_offset,                                                                  
      result_p: ^clt$data_value,                                                                              
      s: string (50),                                                                                         
      section_name: pmt$program_name,                                                                         
      seg: ost$segment;                                                                                       
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    address.int := pvt [p$pva].value^.integer_value.value;                                                    
    seg := address.pva.seg;                                                                                   
    offset := address.pva.offset;                                                                             
    ocp$find_debug_address (seg, offset, found, module_name, section_name, offset_in_section, status);        
                                                                                                              
    IF NOT status.normal THEN                                                                                 
      IF (status.condition = oce$e_debug_table_not_open) THEN                                                 
        osp$set_status_abnormal (duc$dump_analyzer_id, due$debug_table_not_avail, '', status);                
      IFEND;                                                                                                  
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF NOT found THEN                                                                                         
      osp$set_status_abnormal (duc$dump_analyzer_id, due$no_entry_for_address, '', status);                   
      osp$append_status_integer (osc$status_parameter_delimiter, address.int, 16, TRUE, status);              
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF pvt [p$return_option].value^.keyword_value = 'STRING' THEN                                             
      NEXT p_value IN p_work;                                                                                 
      p_value^.kind := clc$string;                                                                            
      blank := $ascii_characters [$INTEGER (' ')];                                                            
      #SCAN (blank, section_name, index, found);                                                              
      STRINGREP (s, length, section_name (1, index - 1), ' +', offset_in_section: #(16), '(16)');             
      NEXT p_value^.string_value: [length] IN p_work;                                                         
      p_value^.string_value^ := s (1, length);                                                                
    ELSE                                                                                                      
      attribute_record_index := 0;                                                                            
      attribute_record_p := clf#make_record_header_value (2, p_work);                                         
      clp$make_name_value (section_name, p_work, result_p);                                                   
      clp#add_record_field ('Section_Name', result_p, attribute_record_index, attribute_record_p);            
      clp#add_record_field ('Offset', clf#make_clt$integer_value (offset_in_section, 16, TRUE, p_work),       
            attribute_record_index, attribute_record_p);                                                      
      p_value := attribute_record_p;                                                                          
    IFEND;                                                                                                    
                                                                                                              
  PROCEND dup$$section_function;                                                                              
?? TITLE := 'dup$$segment_function', EJECT ??                                                                 
                                                                                                              
  PROCEDURE [XDCL] dup$$segment_function                                                                      
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $segment, $seg (                                                                                   
{   pva: integer 0..0ffffffffffff(16) = $required                                                             
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 3, 27, 9, 34, 46, 607],                                                                              
    clc$function, 1, 1, 1, 0, 0, 0, 0, ''], [                                                                 
    ['PVA                            ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$required_parameter, 
  0, 0]],                                                                                                     
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$integer_type], [0, 0ffffffffffff(16), 10]]];                                                  
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$pva = 1;                                                                                              
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address;                                                                                     
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    address.int := pvt [p$pva].value^.integer_value.value;                                                    
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$integer;                                                                             
    p_value^.integer_value.value := address.pva.seg;                                                          
    p_value^.integer_value.radix := 16;                                                                       
    p_value^.integer_value.radix_specified := TRUE;                                                           
  PROCEND dup$$segment_function;                                                                              
?? TITLE := 'dup$$symbol_address_function', EJECT ??                                                          
                                                                                                              
  PROCEDURE [XDCL] dup$$symbol_address_function                                                               
    (    parameter_list: clt$parameter_list;                                                                  
     VAR p_work: ^clt$work_area;                                                                              
     VAR p_value: ^clt$data_value;                                                                            
     VAR status: ost$status);                                                                                 
                                                                                                              
{ FUNCTION $symbol_address, $sa (                                                                             
{   program_name: program_name = $required                                                                    
{   )                                                                                                         
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 1] of clt$pdt_parameter_name,                                                        
      parameters: array [1 .. 1] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 3, 27, 9, 53, 43, 59],                                                                               
    clc$function, 1, 1, 1, 0, 0, 0, 0, ''], [                                                                 
    ['PROGRAM_NAME                   ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_positionally],                                                    
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$required_parameter, 0
  , 0]],                                                                                                      
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$program_name_type]]];                                                                         
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$program_name = 1;                                                                                     
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      address: t$address,                                                                                     
      found: boolean,                                                                                         
      module_name: pmt$program_name,                                                                          
      offset: ost$segment_offset,                                                                             
      program_name: pmt$program_name,                                                                         
      seg: ost$segment;                                                                                       
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    program_name := pvt [p$program_name].value^.program_name_value;                                           
    ocp$find_debug_entry_point (program_name, found, module_name, seg, offset, status);                       
                                                                                                              
    IF NOT status.normal THEN                                                                                 
      IF (status.condition = oce$e_debug_table_not_open) THEN                                                 
        osp$set_status_abnormal (duc$dump_analyzer_id, due$debug_table_not_avail, '', status);                
      IFEND;                                                                                                  
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF NOT found THEN                                                                                         
      osp$set_status_abnormal (duc$dump_analyzer_id, due$symbol_not_found, program_name, status);             
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
    address.int := 0;                                                                                         
    address.pva.seg := seg;                                                                                   
    address.pva.offset := offset;                                                                             
                                                                                                              
    NEXT p_value IN p_work;                                                                                   
    p_value^.kind := clc$integer;                                                                             
    p_value^.integer_value.value := address.int;                                                              
    p_value^.integer_value.radix := 16;                                                                       
    p_value^.integer_value.radix_specified := TRUE;                                                           
  PROCEND dup$$symbol_address_function;                                                                       
?? OLDTITLE ??                                                                                                
MODEND dum$stand_alone_functions;                                                                             
