OSDN Git Service

* t-sh (MULTILIB_EXCEPTIONS): Set to ml.
[pf3gnuchains/gcc-fork.git] / gcc / vmsdbgout.c
index cad6323..68e0bb8 100644 (file)
@@ -123,13 +123,6 @@ static unsigned int line_info_table_in_use;
 /* Size (in elements) of increments by which we may expand line_info_table.  */
 #define LINE_INFO_TABLE_INCREMENT 1024
 
-/* The number of the current function definition for which debugging
-   information is being generated.  These numbers range from 1 up to the
-   maximum number of function definitions contained within the current
-   compilation unit.  These numbers are used to create unique label id's unique
-   to each function definition.  */
-static unsigned int current_funcdef_number = 0;
-
 /* Forward declarations for functions defined in this file.  */
 static char *full_name                 PARAMS ((const char *));
 static unsigned int lookup_filename PARAMS ((const char *));
@@ -170,7 +163,7 @@ static void vmsdbgout_abstract_function PARAMS ((tree));
 
 /* The debug hooks structure.  */
 
-struct gcc_debug_hooks vmsdbg_debug_hooks
+const struct gcc_debug_hooks vmsdbg_debug_hooks
 = {vmsdbgout_init,
    vmsdbgout_finish,
    vmsdbgout_define,
@@ -449,7 +442,7 @@ restart:
       break;
 
     case CONST:
-      /* This used to output parentheses around the expression, but that does 
+      /* This used to output parentheses around the expression, but that does
          not work on the 386 (either ATT or BSD assembler).  */
       addr_const_to_string (buf1, XEXP (x, 0));
       strcat (str, buf1);
@@ -644,7 +637,7 @@ write_debug_data4 (data4, comment, dosizeonly)
        fprintf (asm_out_file, "\t%s %s", ASM_COMMENT_START, comment);
       fputc ('\n', asm_out_file);
     }
-  
+
   return 4;
 }
 
@@ -707,7 +700,7 @@ write_debug_string (string, comment, dosizeonly)
        fprintf (asm_out_file, "\t%s %s", ASM_COMMENT_START, comment);
       fputc ('\n', asm_out_file);
     }
-  
+
   return strlen (string);
 }
 
@@ -829,7 +822,7 @@ write_rtnbeg (rtnnum, dosizeonly)
       /* header size - 1st byte + flag byte + STO_LW size
         + string count byte + string length */
       header.dst__header_length.dst_w_length
-        = DST_K_DST_HEADER_SIZE - 1 + 1 + 4 + 1 + strlen (go);
+       = DST_K_DST_HEADER_SIZE - 1 + 1 + 4 + 1 + strlen (go);
       header.dst__header_type.dst_w_type = 0x17;
 
       totsize += write_debug_header (&header, "transfer", dosizeonly);
@@ -1133,7 +1126,7 @@ write_srccorr (fileid, file_info_entry, dosizeonly)
     = DST_K_SOURCE;
 
   src_cmdtrlr.dst_b_src_df_libmodname = 0;
-  
+
   totsize += write_debug_header (&src_header.dst_a_source_corr_header,
                                 "source corr", dosizeonly);
   totsize += write_debug_data1 (src_command.dst_b_src_command,
@@ -1153,7 +1146,7 @@ write_srccorr (fileid, file_info_entry, dosizeonly)
   totsize += write_debug_data8
     (src_command.dst_a_src_cmd_fields.dst_a_src_decl_src.dst_q_src_df_rms_cdt,
      "source_corr (creation date)", dosizeonly);
-  
+
   totsize += write_debug_data4
     (src_command.dst_a_src_cmd_fields.dst_a_src_decl_src.dst_l_src_df_rms_ebk,
      "source_corr (EOF block number)", dosizeonly);
@@ -1273,7 +1266,7 @@ write_srccorrs (dosizeonly)
     totsize += write_srccorr (i, file_info_table[i], dosizeonly);
 
   return totsize;
-}     
+}
 \f
 /* Output a marker (i.e. a label) for the beginning of a function, before
    the prologue.  */
@@ -1290,9 +1283,8 @@ vmsdbgout_begin_prologue (line, file)
 
   if (debug_info_level > DINFO_LEVEL_NONE)
     {
-      current_funcdef_number++;
       ASM_GENERATE_INTERNAL_LABEL (label, FUNC_BEGIN_LABEL,
-                                  current_funcdef_number);
+                                  current_function_funcdef_no);
       ASM_OUTPUT_LABEL (asm_out_file, label);
     }
 }
@@ -1308,7 +1300,7 @@ vmsdbgout_after_prologue ()
   if (debug_info_level > DINFO_LEVEL_TERSE)
     {
       ASM_GENERATE_INTERNAL_LABEL (label, FUNC_PROLOG_LABEL,
-                                  current_funcdef_number);
+                                  current_function_funcdef_no);
       ASM_OUTPUT_LABEL (asm_out_file, label);
     }
 }
@@ -1330,7 +1322,7 @@ vmsdbgout_end_epilogue ()
       /* Output a label to mark the endpoint of the code generated for this
          function.  */
       ASM_GENERATE_INTERNAL_LABEL (label, FUNC_END_LABEL,
-                                  current_funcdef_number);
+                                  current_function_funcdef_no);
       ASM_OUTPUT_LABEL (asm_out_file, label);
     }
 }
@@ -1455,15 +1447,26 @@ lookup_filename (file_name)
 
   if (stat (file_name, &statbuf) == 0)
     {
-      cdt = 10000000 * (statbuf.st_ctime + vms_epoch_offset);
-      ebk = statbuf.st_size / 512 + 1;
-      ffb = statbuf.st_size - ((statbuf.st_size / 512) * 512);
+      long gmtoff;
 #ifdef VMS
+      struct tm *ts;
+
+      /* Adjust for GMT */
+      ts = (struct tm *) localtime (&statbuf.st_ctime);
+      gmtoff = ts->tm_gmtoff;
+
+      /* VMS has multiple file format types */
       rfo = statbuf.st_fab_rfm;
 #else
+      /* Is GMT adjustment an issue with a cross-compiler? */
+      gmtoff = 0;
+
       /* Assume stream LF type file */
       rfo = 2;
 #endif
+      cdt = 10000000 * (statbuf.st_ctime + gmtoff + vms_epoch_offset);
+      ebk = statbuf.st_size / 512 + 1;
+      ffb = statbuf.st_size - ((statbuf.st_size / 512) * 512);
       fnam = full_name (file_name);
       flen = strlen (fnam);
     }
@@ -1497,7 +1500,7 @@ lookup_filename (file_name)
        }
     }
 
-  /* Prepare to add a new table entry by making sure there is enough space in 
+  /* Prepare to add a new table entry by making sure there is enough space in
      the table to do so.  If not, expand the current table.  */
   if (file_info_table_in_use == file_info_table_allocated)
     {
@@ -1549,7 +1552,7 @@ vmsdbgout_source_line (line, filename)
            = (dst_line_info_ref) xrealloc (line_info_table,
                                            (line_info_table_allocated
                                             * sizeof (dst_line_info_entry)));
-         }
+       }
 
       /* Add the new entry at the end of the line_info_table.  */
       line_info = &line_info_table[line_info_table_in_use++];
@@ -1636,7 +1639,7 @@ vmsdbgout_init (main_input_filename)
 
   module_producer
     = (char *) xmalloc (strlen (language_string) + 1
-                       + strlen (version_string + 1));
+                       + strlen (version_string) + 1);
   sprintf (module_producer, "%s %s", language_string, version_string);
 
   ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);