?? RIGHT := 110 ??                                                                                            
?? NEWTITLE := 'NOS/VE Dump Analyzer : Analyze Dump Command' ??                                               
MODULE dum$analyze_dump_command;                                                                              
                                                                                                              
{ PURPOSE:                                                                                                    
{   This module contains the code for the analyze_dump command.                                               
                                                                                                              
?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??                                      
?? PUSH (LISTEXT := ON) ??                                                                                    
*copyc i#build_adaptable_seq_pointer                                                                          
*copyc clc$standard_file_names                                                                                
*copyc duc$dump_analyzer_constants                                                                            
*copyc osc$processor_defined_registers                                                                        
*copyc osd$virtual_address                                                                                    
*copyc due$exception_condition_codes                                                                          
*copyc due$symbolic_access_exceptions                                                                         
*copyc dut$dump_environment                                                                                   
*copyc dut$execution_environment                                                                              
*copyc ost$base_system_time                                                                                   
*copyc ost$date_time                                                                                          
?? POP ??                                                                                                     
*copyc amp$get_file_attributes                                                                                
*copyc amp$get_segment_pointer                                                                                
*copyc clp$begin_utility                                                                                      
*copyc clp$close_display                                                                                      
*copyc clp$convert_integer_to_rjstring                                                                        
*copyc clp$convert_string_to_integer                                                                          
*copyc clp$count_list_elements                                                                                
*copyc clp$create_procedure_variable                                                                          
*copyc clp$delete_variable                                                                                    
*copyc clp$end_utility                                                                                        
*copyc clp$evaluate_parameters                                                                                
*copyc clp$get_variable_value                                                                                 
*copyc clp$include_file                                                                                       
*copyc clp$include_line                                                                                       
*copyc clp$open_display_reference                                                                             
*copyc dup$copy_virtual_memory_pva                                                                            
*copyc dup$display_message                                                                                    
*copyc dup$new_page_procedure                                                                                 
*copyc dup$read_dump_file                                                                                     
*copyc dup$retrieve_exchange_package                                                                          
*copyc fsp$close_file                                                                                         
*copyc fsp$get_open_information                                                                               
*copyc fsp$open_file                                                                                          
*copyc ocp$open_linker_debug_table                                                                            
*copyc ocp$open_running_debug_table                                                                           
*copyc ofp$display_status_message                                                                             
*copyc osp$append_status_integer                                                                              
*copyc osp$append_status_parameter                                                                            
*copyc osp$set_status_abnormal                                                                                
*copyc pmp$disestablish_cond_handler                                                                          
*copyc pmp$establish_condition_handler                                                                        
*copyc amv$nil_file_identifier                                                                                
*copyc i#move                                                                                                 
?? EJECT ??                                                                                                   
*copyc duv$anad_commands                                                                                      
*copyc duv$anad_functions                                                                                     
*copyc duv$default_parameters                                                                                 
*copyc duv$title_data                                                                                         
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'Global Declarations Declared by This Module', EJECT ??                                        
                                                                                                              
  TYPE                                                                                                        
    t$bst_or_string = RECORD                                                                                  
      CASE boolean OF                                                                                         
      = TRUE =                                                                                                
        string_part: string (20),                                                                             
      = FALSE =                                                                                               
        bst_part: t$bst_part,                                                                                 
      CASEND,                                                                                                 
    RECEND,                                                                                                   
                                                                                                              
    t$bst_part = RECORD                                                                                       
      hour: string (2),                                                                                       
      colon_1: string (1),                                                                                    
      minute: string (2),                                                                                     
      colon_2: string (1),                                                                                    
      second: string (2),                                                                                     
      blanks: string (2),                                                                                     
      year: string (4),                                                                                       
      period_1: string (1),                                                                                   
      month: string (2),                                                                                      
      period_2: string (1),                                                                                   
      day: string (2),                                                                                        
    RECEND;                                                                                                   
?? EJECT ??                                                                                                   
                                                                                                              
{ PROCEDURE analyze_dump, anad (                                                                              
{   dump_file, df: file = $optional                                                                           
{   restart_file, rf: list 1..duc$maximum_restart_files of file = $local.restart_file                         
{   debug_table, dt: any of                                                                                   
{       key                                                                                                   
{         (running_system, rs)                                                                                
{         (none, n)                                                                                           
{       keyend                                                                                                
{       file                                                                                                  
{     anyend = running_system                                                                                 
{   title, t: string 1..25 = $optional                                                                        
{   output, o: file = $output                                                                                 
{   processing_options, po: key                                                                               
{       (all_memory, am, all)                                                                                 
{       (critical_memory, cm, critical, c)                                                                    
{       (no_memory, hardware, nm, h)                                                                          
{     keyend = all_memory                                                                                     
{   allow_modify_restart_file, amrf: (BY_NAME, ADVANCED) boolean = false                                      
{   status)                                                                                                   
                                                                                                              
?? PUSH (LISTEXT := ON) ??                                                                                    
?? FMT (FORMAT := OFF) ??                                                                                     
                                                                                                              
  VAR                                                                                                         
    pdt: [STATIC, READ, cls$declaration_section] record                                                       
      header: clt$pdt_header,                                                                                 
      names: array [1 .. 15] of clt$pdt_parameter_name,                                                       
      parameters: array [1 .. 8] of clt$pdt_parameter,                                                        
      type1: record                                                                                           
        header: clt$type_specification_header,                                                                
      recend,                                                                                                 
      type2: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$list_type_qualifier_v2,                                                                
        element_type_spec: record                                                                             
          header: clt$type_specification_header,                                                              
        recend,                                                                                               
        default_value: string (19),                                                                           
      recend,                                                                                                 
      type3: 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 .. 4] of clt$keyword_specification,                                         
        recend,                                                                                               
        type_size_2: clt$type_specification_size,                                                             
        element_type_spec_2: record                                                                           
          header: clt$type_specification_header,                                                              
        recend,                                                                                               
        default_value: string (14),                                                                           
      recend,                                                                                                 
      type4: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$string_type_qualifier,                                                                 
      recend,                                                                                                 
      type5: record                                                                                           
        header: clt$type_specification_header,                                                                
        default_value: string (7),                                                                            
      recend,                                                                                                 
      type6: record                                                                                           
        header: clt$type_specification_header,                                                                
        qualifier: clt$keyword_type_qualifier,                                                                
        keyword_specs: array [1 .. 11] of clt$keyword_specification,                                          
        default_value: string (10),                                                                           
      recend,                                                                                                 
      type7: record                                                                                           
        header: clt$type_specification_header,                                                                
        default_value: string (5),                                                                            
      recend,                                                                                                 
      type8: record                                                                                           
        header: clt$type_specification_header,                                                                
      recend,                                                                                                 
    recend := [                                                                                               
    [1,                                                                                                       
    [102, 3, 21, 16, 33, 11, 333],                                                                            
    clc$command, 15, 8, 0, 1, 0, 0, 8, ''], [                                                                 
    ['ALLOW_MODIFY_RESTART_FILE      ',clc$nominal_entry, 7],                                                 
    ['AMRF                           ',clc$abbreviation_entry, 7],                                            
    ['DEBUG_TABLE                    ',clc$nominal_entry, 3],                                                 
    ['DF                             ',clc$abbreviation_entry, 1],                                            
    ['DT                             ',clc$abbreviation_entry, 3],                                            
    ['DUMP_FILE                      ',clc$nominal_entry, 1],                                                 
    ['O                              ',clc$abbreviation_entry, 5],                                            
    ['OUTPUT                         ',clc$nominal_entry, 5],                                                 
    ['PO                             ',clc$abbreviation_entry, 6],                                            
    ['PROCESSING_OPTIONS             ',clc$nominal_entry, 6],                                                 
    ['RESTART_FILE                   ',clc$nominal_entry, 2],                                                 
    ['RF                             ',clc$abbreviation_entry, 2],                                            
    ['STATUS                         ',clc$nominal_entry, 8],                                                 
    ['T                              ',clc$abbreviation_entry, 4],                                            
    ['TITLE                          ',clc$nominal_entry, 4]],                                                
    [                                                                                                         
{ 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, 3, 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, 19,                         
  clc$optional_default_parameter, 0, 19],                                                                     
{ PARAMETER 3                                                                                                 
    [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, 178,                        
  clc$optional_default_parameter, 0, 14],                                                                     
{ PARAMETER 4                                                                                                 
    [15, 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, 8, 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, 3,                          
  clc$optional_default_parameter, 0, 7],                                                                      
{ PARAMETER 6                                                                                                 
    [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, 414,                        
  clc$optional_default_parameter, 0, 10],                                                                     
{ PARAMETER 7                                                                                                 
    [1, clc$advanced_usage_entry, clc$non_secure_parameter,                                                   
    $clt$parameter_spec_methods[clc$specify_by_name],                                                         
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3,                          
  clc$optional_default_parameter, 0, 5],                                                                      
{ PARAMETER 8                                                                                                 
    [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$file_type]],                                                                                  
{ PARAMETER 2                                                                                                 
    [[1, 0, clc$list_type], [3, 1, duc$maximum_restart_files, 0, FALSE, FALSE],                               
      [[1, 0, clc$file_type]]                                                                                 
    ,                                                                                                         
    '$local.restart_file'],                                                                                   
{ PARAMETER 3                                                                                                 
    [[1, 0, clc$union_type], [[clc$file_type, clc$keyword_type],                                              
    FALSE, 2],                                                                                                
    155, [[1, 0, clc$keyword_type], [4], [                                                                    
      ['N                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                 
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 2],                      
      ['RS                             ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                 
      ['RUNNING_SYSTEM                 ', clc$nominal_entry, clc$normal_usage_entry, 1]]                      
      ],                                                                                                      
    3, [[1, 0, clc$file_type]]                                                                                
    ,                                                                                                         
    'running_system'],                                                                                        
{ PARAMETER 4                                                                                                 
    [[1, 0, clc$string_type], [1, 25, FALSE]],                                                                
{ PARAMETER 5                                                                                                 
    [[1, 0, clc$file_type],                                                                                   
    '$output'],                                                                                               
{ PARAMETER 6                                                                                                 
    [[1, 0, clc$keyword_type], [11], [                                                                        
    ['ALL                            ', clc$abbreviation_entry, clc$normal_usage_entry, 1],                   
    ['ALL_MEMORY                     ', clc$nominal_entry, clc$normal_usage_entry, 1],                        
    ['AM                             ', clc$alias_entry, clc$normal_usage_entry, 1],                          
    ['C                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],                   
    ['CM                             ', clc$alias_entry, clc$normal_usage_entry, 2],                          
    ['CRITICAL                       ', clc$alias_entry, clc$normal_usage_entry, 2],                          
    ['CRITICAL_MEMORY                ', clc$nominal_entry, clc$normal_usage_entry, 2],                        
    ['H                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],                   
    ['HARDWARE                       ', clc$alias_entry, clc$normal_usage_entry, 3],                          
    ['NM                             ', clc$alias_entry, clc$normal_usage_entry, 3],                          
    ['NO_MEMORY                      ', clc$nominal_entry, clc$normal_usage_entry, 3]]                        
    ,                                                                                                         
    'all_memory'],                                                                                            
{ PARAMETER 7                                                                                                 
    [[1, 0, clc$boolean_type],                                                                                
    'false'],                                                                                                 
{ PARAMETER 8                                                                                                 
    [[1, 0, clc$status_type]]];                                                                               
                                                                                                              
?? FMT (FORMAT := ON) ??                                                                                      
?? POP ??                                                                                                     
                                                                                                              
    CONST                                                                                                     
      p$dump_file = 1,                                                                                        
      p$restart_file = 2,                                                                                     
      p$debug_table = 3,                                                                                      
      p$title = 4,                                                                                            
      p$output = 5,                                                                                           
      p$processing_options = 6,                                                                               
      p$allow_modify_restart_file = 7,                                                                        
      p$status = 8;                                                                                           
                                                                                                              
    VAR                                                                                                       
      pvt: array [1 .. 8] of clt$parameter_value;                                                             
                                                                                                              
  CONST                                                                                                       
    c$file_processor = 'ANALYZE_DUMP',                                                                        
    c$processor_status_summary = 0;                                                                           
                                                                                                              
  VAR                                                                                                         
    duv$dump_environment_p: [XDCL] ^dut$dump_environment := NIL,                                              
    duv$execution_environment: [XDCL] dut$execution_environment;                                              
                                                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'convert_microsecond_clock', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure converts the microsecond clock into a time.                                                
                                                                                                              
  PROCEDURE convert_microsecond_clock                                                                         
    (    timestamp: integer;                                                                                  
         base_system_time: ost$base_system_time;                                                              
     VAR date_time: ost$date_time;                                                                            
     VAR date_time_found: boolean);                                                                           
                                                                                                              
    CONST                                                                                                     
      c$ms_per_day = 24 * 60 * 60 * 1000;                                                                     
                                                                                                              
    VAR                                                                                                       
      b1: boolean,                                                                                            
      b2: boolean,                                                                                            
      b3: boolean,                                                                                            
      day: integer,                                                                                           
      days_in_the_month: ARRAY [1 .. 12] OF 1 .. 31,                                                          
      elapsed_time: integer,                                                                                  
      hour: -1 .. 47,                                                                                         
      minute: -30 .. 119,                                                                                     
      month: 1 .. 13,                                                                                         
      second: 0 .. 119,                                                                                       
      this_is_a_leap_year: boolean,                                                                           
      year: 0 .. 2155;  {1900 + 255                                                                           
                                                                                                              
    date_time_found := FALSE;                                                                                 
                                                                                                              
    elapsed_time {ms} := (timestamp {us} - base_system_time.corresponding_microsecond_clock {us}) DIV 1000    
          {us/ms};                                                                                            
                                                                                                              
    elapsed_time := elapsed_time + (base_system_time.hour * 3600 + base_system_time.minute *                  
          60 + base_system_time.second) * 1000;                                                               
                                                                                                              
    day := base_system_time.day + (elapsed_time DIV c$ms_per_day);                                            
    elapsed_time := elapsed_time MOD c$ms_per_day;                                                            
    IF elapsed_time < 0 THEN                                                                                  
      elapsed_time := elapsed_time + c$ms_per_day;                                                            
      day := day - 1;                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    date_time.millisecond := elapsed_time {ms} MOD 1000 {ms} ;                                                
                                                                                                              
    elapsed_time {sec} := elapsed_time {ms} DIV 1000 {ms/sec} ;                                               
    date_time.second := elapsed_time {sec} MOD 60 {sec} ;                                                     
                                                                                                              
    elapsed_time {min} := elapsed_time {sec} DIV 60 {sec/min} ;                                               
    date_time.minute := elapsed_time {min} MOD 60 {min} ;                                                     
                                                                                                              
    elapsed_time {hr} := elapsed_time {min} DIV 60 {min/hr} ;                                                 
    date_time.hour := elapsed_time {hr} MOD 24 {hr} ;                                                         
                                                                                                              
    month := base_system_time.month;                                                                          
    year := base_system_time.year;                                                                            
                                                                                                              
    days_in_the_month [1] := 31;                                                                              
    days_in_the_month [3] := 31;                                                                              
    days_in_the_month [4] := 30;                                                                              
    days_in_the_month [5] := 31;                                                                              
    days_in_the_month [6] := 30;                                                                              
    days_in_the_month [7] := 31;                                                                              
    days_in_the_month [8] := 31;                                                                              
    days_in_the_month [9] := 30;                                                                              
    days_in_the_month [10] := 31;                                                                             
    days_in_the_month [11] := 30;                                                                             
    days_in_the_month [12] := 31;                                                                             
                                                                                                              
    b1 := ((year MOD 4) = 0);                                                                                 
    b2 := ((year MOD 100) <> 0);                                                                              
    b3 := ((year MOD 400) = 0);                                                                               
    this_is_a_leap_year := (b1 AND b2) OR b3;                                                                 
    IF this_is_a_leap_year THEN                                                                               
      days_in_the_month [2] := 29;                                                                            
    ELSE                                                                                                      
      days_in_the_month [2] := 28;                                                                            
    IFEND;                                                                                                    
                                                                                                              
    WHILE day < 1 DO                                                                                          
      IF month = 1 THEN                                                                                       
        month := 13;                                                                                          
        IF (year - 1 {yr} ) < LOWERVALUE (year) THEN                                                          
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        year := year - 1;                                                                                     
        b1 := ((year MOD 4) = 0);                                                                             
        b2 := ((year MOD 100) <> 0);                                                                          
        b3 := ((year MOD 400) = 0);                                                                           
        this_is_a_leap_year := (b1 AND b2) OR b3;                                                             
        IF this_is_a_leap_year THEN                                                                           
          days_in_the_month [2] := 29;                                                                        
        ELSE                                                                                                  
          days_in_the_month [2] := 28;                                                                        
        IFEND;                                                                                                
      IFEND;                                                                                                  
      month := month - 1;                                                                                     
      day := day + days_in_the_month [month];                                                                 
    WHILEND;                                                                                                  
                                                                                                              
    WHILE day > days_in_the_month [month] DO                                                                  
      day := day - days_in_the_month [month];                                                                 
      month := month + 1 {mo} ;                                                                               
      IF month > 12 {mo} THEN                                                                                 
        IF (year + 1 {yr} ) > UPPERVALUE (year) THEN                                                          
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        month := 1 {mo} ;                                                                                     
        year := year + 1 {yr} ;                                                                               
        b1 := ((year MOD 4) = 0);                                                                             
        b2 := ((year MOD 100) <> 0);                                                                          
        b3 := ((year MOD 400) = 0);                                                                           
        this_is_a_leap_year := (b1 AND b2) OR b3;                                                             
        IF this_is_a_leap_year THEN                                                                           
          days_in_the_month [2] := 29;                                                                        
        ELSE                                                                                                  
          days_in_the_month [2] := 28;                                                                        
        IFEND;                                                                                                
      IFEND;                                                                                                  
    WHILEND;                                                                                                  
                                                                                                              
    date_time.day := day;                                                                                     
    date_time.month := month;                                                                                 
    date_time.year := year - 1900;                                                                            
    date_time_found := TRUE;                                                                                  
                                                                                                              
  PROCEND convert_microsecond_clock;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'process_dump', EJECT ??                                                                       
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure opens the restart file, reads the dump file (if necessary) and builds the execution        
{   environment.                                                                                              
                                                                                                              
  PROCEDURE process_dump                                                                                      
    (    allow_modify_restart_file: boolean;                                                                  
     VAR status: ost$status);                                                                                 
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      current_register: 1 .. duc$de_number_of_pro_mrs_dumped,                                                 
      display_control: clt$display_control,                                                                   
      element_p: ^clt$data_value,                                                                             
      file_contains_data: boolean,                                                                            
      file_gfa: array [1 .. 1] of amt$get_item,                                                               
      i: integer,                                                                                             
      ignore_status: ost$status,                                                                              
      list_p: ^clt$data_value,                                                                                
      local_file: boolean,                                                                                    
      old_file: boolean,                                                                                      
      pro_mr_jps_p: ^dut$ee_processor_mr_jps,                                                                 
      pro_mr_mps_p: ^dut$ee_processor_mr_mps,                                                                 
      pro_mr_psm_p: ^dut$ee_processor_mr_psm,                                                                 
      pro_mr_pta_p: ^dut$ee_processor_mr_pta,                                                                 
      pro_mr_ptl_p: ^dut$ee_processor_mr_ptl,                                                                 
      pro_mr_ss_p: ^dut$ee_processor_mr_ss,                                                                   
      processor: 0 .. duc$de_maximum_processors,                                                              
      psm: dut$ee_psm_value,                                                                                  
      pta: dut$ee_pta_value,                                                                                  
      ptl: dut$ee_ptl_value,                                                                                  
      resolved_file_references_p: ^array [1 .. * ] of fst$resolved_file_reference,                            
      restart_file_count: integer,                                                                            
      restart_files_p: ^array [1 .. * ] of ^fst$file_reference,                                               
      ring_attributes: amt$ring_attributes;                                                                   
                                                                                                              
?? NEWTITLE := 'p$open_restart_files', EJECT ??                                                               
                                                                                                              
{ Open and Validate the restart file(s)                                                                       
                                                                                                              
    PROCEDURE p$open_restart_files                                                                            
      (    restart_files: {input/output} array [1 .. * ] of ^fst$file_reference;                              
           allow_modify: boolean;                                                                             
       VAR status: ost$status);                                                                               
                                                                                                              
      TYPE                                                                                                    
        t$restart_infos = array [1 .. * ] of t$restart_info,                                                  
        t$restart_info = record                                                                               
          revision_level: integer,                                                                            
          dump_environment_p: ^dut$dump_environment,                                                          
          sub_revision_level: 0 .. 0ff(16),                                                                   
          file_number: integer,                                                                               
          file_count: integer,                                                                                
          identifier: integer,                                                                                
        recend;                                                                                               
                                                                                                              
      TYPE                                                                                                    
        t$restart_file_index = 1 .. duc$maximum_restart_files,                                                
        t$restart_file_indexes = set of t$restart_file_index;                                                 
                                                                                                              
      VAR                                                                                                     
        fa_p: ^fst$attachment_options,                                                                        
        file_contains_data: boolean,                                                                          
        file_gfa: array [1 .. 1] of amt$get_item,                                                             
        i: integer,                                                                                           
        local_file: boolean,                                                                                  
        old_file: boolean,                                                                                    
        restart_file_indexes: t$restart_file_indexes,                                                         
        restart_info_p: ^t$restart_infos;                                                                     
                                                                                                              
?? NEWTITLE := 'p$get_restart_info', EJECT ??                                                                 
                                                                                                              
      PROCEDURE p$get_restart_info                                                                            
        (    restart_file_p: ^SEQ ( * );                                                                      
         VAR restart_info: t$restart_info;                                                                    
         VAR status: ost$status);                                                                             
                                                                                                              
        VAR                                                                                                   
          file_ok: boolean,                                                                                   
          i_p: ^integer,                                                                                      
          restart_identifier_p: ^dut$de_restart_identifier,                                                   
          seq_p: ^SEQ ( * );                                                                                  
                                                                                                              
        seq_p := restart_file_p;                                                                              
        file_ok := FALSE;                                                                                     
                                                                                                              
        NEXT i_p IN seq_p;                                                                                    
        IF i_p = NIL THEN                                                                                     
          osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                        
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        restart_identifier_p := NIL;                                                                          
        restart_info.dump_environment_p := NIL;                                                               
        IF i_p^ = duc$revision_level_old THEN                                                                 
          file_ok := TRUE;                                                                                    
          restart_info.revision_level := duc$revision_level_old;                                              
          restart_info.sub_revision_level := 1;                                                               
          restart_info.file_number := 1;                                                                      
          restart_info.file_count := 1;                                                                       
          restart_info.identifier := 0;                                                                       
                                                                                                              
          seq_p := restart_file_p;                                                                            
          NEXT restart_info.dump_environment_p IN seq_p;                                                      
          IF restart_info.dump_environment_p = NIL THEN                                                       
            osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                      
          IFEND;                                                                                              
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        restart_info.revision_level := i_p^ DIV 100(16);                                                      
        restart_info.sub_revision_level := i_p^ MOD 100(16);                                                  
        IF restart_info.revision_level = duc$revision_level THEN                                              
          CASE restart_info.sub_revision_level OF                                                             
          = 1 =                                                                                               
            file_ok := TRUE;                                                                                  
            seq_p := restart_file_p;                                                                          
            NEXT restart_info.dump_environment_p IN seq_p;                                                    
            IF restart_info.dump_environment_p = NIL THEN                                                     
              osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                    
              RETURN; {----->                                                                                 
            IFEND;                                                                                            
                                                                                                              
            restart_identifier_p := ^restart_info.dump_environment_p^.restart_identifier;                     
                                                                                                              
          = 2 =                                                                                               
            file_ok := TRUE;                                                                                  
            NEXT restart_identifier_p IN seq_p;                                                               
            IF restart_identifier_p = NIL THEN                                                                
              osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                    
              RETURN; {----->                                                                                 
            IFEND;                                                                                            
          ELSE                                                                                                
            ;                                                                                                 
          CASEND;                                                                                             
        IFEND;                                                                                                
                                                                                                              
        IF NOT file_ok THEN                                                                                   
          osp$set_status_abnormal (duc$dump_analyzer_id, due$revision_level_mismatch,                         
                'WARNING - Restart file incompatible with current revision level of Analyze_Dump -- ' CAT     
                'Dump must be re-read from tape.', status);                                                   
          dup$display_message (status, display_control);                                                      
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        restart_info.file_number := restart_identifier_p^.file_number;                                        
        restart_info.file_count := restart_identifier_p^.file_count;                                          
        restart_info.identifier := restart_identifier_p^.identifier;                                          
                                                                                                              
      PROCEND p$get_restart_info;                                                                             
?? OLDTITLE ??                                                                                                
?? EJECT ??                                                                                                   
                                                                                                              
      file_gfa [1].key := amc$file_processor;                                                                 
                                                                                                              
{ Setup the open file parameters.                                                                             
      PUSH fa_p: [1 .. 3];                                                                                    
      fa_p^ [1].selector := fsc$access_and_share_modes;                                                       
      fa_p^ [1].access_modes.selector := fsc$specific_access_modes;                                           
      IF allow_modify THEN                                                                                    
        fa_p^ [1].access_modes.value := $fst$file_access_options [fsc$read, fsc$modify];                      
      ELSE                                                                                                    
        fa_p^ [1].access_modes.value := $fst$file_access_options [fsc$read];                                  
      IFEND;                                                                                                  
      fa_p^ [1].share_modes.selector := fsc$determine_from_access_modes;                                      
      fa_p^ [2].selector := fsc$create_file;                                                                  
      fa_p^ [2].create_file := FALSE;                                                                         
      fa_p^ [3].selector := fsc$open_position;                                                                
      fa_p^ [3].open_position := amc$open_at_boi;                                                             
                                                                                                              
      PUSH restart_info_p: [1 .. UPPERBOUND (restart_files)];                                                 
                                                                                                              
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        amp$get_file_attributes (restart_files [i]^, file_gfa, local_file, old_file, file_contains_data,      
              status);                                                                                        
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        IF NOT file_contains_data THEN                                                                        
          osp$set_status_abnormal (duc$dump_analyzer_id, due$file_empty, restart_files [i]^, status);         
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        fsp$open_file (restart_files [i]^, amc$segment, fa_p, NIL, NIL, NIL, NIL,                             
              duv$execution_environment.restart_files [i].file_identifier, status);                           
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        duv$execution_environment.restart_files [i].opened := TRUE;                                           
        amp$get_segment_pointer (duv$execution_environment.restart_files [i].file_identifier,                 
              amc$sequence_pointer, duv$execution_environment.restart_files [i].segment_pointer, status);     
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
        RESET duv$execution_environment.restart_files [i].segment_pointer.sequence_pointer;                   
                                                                                                              
        p$get_restart_info (duv$execution_environment.restart_files [i].segment_pointer.sequence_pointer,     
              restart_info_p^ [i], status);                                                                   
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
      FOREND;                                                                                                 
                                                                                                              
{Verify restart info and setup environment                                                                    
      restart_file_indexes := $t$restart_file_indexes [];                                                     
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        restart_file_indexes := restart_file_indexes + $t$restart_file_indexes [i];                           
      FOREND;                                                                                                 
                                                                                                              
      IF restart_file_indexes = $t$restart_file_indexes [] THEN                                               
        osp$set_status_abnormal (duc$dump_analyzer_id, due$internal_error, 'No Restart File found.', status); 
        RETURN; {----->                                                                                       
      IFEND;                                                                                                  
                                                                                                              
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        IF (restart_info_p^ [i].identifier <> restart_info_p^ [1].identifier)                                 
{     } OR (restart_info_p^ [i].revision_level <> restart_info_p^ [1].revision_level)                         
{     } OR (restart_info_p^ [i].file_count <> restart_info_p^ [1].file_count)                                 
{     } OR (restart_info_p^ [i].file_number <> restart_info_p^ [i].sub_revision_level)                        
{     } OR NOT (i IN restart_file_indexes) THEN                                                               
                                                                                                              
          osp$set_status_abnormal (duc$dump_analyzer_id, due$improper_file_combination, '', status);          
          RETURN; {----->                                                                                     
                                                                                                              
        ELSEIF (restart_info_p^ [i].file_count <> UPPERBOUND (restart_files)) THEN                            
          osp$set_status_abnormal (duc$dump_analyzer_id, due$not_all_files_specified, '', status);            
          RETURN; {----->                                                                                     
        IFEND;                                                                                                
                                                                                                              
        IF restart_info_p^ [i].file_number = 1 THEN                                                           
          duv$dump_environment_p := restart_info_p^ [i].dump_environment_p;                                   
          duv$execution_environment.data_file_p := ^duv$execution_environment.restart_files [i];              
        IFEND;                                                                                                
                                                                                                              
        IF (restart_info_p^ [i].file_count = 1) OR (restart_info_p^ [i].file_number > 1) THEN                 
          duv$execution_environment.memory_file_p := ^duv$execution_environment.restart_files [i];            
        IFEND;                                                                                                
                                                                                                              
        restart_file_indexes := restart_file_indexes - $t$restart_file_indexes [i];                           
      FOREND;                                                                                                 
                                                                                                              
      IF (restart_file_indexes <> $t$restart_file_indexes [])                                                 
{   } OR (duv$execution_environment.memory_file_p = NIL)                                                      
{   } OR (duv$execution_environment.data_file_p = NIL) THEN                                                   
        osp$set_status_abnormal (duc$dump_analyzer_id, due$improper_file_combination, '', status);            
        RETURN; {----->                                                                                       
      IFEND;                                                                                                  
                                                                                                              
    PROCEND p$open_restart_files;                                                                             
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'p$read_dump_file', EJECT ??                                                                   
                                                                                                              
{ Read the dump file to the restart file(s) and build the dump environment on the restart file(s).            
                                                                                                              
    PROCEDURE p$read_dump_file                                                                                
      (    dump_file_p: ^fst$file_reference;                                                                  
       VAR restart_files: {input/output} array [1 .. * ] of ^fst$file_reference;                              
       VAR resolved_file_references: array [1 .. * ] of fst$resolved_file_reference;                          
       VAR status: ost$status);                                                                               
                                                                                                              
      VAR                                                                                                     
        fa_p: ^fst$attachment_options,                                                                        
        i: integer,                                                                                           
        ignore_size: fst$user_defined_attribute_size,                                                         
        mca_p: ^fst$file_cycle_attributes;                                                                    
                                                                                                              
{ Setup the open file parameters.                                                                             
      PUSH fa_p: [1 .. 4];                                                                                    
      fa_p^ [1].selector := fsc$access_and_share_modes;                                                       
      fa_p^ [1].access_modes.selector := fsc$specific_access_modes;                                           
      fa_p^ [1].access_modes.value := $fst$file_access_options                                                
            [fsc$read, fsc$shorten, fsc$append, fsc$modify];                                                  
      fa_p^ [1].share_modes.selector := fsc$determine_from_access_modes;                                      
      fa_p^ [2].selector := fsc$open_share_modes;                                                             
      fa_p^ [2].open_share_modes := $fst$file_access_options [];                                              
      fa_p^ [3].selector := fsc$create_file;                                                                  
      fa_p^ [3].create_file := TRUE;                                                                          
      fa_p^ [4].selector := fsc$open_position;                                                                
      fa_p^ [4].open_position := amc$open_at_boi;                                                             
                                                                                                              
      PUSH mca_p: [1 .. 1];                                                                                   
      mca_p^ [1].selector := fsc$file_contents_and_processor;                                                 
      mca_p^ [1].file_processor := c$file_processor;                                                          
                                                                                                              
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        IF UPPERBOUND (restart_files) = 1 THEN                                                                
          mca_p^ [1].file_contents := 'RESTART_FILE';                                                         
        ELSE                                                                                                  
          mca_p^ [1].file_contents := 'RESTART_FILE_';                                                        
          mca_p^ [1].file_contents (14) := $CHAR ($INTEGER ('0') + i);                                        
        IFEND;                                                                                                
                                                                                                              
        fsp$open_file (restart_files [i]^, amc$segment, fa_p, NIL, mca_p, NIL, NIL,                           
              duv$execution_environment.restart_files [i].file_identifier, status);                           
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        duv$execution_environment.restart_files [i].opened := TRUE;                                           
        amp$get_segment_pointer (duv$execution_environment.restart_files [i].file_identifier,                 
              amc$sequence_pointer, duv$execution_environment.restart_files [i].segment_pointer, status);     
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        RESET duv$execution_environment.restart_files [i].segment_pointer.sequence_pointer;                   
      FOREND;                                                                                                 
                                                                                                              
{Overwrite the SCL restart file reference by the resolved one (incl. the cycle). So, the second open          
{does not get confused by a $next.                                                                            
                                                                                                              
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        fsp$get_open_information (duv$execution_environment.restart_files [i].file_identifier, NIL, NIL, NIL, 
              NIL, NIL, ^resolved_file_references [i], NIL, ignore_size, status);                             
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
                                                                                                              
        restart_files [i] := ^resolved_file_references [i].path                                               
              (1, resolved_file_references [i].cycle_path_size);                                              
      FOREND;                                                                                                 
                                                                                                              
      dup$read_dump_file (dump_file_p, UPPERBOUND (restart_files), status);                                   
      IF NOT status.normal THEN                                                                               
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
                                                                                                              
      FOR i := 1 TO UPPERBOUND (restart_files) DO                                                             
        fsp$close_file (duv$execution_environment.restart_files [i].file_identifier, ignore_status);          
        duv$execution_environment.restart_files [i].opened := FALSE;                                          
        duv$execution_environment.restart_files [i].file_identifier := amv$nil_file_identifier;               
      FOREND;                                                                                                 
                                                                                                              
    PROCEND p$read_dump_file;                                                                                 
?? OLDTITLE ??                                                                                                
?? EJECT ??                                                                                                   
                                                                                                              
    status.normal := TRUE;                                                                                    
    resolved_file_references_p := NIL;                                                                        
                                                                                                              
{ Open the output file.                                                                                       
    ring_attributes.r1 := #RING (^ring_attributes);                                                           
    ring_attributes.r2 := #RING (^ring_attributes);                                                           
    ring_attributes.r3 := #RING (^ring_attributes);                                                           
    duv$execution_environment.output_file.name := pvt [p$output].value^.file_value^;                          
    duv$execution_environment.output_file.size := #SIZE (pvt [p$output].value^.file_value^);                  
    clp$open_display_reference (pvt [p$output].value^.file_value^, ^dup$new_page_procedure, fsc$list,         
          ring_attributes, duv$execution_environment.output_file.display_control, status);                    
    IF NOT status.normal THEN                                                                                 
      RETURN; {---->                                                                                          
    IFEND;                                                                                                    
    duv$execution_environment.output_file_opened := TRUE;                                                     
                                                                                                              
    display_control := duv$execution_environment.output_file.display_control;                                 
    display_control.line_number := display_control.page_length + 1;                                           
                                                                                                              
{ Retrieve the processing options.                                                                            
    IF pvt [p$processing_options].value^.keyword_value = 'ALL_MEMORY' THEN                                    
      duv$execution_environment.processing_options := duc$ee_po_all_memory;                                   
    ELSEIF pvt [p$processing_options].value^.keyword_value = 'CRITICAL_MEMORY' THEN                           
      duv$execution_environment.processing_options := duc$ee_po_critical_memory;                              
    ELSE { no memory }                                                                                        
      duv$execution_environment.processing_options := duc$ee_po_no_memory;                                    
    IFEND;                                                                                                    
                                                                                                              
{ Retrieve the main title.                                                                                    
    IF pvt [p$title].specified THEN                                                                           
      duv$title_data.main_title := pvt [p$title].value^.string_value^;                                        
    ELSE                                                                                                      
      duv$title_data.main_title := duc$version;                                                               
    IFEND;                                                                                                    
                                                                                                              
{ Open the debug table.                                                                                       
    IF pvt [p$debug_table].value^.kind = clc$keyword THEN                                                     
      IF pvt [p$debug_table].value^.keyword_value = 'RUNNING_SYSTEM' THEN                                     
        ocp$open_running_debug_table (status);                                                                
        IF NOT status.normal THEN                                                                             
          RETURN; {---->                                                                                      
        IFEND;                                                                                                
      IFEND;                                                                                                  
    ELSE                                                                                                      
      ocp$open_linker_debug_table (pvt [p$debug_table].value^.file_value^, status);                           
      IF NOT status.normal THEN                                                                               
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
    IFEND;                                                                                                    
                                                                                                              
{ Determine if the restart file parameter is correctly used.                                                  
    list_p := pvt [p$restart_file].value;                                                                     
    restart_file_count := clp$count_list_elements (list_p);                                                   
    PUSH restart_files_p: [1 .. restart_file_count];                                                          
    i := 0;                                                                                                   
                                                                                                              
    WHILE (list_p <> NIL) AND (list_p^.kind = clc$list) DO                                                    
      i := i + 1;                                                                                             
      element_p := list_p^.element_value;                                                                     
      list_p := list_p^.link;                                                                                 
      IF (element_p <> NIL) AND (element_p^.kind = clc$file) AND (element_p^.file_value <> NIL) THEN          
        restart_files_p^ [i] := element_p^.file_value;                                                        
      ELSE                                                                                                    
        osp$set_status_abnormal (duc$dump_analyzer_id, due$internal_error, 'Improper Restart File Parameter', 
              status);                                                                                        
        RETURN; {----->                                                                                       
      IFEND;                                                                                                  
    WHILEND;                                                                                                  
                                                                                                              
    FOR i := 1 TO restart_file_count DO                                                                       
      file_gfa [1].key := amc$file_processor;                                                                 
      amp$get_file_attributes (restart_files_p^ [i]^, file_gfa, local_file, old_file, file_contains_data,     
            status);                                                                                          
      IF NOT status.normal THEN                                                                               
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
                                                                                                              
      IF NOT pvt [p$dump_file].specified AND NOT old_file THEN                                                
        osp$set_status_abnormal (duc$dump_analyzer_id, due$file_empty, restart_files_p^ [i]^, status);        
        dup$display_message (status, display_control);                                                        
        status.normal := TRUE;                                                                                
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
                                                                                                              
      IF pvt [p$dump_file].specified AND old_file AND (file_gfa [1].file_processor <> c$file_processor) THEN  
        osp$set_status_abnormal (duc$dump_analyzer_id, due$overwriting_wrong_file, restart_files_p^ [i]^,     
              status);                                                                                        
        osp$append_status_parameter (osc$status_parameter_delimiter, 'restart', status);                      
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
                                                                                                              
      IF NOT pvt [p$dump_file].specified AND (file_gfa [1].file_processor <> c$file_processor) THEN           
        osp$set_status_abnormal (duc$dump_analyzer_id, due$improper_file_attributes, restart_files_p^ [i]^,   
              status);                                                                                        
        osp$append_status_parameter (osc$status_parameter_delimiter, 'restart', status);                      
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
    IF pvt [p$dump_file].specified THEN                                                                       
      PUSH resolved_file_references_p: [1 .. restart_file_count];                                             
      p$read_dump_file (pvt [p$dump_file].value^.file_value, restart_files_p^, resolved_file_references_p^,   
            status);                                                                                          
      IF NOT status.normal THEN                                                                               
        RETURN; {---->                                                                                        
      IFEND;                                                                                                  
    IFEND;                                                                                                    
                                                                                                              
    p$open_restart_files (restart_files_p^, allow_modify_restart_file, status);                               
    IF NOT status.normal THEN                                                                                 
      RETURN; {---->                                                                                          
    IFEND;                                                                                                    
                                                                                                              
{ Retrieve the processor register values from the dump environment data.                                      
    psm.value := 0;                                                                                           
    pta.value := 0;                                                                                           
    ptl.value := 0;                                                                                           
    FOR processor := 0 TO duc$de_maximum_processors DO                                                        
      duv$execution_environment.processor_registers [processor].available :=                                  
            duv$dump_environment_p^.pro_maintenance_registers [processor].available;                          
      duv$execution_environment.processor_registers [processor].status_summary.general :=                     
            $dut$ee_pro_general_ss_set [];                                                                    
      duv$execution_environment.processor_registers [processor].job_process_state := 0;                       
      duv$execution_environment.processor_registers [processor].monitor_process_state := 0;                   
      duv$execution_environment.processor_registers [processor].page_size_mask := psm.psm;                    
      duv$execution_environment.processor_registers [processor].page_table_address := pta.pta;                
      duv$execution_environment.processor_registers [processor].page_table_length := ptl.ptl;                 
                                                                                                              
     /find_registers/                                                                                         
      FOR current_register := 1 to duc$de_number_of_pro_mrs_dumped DO                                         
        IF NOT duv$dump_environment_p^.pro_maintenance_registers [processor].                                 
              registers [current_register].available THEN                                                     
          EXIT /find_registers/;  {---->                                                                      
        IFEND;                                                                                                
        cell_p := ^duv$dump_environment_p^.pro_maintenance_registers [processor].                             
              registers [current_register].value;                                                             
        CASE duv$dump_environment_p^.pro_maintenance_registers [processor].                                   
              registers [current_register].number OF                                                          
        = c$processor_status_summary =                                                                        
          pro_mr_ss_p := cell_p;                                                                              
          duv$execution_environment.processor_registers [processor].status_summary := pro_mr_ss_p^.value;     
        = osc$pr_job_process_state =                                                                          
          pro_mr_jps_p := cell_p;                                                                             
          duv$execution_environment.processor_registers [processor].job_process_state := pro_mr_jps_p^.value; 
        = osc$pr_monitor_process_state =                                                                      
          pro_mr_mps_p := cell_p;                                                                             
          duv$execution_environment.processor_registers [processor].monitor_process_state :=                  
                pro_mr_mps_p^.value;                                                                          
        = osc$pr_page_size_mask =                                                                             
          pro_mr_psm_p := cell_p;                                                                             
          duv$execution_environment.processor_registers [processor].page_size_mask := pro_mr_psm_p^.value;    
        = osc$pr_page_table_address =                                                                         
          pro_mr_pta_p := cell_p;                                                                             
          duv$execution_environment.processor_registers [processor].page_table_address := pro_mr_pta_p^.value;
        = osc$pr_page_table_length =                                                                          
          pro_mr_ptl_p := cell_p;                                                                             
          duv$execution_environment.processor_registers [processor].page_table_length := pro_mr_ptl_p^.value; 
        ELSE                                                                                                  
        CASEND;                                                                                               
      FOREND /find_registers/;                                                                                
    FOREND;                                                                                                   
                                                                                                              
  PROCEND process_dump;                                                                                       
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'retrieve_base_system_time', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure attempts to retrieve the base system time from memory.                                     
                                                                                                              
  PROCEDURE retrieve_base_system_time                                                                         
    (VAR base_system_time_found: boolean;                                                                     
     VAR base_system_time: ost$base_system_time);                                                             
                                                                                                              
    TYPE                                                                                                      
      t$string_or_record = RECORD                                                                             
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          string_part: string (13),                                                                           
        = FALSE =                                                                                             
          record_part: ost$base_system_time,                                                                  
        CASEND,                                                                                               
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      bl_string_header_p: ^clt$type_specification_header,                                                     
      bl_string_type_p: ^clt$string_type_qualifier,                                                           
      bl_string_type_seq_p: ^SEQ ( * ),                                                                       
      bl_variable_p: ^clt$data_value,                                                                         
      bst_or_string: t$bst_or_string,                                                                         
      ignore_status: ost$status,                                                                              
      local_status: ost$status,                                                                               
      string_or_record: t$string_or_record;                                                                   
                                                                                                              
    base_system_time_found := FALSE;                                                                          
                                                                                                              
    PUSH bl_string_type_seq_p: [[REP (#SIZE (clt$type_specification_header) +                                 
          #SIZE (clt$string_type_qualifier)) OF cell]];                                                       
    RESET bl_string_type_seq_p;                                                                               
    NEXT bl_string_header_p IN bl_string_type_seq_p;                                                          
    bl_string_header_p^.version := clc$declaration_version;                                                   
    bl_string_header_p^.name_size := 0;                                                                       
    bl_string_header_p^.kind := clc$string_type;                                                              
    NEXT bl_string_type_p IN bl_string_type_seq_p;                                                            
    bl_string_type_p^.min_string_size := 13;                                                                  
    bl_string_type_p^.max_string_size := 13;                                                                  
    bl_string_type_p^.literal := FALSE;                                                                       
    RESET bl_string_type_seq_p;                                                                               
                                                                                                              
    PUSH bl_variable_p;                                                                                       
    bl_variable_p^.kind := clc$string;                                                                        
    PUSH bl_variable_p^.string_value: [13];                                                                   
    bl_variable_p^.string_value^ := ' ';                                                                      
                                                                                                              
    clp$create_procedure_variable ('DUV$BST', clc$xdcl_scope, clc$read_write, clc$immediate_evaluation,       
          bl_string_type_seq_p, bl_variable_p, local_status);                                                 
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$include_line ('duv$bst=$memory_string($symbol_address(osv$base_system_time), 13, active, 0, pva)',    
          FALSE, osc$null_name, local_status);                                                                
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$get_variable_value ('DUV$BST', bl_variable_p, local_status);                                          
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    string_or_record.string_part := bl_variable_p^.string_value^;                                             
    bst_or_string.string_part := ' ';                                                                         
    clp$convert_integer_to_rjstring (string_or_record.record_part.second, 10, FALSE, '0',                     
          bst_or_string.bst_part.second, ignore_status);                                                      
    clp$convert_integer_to_rjstring (string_or_record.record_part.minute, 10, FALSE, '0',                     
          bst_or_string.bst_part.minute, ignore_status);                                                      
    clp$convert_integer_to_rjstring (string_or_record.record_part.hour, 10, FALSE, '0',                       
          bst_or_string.bst_part.hour, ignore_status);                                                        
    clp$convert_integer_to_rjstring (string_or_record.record_part.day, 10, FALSE, '0',                        
          bst_or_string.bst_part.day, ignore_status);                                                         
    clp$convert_integer_to_rjstring (string_or_record.record_part.month, 10, FALSE, '0',                      
          bst_or_string.bst_part.month, ignore_status);                                                       
    clp$convert_integer_to_rjstring (string_or_record.record_part.year, 10, FALSE, '0',                       
          bst_or_string.bst_part.year, ignore_status);                                                        
    bst_or_string.bst_part.colon_1 := ':';                                                                    
    bst_or_string.bst_part.colon_2 := ':';                                                                    
    bst_or_string.bst_part.period_1 := '.';                                                                   
    bst_or_string.bst_part.period_2 := '.';                                                                   
                                                                                                              
    duv$title_data.base_system_time := bst_or_string.string_part;                                             
    base_system_time_found := TRUE;                                                                           
    base_system_time := string_or_record.record_part;                                                         
                                                                                                              
    clp$delete_variable ('DUV$BST', local_status);                                                            
                                                                                                              
  PROCEND retrieve_base_system_time;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'retrieve_build_level', EJECT ??                                                               
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure attempts to retrieve the build level from memory.                                          
                                                                                                              
  PROCEDURE retrieve_build_level;                                                                             
                                                                                                              
    VAR                                                                                                       
      bl_string_header_p: ^clt$type_specification_header,                                                     
      bl_string_type_p: ^clt$string_type_qualifier,                                                           
      bl_string_type_seq_p: ^SEQ ( * ),                                                                       
      bl_variable_p: ^clt$data_value,                                                                         
      control_codes_to_space: [STATIC, READ] string (256) := '                                 '              
            CAT '!"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm'              
            CAT 'nopqrstuvwxyz{|}~                                                             '              
            CAT '                                                                    ',                       
      local_status: ost$status;                                                                               
                                                                                                              
    PUSH bl_string_type_seq_p: [[REP (#SIZE (clt$type_specification_header) +                                 
          #SIZE (clt$string_type_qualifier)) OF cell]];                                                       
    RESET bl_string_type_seq_p;                                                                               
    NEXT bl_string_header_p IN bl_string_type_seq_p;                                                          
    bl_string_header_p^.version := clc$declaration_version;                                                   
    bl_string_header_p^.name_size := 0;                                                                       
    bl_string_header_p^.kind := clc$string_type;                                                              
    NEXT bl_string_type_p IN bl_string_type_seq_p;                                                            
    bl_string_type_p^.min_string_size := 31;                                                                  
    bl_string_type_p^.max_string_size := 31;                                                                  
    bl_string_type_p^.literal := FALSE;                                                                       
    RESET bl_string_type_seq_p;                                                                               
                                                                                                              
    PUSH bl_variable_p;                                                                                       
    bl_variable_p^.kind := clc$string;                                                                        
    PUSH bl_variable_p^.string_value: [31];                                                                   
    bl_variable_p^.string_value^ := ' ';                                                                      
                                                                                                              
    clp$create_procedure_variable ('DUV$BL', clc$xdcl_scope, clc$read_write, clc$immediate_evaluation,        
          bl_string_type_seq_p, bl_variable_p, local_status);                                                 
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$include_line ('duv$bl=$memory_string($symbol_address(osv$build_level), 31, active, 0, pva)', FALSE,   
          osc$null_name, local_status);                                                                       
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$get_variable_value ('DUV$BL', bl_variable_p, local_status);                                           
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    #TRANSLATE (control_codes_to_space, bl_variable_p^.string_value^, duv$title_data.system_level);           
                                                                                                              
    clp$delete_variable ('DUV$BL', local_status);                                                             
                                                                                                              
  PROCEND retrieve_build_level;                                                                               
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'retrieve_termination_time', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure attempts to retrieve the termination time from memory.                                     
                                                                                                              
  PROCEDURE retrieve_termination_time                                                                         
    (    base_system_time: ost$base_system_time);                                                             
                                                                                                              
    TYPE                                                                                                      
      t$string_or_integer = RECORD                                                                            
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          string_part: string (8),                                                                            
        = FALSE =                                                                                             
          integer_part: integer,                                                                              
        CASEND,                                                                                               
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      bl_string_header_p: ^clt$type_specification_header,                                                     
      bl_string_type_p: ^clt$string_type_qualifier,                                                           
      bl_string_type_seq_p: ^SEQ ( * ),                                                                       
      bl_variable_p: ^clt$data_value,                                                                         
      bst_or_string: t$bst_or_string,                                                                         
      date_time: ost$date_time,                                                                               
      date_time_found: boolean,                                                                               
      ignore_status: ost$status,                                                                              
      local_status: ost$status,                                                                               
      string_or_integer: t$string_or_integer,                                                                 
      year: 0 .. 0ffff(16);                                                                                   
                                                                                                              
    PUSH bl_string_type_seq_p: [[REP (#SIZE (clt$type_specification_header) +                                 
          #SIZE (clt$string_type_qualifier)) OF cell]];                                                       
    RESET bl_string_type_seq_p;                                                                               
    NEXT bl_string_header_p IN bl_string_type_seq_p;                                                          
    bl_string_header_p^.version := clc$declaration_version;                                                   
    bl_string_header_p^.name_size := 0;                                                                       
    bl_string_header_p^.kind := clc$string_type;                                                              
    NEXT bl_string_type_p IN bl_string_type_seq_p;                                                            
    bl_string_type_p^.min_string_size := 8;                                                                   
    bl_string_type_p^.max_string_size := 8;                                                                   
    bl_string_type_p^.literal := FALSE;                                                                       
    RESET bl_string_type_seq_p;                                                                               
                                                                                                              
    PUSH bl_variable_p;                                                                                       
    bl_variable_p^.kind := clc$string;                                                                        
    PUSH bl_variable_p^.string_value: [8];                                                                    
    bl_variable_p^.string_value^ := ' ';                                                                      
                                                                                                              
    clp$create_procedure_variable ('DUV$TT', clc$xdcl_scope, clc$read_write, clc$immediate_evaluation,        
          bl_string_type_seq_p, bl_variable_p, local_status);                                                 
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$include_line ('duv$tt=$memory_string($symbol_address(mtv$trace_buffer), 8, active, 0, pva)',          
          FALSE, osc$null_name, local_status);                                                                
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    clp$get_variable_value ('DUV$TT', bl_variable_p, local_status);                                           
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    string_or_integer.string_part := bl_variable_p^.string_value^;                                            
                                                                                                              
    convert_microsecond_clock (string_or_integer.integer_part, base_system_time, date_time,                   
          date_time_found);                                                                                   
    IF NOT date_time_found THEN                                                                               
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    bst_or_string.string_part := ' ';                                                                         
    clp$convert_integer_to_rjstring (date_time.second, 10, FALSE, '0', bst_or_string.bst_part.second,         
          ignore_status);                                                                                     
    clp$convert_integer_to_rjstring (date_time.minute, 10, FALSE, '0', bst_or_string.bst_part.minute,         
          ignore_status);                                                                                     
    clp$convert_integer_to_rjstring (date_time.hour, 10, FALSE, '0', bst_or_string.bst_part.hour,             
          ignore_status);                                                                                     
    clp$convert_integer_to_rjstring (date_time.day, 10, FALSE, '0', bst_or_string.bst_part.day,               
          ignore_status);                                                                                     
    clp$convert_integer_to_rjstring (date_time.month, 10, FALSE, '0', bst_or_string.bst_part.month,           
          ignore_status);                                                                                     
    year := 1900 + date_time.year;                                                                            
    clp$convert_integer_to_rjstring (year, 10, FALSE, '0', bst_or_string.bst_part.year, ignore_status);       
    bst_or_string.bst_part.colon_1 := ':';                                                                    
    bst_or_string.bst_part.colon_2 := ':';                                                                    
    bst_or_string.bst_part.period_1 := '.';                                                                   
    bst_or_string.bst_part.period_2 := '.';                                                                   
                                                                                                              
    duv$title_data.termination_time := bst_or_string.string_part;                                             
                                                                                                              
    clp$delete_variable ('DUV$TT', local_status);                                                             
                                                                                                              
  PROCEND retrieve_termination_time;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$get_bytes', EJECT ??                                                                      
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure ???                                                                                        
{ NOTE:                                                                                                       
{   This procedure is located in this module to make sure it gets loaded and linked with analyze_dump rather  
{   than the version with the same name that performs the same function in the context of Analyze System.     
                                                                                                              
  PROCEDURE [XDCL, #GATE] dup$get_bytes                                                                       
    (    source: ost$pva;                                                                                     
         input_destination_p: ^cell;                                                                          
         length: 0 .. 7fffffff(16);                                                                           
     VAR status: ost$status);                                                                                 
                                                                                                              
    VAR                                                                                                       
      access_data: dut$access_data,                                                                           
      bytes_copied: ost$segment_length,                                                                       
      destination_p: ^SEQ ( * ),                                                                              
      exchange_package_p: ^dut$exchange_package,                                                              
      exchange_parameter: clt$data_value,                                                                     
      ignore_status: ost$status,                                                                              
      integer_value: clt$integer,                                                                             
      processor: 0 .. duc$de_maximum_processors;                                                              
                                                                                                              
    status.normal := TRUE;                                                                                    
                                                                                                              
    IF (source.ring = osc$invalid_ring) THEN {local address flag}                                             
      i#move (#ADDRESS (osc$min_ring, source.seg, source.offset), input_destination_p, length);               
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    i#build_adaptable_seq_pointer (#RING (input_destination_p), #SEGMENT (input_destination_p),               
          #OFFSET (input_destination_p), length, 0, destination_p);                                           
                                                                                                              
    IF duv$default_parameters^.value [duc$dp_processor].default_set THEN                                      
      clp$convert_string_to_integer (duv$default_parameters^.value [duc$dp_processor].value, integer_value,   
            ignore_status);                                                                                   
      processor := integer_value.value;                                                                       
    ELSE                                                                                                      
      processor := 0;                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF (duv$default_parameters^.value [duc$dp_exchange].value = 'ACTIVE') OR                                  
          (duv$default_parameters^.value [duc$dp_exchange].value = 'MONITOR') OR                              
          (duv$default_parameters^.value [duc$dp_exchange].value = 'JOB') THEN                                
      exchange_parameter.kind := clc$keyword;                                                                 
      exchange_parameter.keyword_value := duv$default_parameters^.value [duc$dp_exchange].value;              
    ELSE                                                                                                      
      exchange_parameter.kind := clc$integer;                                                                 
      clp$convert_string_to_integer (duv$default_parameters^.value [duc$dp_exchange].value, integer_value,    
            ignore_status);                                                                                   
      exchange_parameter.integer_value.value := integer_value.value;                                          
    IFEND;                                                                                                    
                                                                                                              
    dup$retrieve_exchange_package (processor, exchange_parameter, exchange_package_p, status);                
    IF NOT status.normal THEN                                                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF length > 0 THEN                                                                                        
      dup$copy_virtual_memory_pva (source, exchange_package_p^, processor, length, FALSE, bytes_copied,       
            destination_p, access_data, status);                                                              
      IF NOT status.normal THEN                                                                               
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF access_data.page_fault AND NOT access_data.memory_found THEN                                         
        osp$set_status_abnormal (duc$dump_analyzer_id, due$soft_page_fault, '', status);                      
        osp$append_status_parameter (osc$status_parameter_delimiter, ', segment = ', status);                 
        osp$append_status_integer (osc$status_parameter_delimiter, source.seg, 16, TRUE, status);             
        osp$append_status_parameter (osc$status_parameter_delimiter, ', offset = ', status);                  
        osp$append_status_integer (osc$status_parameter_delimiter, access_data.page_fault_offset, 16, TRUE,   
              status);                                                                                        
      IFEND;                                                                                                  
    IFEND;                                                                                                    
                                                                                                              
  PROCEND dup$get_bytes;                                                                                      
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$analyze_dump_command', EJECT ??                                                           
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure is the starting program for the analyze_dump utility.                                      
                                                                                                              
  PROGRAM dup$analyze_dump_command                                                                            
    (    parameter_list: clt$parameter_list;                                                                  
     VAR status: ost$status);                                                                                 
                                                                                                              
    VAR                                                                                                       
      base_system_time: ost$base_system_time,                                                                 
      base_system_time_found: boolean,                                                                        
      exit_conditions: [STATIC] pmt$condition := [pmc$block_exit_processing,                                  
            $pmt$block_exit_reason [pmc$block_exit, pmc$program_termination, pmc$program_abort]],             
      exit_descriptor: pmt$established_handler,                                                               
      i: integer,                                                                                             
      ignore_status: ost$status,                                                                              
      utility_attributes_p: ^clt$utility_attributes;                                                          
                                                                                                              
?? NEWTITLE := 'exit_condition_handler', EJECT ??                                                             
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure handles the exit condition handler for the utility.                                        
                                                                                                              
    PROCEDURE exit_condition_handler                                                                          
      (    exit_condition: pmt$condition;                                                                     
           exit_condition_descriptor_p: ^pmt$condition_information;                                           
           save_area_p: ^ost$stack_frame_save_area;                                                           
       VAR condition_status: ost$status);                                                                     
                                                                                                              
      VAR                                                                                                     
        i: integer,                                                                                           
        utility_status: ost$status;                                                                           
                                                                                                              
      condition_status.normal := TRUE;                                                                        
      CASE exit_condition.selector OF                                                                         
      = pmc$block_exit_processing =                                                                           
        clp$end_utility (duc$utility_name, utility_status);                                                   
        FOR i := LOWERBOUND (duv$execution_environment.restart_files)                                         
              TO UPPERBOUND (duv$execution_environment.restart_files) DO                                      
          IF duv$execution_environment.restart_files [i].file_identifier <> amv$nil_file_identifier THEN      
            fsp$close_file (duv$execution_environment.restart_files [i].file_identifier, utility_status);     
          IFEND;                                                                                              
        FOREND;                                                                                               
        ofp$display_status_message (' ', utility_status);                                                     
      ELSE                                                                                                    
      CASEND;                                                                                                 
                                                                                                              
    PROCEND exit_condition_handler;                                                                           
?? OLDTITLE ??                                                                                                
?? EJECT ??                                                                                                   
                                                                                                              
    status.normal := TRUE;                                                                                    
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);                                  
    IF NOT status.normal THEN                                                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    duv$execution_environment.restart_file_allows_modify := pvt [p$allow_modify_restart_file].value^.         
          boolean_value.value;                                                                                
    duv$execution_environment.output_file_opened := FALSE;                                                    
    duv$execution_environment.restart_files [1].opened := FALSE;                                              
    duv$execution_environment.restart_files [1].file_identifier := amv$nil_file_identifier;                   
    duv$execution_environment.restart_files [2].opened := FALSE;                                              
    duv$execution_environment.restart_files [2].file_identifier := amv$nil_file_identifier;                   
    duv$execution_environment.data_file_p := NIL;                                                             
    duv$execution_environment.memory_file_p := NIL;                                                           
                                                                                                              
    pmp$establish_condition_handler (exit_conditions, ^exit_condition_handler, ^exit_descriptor, status);     
    IF NOT status.normal THEN                                                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    PUSH utility_attributes_p: [1 .. 5];                                                                      
    utility_attributes_p^ [1].key := clc$utility_command_search_mode;                                         
    utility_attributes_p^ [1].command_search_mode := clc$global_command_search;                               
    utility_attributes_p^ [2].key := clc$utility_command_table;                                               
    utility_attributes_p^ [2].command_table := duv$anad_commands;                                             
    utility_attributes_p^ [3].key := clc$utility_function_proc_table;                                         
    utility_attributes_p^ [3].function_processor_table := duv$anad_functions;                                 
    utility_attributes_p^ [4].key := clc$utility_online_manual;                                               
    utility_attributes_p^ [4].online_manual_name := 'analyze_dump';                                           
    utility_attributes_p^ [5].key := clc$utility_prompt;                                                      
    utility_attributes_p^ [5].prompt.value := 'AD';                                                           
    utility_attributes_p^ [5].prompt.size := 2;                                                               
                                                                                                              
    clp$begin_utility (duc$utility_name, utility_attributes_p^, status);                                      
    IF NOT status.normal THEN                                                                                 
      pmp$disestablish_cond_handler (exit_conditions, ignore_status);                                         
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
   /anad_utility/                                                                                             
    BEGIN                                                                                                     
      process_dump (duv$execution_environment.restart_file_allows_modify, status);                            
      IF NOT status.normal THEN                                                                               
        EXIT /anad_utility/;  {---->                                                                          
      IFEND;                                                                                                  
                                                                                                              
      duv$title_data.system_level := 'UNKNOWN';                                                               
      duv$title_data.base_system_time := 'UNKNOWN';                                                           
      duv$title_data.termination_time := 'UNKNOWN';                                                           
                                                                                                              
      retrieve_build_level;                                                                                   
      retrieve_base_system_time (base_system_time_found, base_system_time);                                   
      IF base_system_time_found THEN                                                                          
        retrieve_termination_time (base_system_time);                                                         
      IFEND;                                                                                                  
                                                                                                              
      ofp$display_status_message ('processing anad command input', ignore_status);                            
                                                                                                              
      clp$include_file (clc$current_command_input, '', duc$utility_name, status);                             
      IF NOT status.normal THEN                                                                               
        EXIT /anad_utility/;  {---->                                                                          
      IFEND;                                                                                                  
                                                                                                              
      ofp$display_status_message (' ', ignore_status);                                                        
                                                                                                              
    END /anad_utility/;                                                                                       
                                                                                                              
    FOR i := LOWERBOUND (duv$execution_environment.restart_files)                                             
          TO UPPERBOUND (duv$execution_environment.restart_files) DO                                          
      IF duv$execution_environment.restart_files [i].opened THEN                                              
        fsp$close_file (duv$execution_environment.restart_files [i].file_identifier, ignore_status);          
      IFEND;                                                                                                  
    FOREND;                                                                                                   
    IF duv$execution_environment.output_file_opened THEN                                                      
      clp$close_display (duv$execution_environment.output_file.display_control, ignore_status);               
    IFEND;                                                                                                    
    clp$end_utility (duc$utility_name, ignore_status);                                                        
    pmp$disestablish_cond_handler (exit_conditions, ignore_status);                                           
                                                                                                              
  PROCEND dup$analyze_dump_command;                                                                           
MODEND dum$analyze_dump_command;                                                                              
                                                                                                              
                                                                                                              
