Modified Files:
authorKung Hsu <kung@cygnus>
Fri, 9 Sep 1994 01:05:28 +0000 (01:05 +0000)
committerKung Hsu <kung@cygnus>
Fri, 9 Sep 1994 01:05:28 +0000 (01:05 +0000)
ChangeLog read.h read.c ecoff.h ecoff.c

        * read.h : ditto.
        * read.c (read_a_source_file): if no file when inst is read, set
        generate_asm_lineno to true.
        * ecoff.h : change name to generate_asm_lineno and add function
        ecoff_no_current_file.
        * ecoff.c : change name to generate_asm_lineno.
        * ecoff.c (ecoff_generate_asm_lineno) : new function, to generate
        ecoff style line for asm file.

gas/ChangeLog
gas/ecoff.c
gas/read.c

index 6410328e1c6e2b361769046c2e05bbf5811fe0c0..e465fc9b26b64383aeae3da0ba02991e51d727fa 100644 (file)
@@ -1,3 +1,17 @@
+Thu Sep  8 17:18:24 1994  Kung Hsu  (kung@mexican.cygnus.com)
+
+       * config/obj-ecoff.h : Change names to  OBJ_GENERATE_ASM_LINENO,
+       and generate_asm_lineno.
+       * config/obj-elf.h : ditto.
+       * read.h : ditto.
+       * read.c (read_a_source_file): if no file when inst is read, set
+       generate_asm_lineno to true.
+       * ecoff.h : change name to generate_asm_lineno and add function
+       ecoff_no_current_file.
+       * ecoff.c : change name to generate_asm_lineno.
+       * ecoff.c (ecoff_generate_asm_lineno) : new function, to generate 
+       ecoff style line for asm file.
+
 Thu Sep  8 19:43:49 1994  Ian Lance Taylor  (ian@sanguine.cygnus.com)
 
        * config/obj-coff.c (size_section): Do an fprintf to stderr rather
index a3080b0a9612c50eeae9b0a07c95e8d4576e49a2..8671b48cb775c1f250ab7bfb3468200ad8af2f19 100644 (file)
@@ -2197,11 +2197,12 @@ add_file (file_name, indx)
        as_fatal ("fake .file after real one");
       as_where (&file, (unsigned int *) NULL);
       file_name = (const char *) file;
+
       if (! symbol_table_frozen)
-       generate_asm_line_stab = 1;
+       generate_asm_lineno = 1;
     }
   else
-      generate_asm_line_stab = 0;
+      generate_asm_lineno = 0;
 
 #ifndef NO_LISTING
   if (listing)
@@ -2283,7 +2284,11 @@ add_file (file_name, indx)
       fil_ptr->int_type = add_aux_sym_tir (&int_type_info,
                                           hash_yes,
                                           &cur_file_ptr->thash_head[0]);
-      if (generate_asm_line_stab)
+      /* gas used to have a bug that if the file does not have any
+        symbol, it either will abort or will not build the file,
+        the following is to get around that problem. ---kung*/
+#if 0
+      if (generate_asm_lineno)
        {
          mark_stabs (0);
           (void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
@@ -2295,6 +2300,7 @@ add_file (file_name, indx)
                                   (symbolS *) NULL, 0,
                                   ECOFF_MARK_STAB (N_LSYM));
        }
+#endif
     }
 }
 \f
@@ -3002,7 +3008,8 @@ ecoff_directive_end (ignore)
                                         (valueT) frag_now_fix (),
                                         frag_now),
                             (symint_t) 0, (symint_t) 0);
-      if (generate_asm_line_stab)
+
+      if (stabs_seen && generate_asm_lineno)
        {
        char *n;
 
@@ -5123,6 +5130,60 @@ generate_ecoff_stab (what, string, type, other, desc)
   cur_file_ptr = save_file_ptr;
 }
 
+int 
+ecoff_no_current_file ()
+{
+  return cur_file_ptr == (efdr_t *) NULL;
+}
+
+void
+ecoff_generate_asm_lineno (filename, lineno)
+    char *filename;
+    int lineno;
+{
+  lineno_list_t *list;
+
+  /* this potential can cause problem, when we start to see stab half the 
+     way thru the file */
+/*
+  if (stabs_seen)
+    ecoff_generate_asm_line_stab(filename, lineno);
+*/
+
+  if (strcmp (current_stabs_filename, filename))
+    {
+      add_file (filename, 0);
+      generate_asm_lineno = 1;
+    }
+
+  list = allocate_lineno_list ();
+
+  list->next = (lineno_list_t *) NULL;
+  list->file = cur_file_ptr;
+  list->proc = cur_proc_ptr;
+  list->frag = frag_now;
+  list->paddr = frag_now_fix ();
+  list->lineno = lineno;
+
+  /* A .loc directive will sometimes appear before a .ent directive,
+     which means that cur_proc_ptr will be NULL here.  Arrange to
+     patch this up.  */
+  if (cur_proc_ptr == (proc_t *) NULL)
+    {
+      lineno_list_t **pl;
+
+      pl = &noproc_lineno;
+      while (*pl != (lineno_list_t *) NULL)
+        pl = &(*pl)->next;
+      *pl = list;
+    }
+  else
+    {
+      *last_lineno_ptr = list;
+      last_lineno_ptr = &list->next;
+    }
+}
+
 static int line_label_cnt = 0;
 void
 ecoff_generate_asm_line_stab (filename, lineno)
@@ -5134,7 +5195,7 @@ ecoff_generate_asm_line_stab (filename, lineno)
   if (strcmp (current_stabs_filename, filename)) 
     {
       add_file (filename, 0);
-      generate_asm_line_stab = 1;
+      generate_asm_lineno = 1;
     }
 
   line_label_cnt++;
index ce5dfe13919bda103e55a361032a7f0d0ccaa9c5..de455904773ad2de168e7287a9980405437072b3 100644 (file)
@@ -60,7 +60,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 char *input_line_pointer;      /*->next char of source file to parse. */
 
-int generate_asm_line_stab = 0;        /* flag to generate line stab for .s file */
+int generate_asm_lineno = 0;   /* flag to generate line stab for .s file */
 
 #if BITS_PER_CHAR != 8
 /*  The following table is indexed by[(char)] and will break if
@@ -546,13 +546,18 @@ read_a_source_file (name)
                      c = *input_line_pointer;
                      *input_line_pointer = '\0';
 
-#ifdef OBJ_GENERATE_ASM_LINE_STAB
-                     if (generate_asm_line_stab)
+#ifdef OBJ_GENERATE_ASM_LINENO
+                     if (generate_asm_lineno == 0)
+                       {
+                         if (ecoff_no_current_file())
+                           generate_asm_lineno = 1;
+                       }
+                     else
                        {
                        int lineno;
                        char *s;
                          as_where (&s, &lineno);
-                         OBJ_GENERATE_ASM_LINE_STAB (lineno);
+                         OBJ_GENERATE_ASM_LINENO (s, lineno);
                        }
 #endif
 
This page took 0.034314 seconds and 4 git commands to generate.