Changeset 351


Ignore:
Timestamp:
Jul 11, 2003, 9:04:05 AM (22 years ago)
Author:
bird
Message:

#559: corrected linenumber interpretation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/listomf.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r350 r351  
    9797static int linnum_started;
    9898static byte linnum_entry_type;
     99static int linnum_file_idx;
     100static int linnum_files;
    99101static word page_size;
    100102static word dict_blocks;
     
    21062108              line_count, (line_count == 1 ? "" : "s"), segment, names_length);
    21072109      linnum_started = TRUE;
     2110      linnum_files = linnum_file_idx = 0;
    21082111    }
    21092112  printf ("\n");
    2110   while (rec_idx < rec_len && line_count != 0)
    2111     {
    2112       switch (linnum_entry_type)
     2113
     2114  if (!linnum_files && (linnum_entry_type == 3 || linnum_entry_type == 4))
     2115    {
     2116      printf ("  No line numbers\n");
     2117      line_count = 0;
     2118    }
     2119  else
     2120    {
     2121      while (rec_idx < rec_len && line_count != 0)
    21132122        {
    2114         case 0x00:
    2115           src_line = get_word ();
    2116           index = get_word ();
    2117           addr = get_dword ();
    2118           printf ("  Line %6u of file %u at 0x%.8lx", src_line, index, addr);
    2119           break;
    2120         case 0x01:
    2121           lst_line = get_dword ();
    2122           stmt = get_dword ();
    2123           addr = get_dword ();
    2124           printf ("  Line %6lu, statement %6lu at 0x%.8lx",
    2125                   lst_line, stmt, addr);
    2126           break;
    2127         case 0x02:
    2128           src_line = get_word ();
    2129           index = get_word ();
    2130           lst_line = get_dword ();
    2131           stmt = get_dword ();
    2132           addr = get_dword ();
    2133           printf ("  Line %6u of file %u, ", src_line, index);
    2134           printf ("listing line %6lu, statement %6lu at 0x%.8lx",
    2135                   lst_line, stmt, addr);
    2136           break;
    2137         case 0x03:
    2138         case 0x04:
    2139           printf ("  No line numbers");
    2140           break;
    2141         default:
    2142           printf ("  ????");
    2143           break;
     2123          switch (linnum_entry_type)
     2124            {
     2125            case 0x00:
     2126              src_line = get_word ();
     2127              index = get_word ();
     2128              addr = get_dword ();
     2129              printf ("  Line %6u of file %u at 0x%.8lx", src_line, index, addr);
     2130              break;
     2131            case 0x01:
     2132              lst_line = get_dword ();
     2133              stmt = get_dword ();
     2134              addr = get_dword ();
     2135              printf ("  Line %6lu, statement %6lu at 0x%.8lx",
     2136                      lst_line, stmt, addr);
     2137              break;
     2138            case 0x02:
     2139              src_line = get_word ();
     2140              index = get_word ();
     2141              lst_line = get_dword ();
     2142              stmt = get_dword ();
     2143              addr = get_dword ();
     2144              printf ("  Line %6u of file %u, ", src_line, index);
     2145              printf ("listing line %6lu, statement %6lu at 0x%.8lx",
     2146                      lst_line, stmt, addr);
     2147              break;
     2148            case 0x03:
     2149            case 0x04:
     2150              printf ("  No line numbers");
     2151              break;
     2152            default:
     2153              printf ("  ????");
     2154              break;
     2155            }
     2156          printf ("\n");
     2157          --line_count;
    21442158        }
    2145       printf ("\n");
    2146       --line_count;
    2147     }
     2159    }
     2160  if (line_count == 0)
     2161    linnum_started = FALSE;
    21482162
    21492163  /* Path table comes next, ignored... */
     
    21532167  if (rec_idx < rec_len)
    21542168    {
    2155       first_col = get_dword ();
    2156       num_cols = get_dword ();
    2157       files = get_dword ();
    2158       printf ("  first column: %lu, columns: %lu, number of files: %ld\n",
    2159               first_col, num_cols, files);
    2160       for (i = 0; i < files; ++i)
     2169      if (!linnum_files/*|| (linnum_entry_type != 3 && linnum_entry_type != 4)*/)
    21612170        {
    2162           printf ("  #%lu: ", i + 1);
     2171          first_col = get_dword ();
     2172          num_cols = get_dword ();
     2173          linnum_files = get_dword ();
     2174          printf ("  first column: %lu, columns: %lu, number of files: %ld\n",
     2175                  first_col, num_cols, files);
     2176          linnum_file_idx = 0;
     2177        }
     2178
     2179      for (; linnum_file_idx < linnum_files && rec_idx < rec_len; ++linnum_file_idx)
     2180        {
     2181          printf ("  #%lu: ", linnum_file_idx + 1);
    21632182          get_string (name);
    21642183          show_string (name);
    21652184          printf ("\n");
    21662185        }
    2167     }
    2168   if (line_count == 0)
    2169     linnum_started = FALSE;
     2186
     2187      linnum_started = (linnum_file_idx < linnum_files);
     2188    }
    21702189}
    21712190
Note: See TracChangeset for help on using the changeset viewer.