?? RIGHT := 110 ??                                                                                            
?? NEWTITLE := 'NOS/VE Dump Analyzer : Change Default Command' ??                                             
MODULE dum$change_default_command;                                                                            
?? RIGHT := 110 ??                                                                                            
                                                                                                              
{ PURPOSE:                                                                                                    
{   This module contains the code for the change_default command.                                             
                                                                                                              
?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??                                      
?? PUSH (LISTEXT := ON) ??                                                                                    
*copyc due$exception_condition_codes                                                                          
*copyc dut$default_parameter_list                                                                             
?? POP ??                                                                                                     
*copyc clp$convert_integer_to_string                                                                          
*copyc clp$evaluate_parameters                                                                                
*copyc ocp$close_linker_debug_table                                                                           
*copyc ocp$open_linker_debug_table                                                                            
*copyc osp$set_status_condition                                                                               
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'Global Declarations Declared by This Module', EJECT ??                                        
                                                                                                              
  VAR                                                                                                         
    duv$default_parameters: [XDCL] ^dut$default_parameter_lists := ^initial_default_parameters,               
    initial_default_parameters: [STATIC] dut$default_parameter_lists := [                                     
{ VALUE                 } [                                                                                   
{   DUC$DP_ADDRESS_MODE   } [TRUE, 'PROCESS_VIRTUAL_ADDRESS'],                                                
{   DUC$DP_EXCHANGE       } [TRUE, 'ACTIVE'],                                                                 
{   DUC$DP_IOU            } [FALSE, ' '],                                                                     
{   DUC$DP_PP_TYPE        } [TRUE, 'NORMAL'],                                                                 
{   DUC$DP_PROCESSOR      } [FALSE, ' ']],                                                                    
{ NEXT_P                } NIL];                                                                               
                                                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$change_default_command', EJECT ??                                                         
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure changes the defaults for several parameters of commands used in the analyze_dump utility.  
{   The default values are stored in a global variable.  Each command is responsible for picking up the       
{   default value before it evaluates its command.  A procedure, dup$evaluate_parameters, exists to use       
{   the default values when evaluating the command.                                                           
                                                                                                              
  PROCEDURE [XDCL] dup$change_default_command                                                                 
    (    parameter_list: clt$parameter_list;                                                                  
     VAR status: ost$status);                                                                                 
                                                                                                              
{ PROCEDURE change_default, chad (                                                                            
{   exchange, e: any of                                                                                       
{       key                                                                                                   
{         (active a) (monitor m) (job j)                                                                      
{       keyend                                                                                                
{       integer 0..0ffffffff(16)                                                                              
{     anyend = $optional                                                                                      
{   processor, p: integer 0..3 = $optional                                                                    
{   address_mode, am: key                                                                                     
{       (process_virtual_address pva) (system_virtual_address sva) (real_memory_address rma)                  
{     keyend = $optional                                                                                      
{   pp_type, pt: key                                                                                          
{       (normal  n) (concurrent_input_output cio c)                                                           
{     keyend = $optional                                                                                      
{   iou, i: integer 0..1 = $optional                                                                          
{   debug_table, dt: file = $optional                                                                         
{   status)                                                                                                   
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 13] of clt$pdt_parameter_name,                                                       
      parameters: array [1 .. 7] 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$keyword_type_qualifier,                                                              
          keyword_specs: array [1 .. 6] of clt$keyword_specification,                                         
        recend,                                                                                               
        type_size_2: clt$type_specification_size,                                                             
        element_type_spec_2: record                                                                           
          header: clt$type_specification_header,                                                              
          qualifier: clt$integer_type_qualifier,                                                              
        recend,                                                                                               
      recend,                                                                                                 
      type2: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
      type3: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$keyword_type_qualifier,                                                                
        keyword_specs: array [1 .. 6] of clt$keyword_specification,                                           
      recend,                                                                                                 
      type4: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$keyword_type_qualifier,                                                                
        keyword_specs: array [1 .. 5] of clt$keyword_specification,                                           
      recend,                                                                                                 
      type5: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$integer_type_qualifier,                                                                
      recend,                                                                                                 
      type6: record                                                                                           
        header: clt$type_specification_header,                                                                
      recend,                                                                                                 
      type7: record                                                                                           
        header: clt$type_specification_header,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [89, 7, 11, 10, 11, 48, 542],                                                                             
    clc$command, 13, 7, 0, 0, 0, 0, 7, ''], [                                                                 
    ['ADDRESS_MODE                   ',clc$nominal_entry, 3],                                                 
    ['AM                             ',clc$abbreviation_entry, 3],                                            
    ['DEBUG_TABLE                    ',clc$nominal_entry, 6],                                                 
    ['DT                             ',clc$abbreviation_entry, 6],                                            
    ['E                              ',clc$abbreviation_entry, 1],                                            
    ['EXCHANGE                       ',clc$nominal_entry, 1],                                                 
    ['I                              ',clc$abbreviation_entry, 5],                                            
    ['IOU                            ',clc$nominal_entry, 5],                                                 
    ['P                              ',clc$abbreviation_entry, 2],                                            
    ['PP_TYPE                        ',clc$nominal_entry, 4],                                                 
    ['PROCESSOR                      ',clc$nominal_entry, 2],                                                 
    ['PT                             ',clc$abbreviation_entry, 4],                                            
    ['STATUS                         ',clc$nominal_entry, 7]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [6, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 269,                        
  clc$optional_parameter, 0, 0],                                                                              
{ PARAMETER 2                                                                                                 
    [11, clc$normal_usage_entry, clc$non_secure_parameter,                                                    
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter, 
  0, 0],                                                                                                      
{ PARAMETER 3                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 229,                        
  clc$optional_parameter, 0, 0],                                                                              
{ PARAMETER 4                                                                                                 
    [10, clc$normal_usage_entry, clc$non_secure_parameter,                                                    
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 192,                        
  clc$optional_parameter, 0, 0],                                                                              
{ PARAMETER 5                                                                                                 
    [8, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter, 
  0, 0],                                                                                                      
{ PARAMETER 6                                                                                                 
    [3, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],                               
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],                                                                                                       
{ PARAMETER 7                                                                                                 
    [13, clc$normal_usage_entry, clc$non_secure_parameter,                                                    
    $clt$parameter_spec_methods[clc$specify_by_name],                                                         
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,                      
  clc$optional_parameter, 0, 0]],                                                                             
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],                                           
    FALSE, 2],                                                                                                
    229, [[1, 0, clc$keyword_type], [6], [                                                                    
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                 
      ['ACTIVE                         ', clc$nominal_entry, clc$normal_usage_entry, 1],                      
      ['J                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],                 
      ['JOB                            ', clc$nominal_entry, clc$normal_usage_entry, 3],                      
      ['M                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                 
      ['MONITOR                        ', clc$nominal_entry, clc$normal_usage_entry, 2]]                      
      ],                                                                                                      
    20, [[1, 0, clc$integer_type], [0, 0ffffffff(16), 10]]                                                    
    ],                                                                                                        
{ PARAMETER 2                                                                                                 
    [[1, 0, clc$integer_type], [0, 3, 10]],                                                                   
{ PARAMETER 3                                                                                                 
    [[1, 0, clc$keyword_type], [6], [                                                                         
    ['PROCESS_VIRTUAL_ADDRESS        ', clc$nominal_entry, clc$normal_usage_entry, 1],                        
    ['PVA                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                   
    ['REAL_MEMORY_ADDRESS            ', clc$nominal_entry, clc$normal_usage_entry, 3],                        
    ['RMA                            ', clc$abbreviation_entry, clc$normal_usage_entry, 3],                   
    ['SVA                            ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                   
    ['SYSTEM_VIRTUAL_ADDRESS         ', clc$nominal_entry, clc$normal_usage_entry, 2]]                        
    ],                                                                                                        
{ PARAMETER 4                                                                                                 
    [[1, 0, clc$keyword_type], [5], [                                                                         
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                   
    ['CIO                            ', clc$alias_entry, clc$normal_usage_entry, 2],                          
    ['CONCURRENT_INPUT_OUTPUT        ', clc$nominal_entry, clc$normal_usage_entry, 2],                        
    ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                   
    ['NORMAL                         ', clc$nominal_entry, clc$normal_usage_entry, 1]]                        
    ],                                                                                                        
{ PARAMETER 5                                                                                                 
    [[1, 0, clc$integer_type], [0, 1, 10]],                                                                   
{ PARAMETER 6                                                                                                 
    [[1, 0, clc$file_type]],                                                                                  
{ PARAMETER 7                                                                                                 
    [[1, 0, clc$status_type]]];                                                                               
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$exchange = 1,                                                                                         
      p$processor = 2,                                                                                        
      p$address_mode = 3,                                                                                     
      p$pp_type = 4,                                                                                          
      p$iou = 5,                                                                                              
      p$debug_table = 6,                                                                                      
      p$status = 7;                                                                                           
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 7] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      default_string: ost$string,                                                                             
      parameter_index: 1 .. clc$max_parameters;                                                               
                                                                                                              
    status.normal := TRUE;                                                                                    
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {---->                                                                                          
    IFEND;                                                                                                    
                                                                                                              
  /process_parameters/                                                                                        
    FOR parameter_index := p$exchange TO p$debug_table DO                                                     
      IF NOT pvt [parameter_index].specified THEN                                                             
        CYCLE /process_parameters/; {---->                                                                    
      IFEND;                                                                                                  
                                                                                                              
      { Retrieve the default value as a string.                                                               
                                                                                                              
      CASE pvt [parameter_index].value^.kind OF                                                               
      = clc$keyword =                                                                                         
        default_string.value := pvt [parameter_index].value^.keyword_value;                                   
        default_string.size := #SIZE (pvt [parameter_index].value^.keyword_value);                            
                                                                                                              
      = clc$integer =                                                                                         
        clp$convert_integer_to_string (pvt [parameter_index].                                                 
              value^.integer_value.value, pvt [parameter_index].                                              
              value^.integer_value.radix, pvt [parameter_index].value^.integer_value.radix_specified,         
              default_string, status);                                                                        
                                                                                                              
      = clc$file =                                                                                            
        default_string.size := 1;                                                                             
        default_string.value := ' ';                                                                          
                                                                                                              
      ELSE                                                                                                    
        CYCLE /process_parameters/; {---->                                                                    
      CASEND;                                                                                                 
                                                                                                              
      { Store the default value in the global variable.                                                       
                                                                                                              
      CASE parameter_index OF                                                                                 
      = p$exchange =                                                                                          
        duv$default_parameters^.value [duc$dp_exchange].default_set := TRUE;                                  
        duv$default_parameters^.value [duc$dp_exchange].value := default_string.value;                        
                                                                                                              
      = p$processor =                                                                                         
        duv$default_parameters^.value [duc$dp_processor].default_set := TRUE;                                 
        duv$default_parameters^.value [duc$dp_processor].value := default_string.value;                       
                                                                                                              
      = p$address_mode =                                                                                      
        duv$default_parameters^.value [duc$dp_address_mode].default_set := TRUE;                              
        duv$default_parameters^.value [duc$dp_address_mode].value := default_string.value;                    
                                                                                                              
      = p$pp_type =                                                                                           
        duv$default_parameters^.value [duc$dp_pp_type].default_set := TRUE;                                   
        duv$default_parameters^.value [duc$dp_pp_type].value := default_string.value;                         
                                                                                                              
      = p$iou =                                                                                               
        duv$default_parameters^.value [duc$dp_iou].default_set := TRUE;                                       
        duv$default_parameters^.value [duc$dp_iou].value := default_string.value;                             
                                                                                                              
      = p$debug_table =                                                                                       
        ocp$close_linker_debug_table (status);                                                                
        IF (NOT status.normal) AND (status.condition <> oce$e_debug_table_not_open) THEN                      
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
        ocp$open_linker_debug_table (pvt [parameter_index].value^.file_value^, status);                       
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
      ELSE                                                                                                    
      CASEND;                                                                                                 
                                                                                                              
    FOREND /process_parameters/;                                                                              
                                                                                                              
  PROCEND dup$change_default_command;                                                                         
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$push_defaults_command', EJECT ??                                                          
                                                                                                              
  PROCEDURE [XDCL] dup$push_defaults_command                                                                  
    (    parameter_list: clt$parameter_list;                                                                  
     VAR status: ost$status);                                                                                 
                                                                                                              
{ PROCEDURE push_defaults (                                                                                   
{   status)                                                                                                   
                                                                                                              
?? 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,                                                                                                       
    [103, 5, 6, 10, 26, 47, 606],                                                                             
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [                                                                  
    ['STATUS                         ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name],                                                         
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,                      
  clc$optional_parameter, 0, 0]],                                                                             
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$status_type]]];                                                                               
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$status = 1;                                                                                           
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      default_parameters_p: ^dut$default_parameter_lists;                                                     
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {---->                                                                                          
    IFEND;                                                                                                    
                                                                                                              
    ALLOCATE default_parameters_p;                                                                            
    IF default_parameters_p = NIL THEN                                                                        
      osp$set_status_condition (due$nil_pointer, status);                                                     
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    default_parameters_p^.value := duv$default_parameters^.value;                                             
    default_parameters_p^.next_p := duv$default_parameters;                                                   
    duv$default_parameters := default_parameters_p;                                                           
                                                                                                              
  PROCEND dup$push_defaults_command;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$pop_defaults_command', EJECT ??                                                           
                                                                                                              
  PROCEDURE [XDCL] dup$pop_defaults_command                                                                   
    (    parameter_list: clt$parameter_list;                                                                  
     VAR status: ost$status);                                                                                 
                                                                                                              
{ PROCEDURE pop_defaults (                                                                                    
{   status)                                                                                                   
                                                                                                              
?? 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,                                                                                                       
    [103, 5, 6, 11, 3, 3, 584],                                                                               
    clc$command, 1, 1, 0, 0, 0, 0, 1, ''], [                                                                  
    ['STATUS                         ',clc$nominal_entry, 1]],                                                
    [                                                                                                         
{ PARAMETER 1                                                                                                 
    [1, clc$normal_usage_entry, clc$non_secure_parameter,                                                     
    $clt$parameter_spec_methods[clc$specify_by_name],                                                         
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,                      
  clc$optional_parameter, 0, 0]],                                                                             
{ PARAMETER 1                                                                                                 
    [[1, 0, clc$status_type]]];                                                                               
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$status = 1;                                                                                           
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 1] of clt$parameter_value;                                                             
                                                                                                              
    VAR                                                                                                       
      default_parameters_p: ^dut$default_parameter_lists;                                                     
                                                                                                              
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN; {---->                                                                                          
    IFEND;                                                                                                    
                                                                                                              
    default_parameters_p := duv$default_parameters^.next_p;                                                   
    IF default_parameters_p = NIL THEN                                                                        
      osp$set_status_condition (due$no_defaults_to_pop, status);                                              
      RETURN; {----->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    FREE duv$default_parameters;                                                                              
    duv$default_parameters := default_parameters_p;                                                           
                                                                                                              
  PROCEND dup$pop_defaults_command;                                                                           
?? OLDTITLE ??                                                                                                
MODEND dum$change_default_command;                                                                            
