PROCEDURE dum$dump_command_list, dump_command_list, dumcl (
  output, o: file = $output
  status)

" This procedure displays the command list of the current job.
" This needs rjt's dump analyzer

  current = $default_module()
  crev ignore status
  chadm clm$command_list_manager
  path = ' '
  dispv clv$command_list o=output.$eoi
  dispv clv$command_list.contents^ o=output.$eoi
  lfn = $pv(clv$command_list.contents^.system_command_library_lfn)
  IF lfn <> ' ' THEN
    path_offset_string = $substring(lfn, 7, 8)
    path_offset = $integer(path_offset_string, 16)
    get_path path_offset path
    disv path o=output.$eoi
  IFEND
  entry = $pv(clv$command_list.contents^.entries.first_entry)
  WHILE NOT $nil_pva(entry) DO
    dispv ?entry.clt$command_list_entry o=output.$eoi
    IF ($pv(?entry.clt$command_list_entry.kind) = CLC$CATALOG_COMMANDS) OR..
           ($pv(?entry.clt$command_list_entry.kind) = CLC$LIBRARY_COMMANDS..
          ) THEN
      lfn = $pv(?entry.clt$command_list_entry.local_file_name)
      path_offset_string = $substring(lfn, 7, 8)
      path_offset = $integer(path_offset_string, 16)
      get_path path_offset path
      disv path o=output.$eoi
    IFEND
    entry = $pv(?entry.clt$command_list_entry.next_entry)
  WHILEND
  chadm current

PROCEND dum$dump_command_list

