x
[deliverable/binutils-gdb.git] / binutils / ieee.c
index 1fe98bf859dbb065fb8c77983169f1e67b877ce0..2756ba138eaa011ce534553a5f872af19b57b869 100644 (file)
@@ -41,6 +41,8 @@ struct ieee_block
   const char *filename;
   /* The index of the function type, for a BB4 or BB6 block.  */
   unsigned int fnindx;
+  /* True if this function is being skipped.  */
+  boolean skip;
 };
 
 /* This structure is the block stack.  */
@@ -152,10 +154,16 @@ struct ieee_info
   const bfd_byte *pend;
   /* The block stack.  */
   struct ieee_blockstack blockstack;
+  /* Whether we have seen a BB1 or BB2.  */
+  boolean saw_filename;
   /* The variables.  */
   struct ieee_vars vars;
+  /* The global variables, after a global typedef block.  */
+  struct ieee_vars *global_vars;
   /* The types.  */
   struct ieee_types types;
+  /* The global types, after a global typedef block.  */
+  struct ieee_types *global_types;
   /* The list of tagged structs.  */
   struct ieee_tag *tags;
 };
@@ -889,6 +897,7 @@ parse_ieee (dhandle, abfd, bytes, len)
   info.bytes = bytes;
   info.pend = bytes + len;
   info.blockstack.bsp = info.blockstack.stack;
+  info.saw_filename = false;
   info.vars.alloc = 0;
   info.vars.vars = NULL;
   info.types.alloc = 0;
@@ -974,6 +983,7 @@ parse_ieee_bb (info, pp)
   unsigned long namlen;
   char *namcopy;
   unsigned int fnindx;
+  boolean skip;
 
   block_start = *pp;
 
@@ -985,6 +995,7 @@ parse_ieee_bb (info, pp)
     return false;
 
   fnindx = (unsigned int) -1;
+  skip = false;
 
   switch (b)
     {
@@ -995,6 +1006,29 @@ parse_ieee_bb (info, pp)
        return false;
       if (! debug_set_filename (info->dhandle, namcopy))
        return false;
+      info->saw_filename = true;
+
+      /* Discard any variables or types we may have seen before.  */
+      if (info->vars.vars != NULL)
+       free (info->vars.vars);
+      info->vars.vars = NULL;
+      info->vars.alloc = 0;
+      if (info->types.types != NULL)
+       free (info->types.types);
+      info->types.types = NULL;
+      info->types.alloc = 0;
+
+      /* Initialize the types to the global types.  */
+      if (info->global_types != NULL)
+       {
+         info->types.alloc = info->global_types->alloc;
+         info->types.types = ((struct ieee_type *)
+                              xmalloc (info->types.alloc
+                                       * sizeof (*info->types.types)));
+         memcpy (info->types.types, info->global_types->types,
+                 info->types.alloc * sizeof (*info->types.types));
+       }
+
       break;
 
     case 2:
@@ -1002,6 +1036,7 @@ parse_ieee_bb (info, pp)
         empty, but we don't check. */
       if (! debug_set_filename (info->dhandle, "*global*"))
        return false;
+      info->saw_filename = true;
       break;
 
     case 3:
@@ -1098,40 +1133,51 @@ parse_ieee_bb (info, pp)
          }
        else
          {
-           debug_type return_type;
-
-           if (typindx < 256)
-             {
-               return_type = ieee_builtin_type (info, block_start, typindx);
-               if (return_type == NULL)
-                 return false;
-             }
+           /* The MRI C++ compiler will output a fake function named
+              __XRYCPP to hold C++ debugging information.  We skip
+              that function.  This is not crucial, but it makes
+              converting from IEEE to other debug formats work
+              better.  */
+           if (strncmp (name, "__XRYCPP", namlen) == 0)
+             skip = true;
            else
              {
-               typindx -= 256;
-               if (! ieee_alloc_type (info, typindx, true))
+               debug_type return_type;
+
+               if (typindx < 256)
+                 {
+                   return_type = ieee_builtin_type (info, block_start,
+                                                    typindx);
+                   if (return_type == NULL)
+                     return false;
+                 }
+               else
+                 {
+                   typindx -= 256;
+                   if (! ieee_alloc_type (info, typindx, true))
+                     return false;
+                   fnindx = typindx;
+                   return_type = info->types.types[typindx].type;
+                   if (debug_get_type_kind (info->dhandle, return_type)
+                       == DEBUG_KIND_FUNCTION)
+                     return_type = debug_get_return_type (info->dhandle,
+                                                          return_type);
+                 }
+
+               namcopy = savestring (name, namlen);
+               if (namcopy == NULL)
+                 return false;
+               if (! debug_record_function (info->dhandle, namcopy,
+                                            return_type, false, offset))
                  return false;
-               fnindx = typindx;
-               return_type = info->types.types[typindx].type;
-               if (debug_get_type_kind (info->dhandle, return_type)
-                   == DEBUG_KIND_FUNCTION)
-                 return_type = debug_get_return_type (info->dhandle,
-                                                      return_type);
              }
-
-           namcopy = savestring (name, namlen);
-           if (namcopy == NULL)
-             return false;
-           if (! debug_record_function (info->dhandle, namcopy, return_type,
-                                        false, offset))
-             return false;
          }
       }
       break;
 
     case 10:
-      /* BB10: Assembler module scope.  We completely ignore all this
-        information.  FIXME.  */
+      /* BB10: Assembler module scope.  In the normal case, we
+        completely ignore all this information.  FIXME.  */
       {
        const char *inam, *vstr;
        unsigned long inamlen, vstrlen;
@@ -1139,6 +1185,16 @@ parse_ieee_bb (info, pp)
        boolean present;
        unsigned int i;
 
+       if (! info->saw_filename)
+         {
+           namcopy = savestring (name, namlen);
+           if (namcopy == NULL)
+             return false;
+           if (! debug_set_filename (info->dhandle, namcopy))
+             return false;
+           info->saw_filename = true;
+         }
+
        if (! ieee_read_id (info, pp, &inam, &inamlen)
            || ! ieee_read_number (info, pp, &tool_type)
            || ! ieee_read_optional_id (info, pp, &vstr, &vstrlen, &present))
@@ -1188,6 +1244,7 @@ parse_ieee_bb (info, pp)
   if (b == 5)
     info->blockstack.bsp->filename = namcopy;
   info->blockstack.bsp->fnindx = fnindx;
+  info->blockstack.bsp->skip = skip;
   ++info->blockstack.bsp;
 
   return true;
@@ -1211,12 +1268,46 @@ parse_ieee_be (info, pp)
 
   switch (info->blockstack.bsp->kind)
     {
+    case 2:
+      /* When we end the global typedefs block, we copy out the the
+         contents of info->vars.  This is because the variable indices
+         may be reused in the local blocks.  However, we need to
+         preserve them so that we can locate a function returning a
+         reference variable whose type is named in the global typedef
+         block.  */
+      info->global_vars = ((struct ieee_vars *)
+                          xmalloc (sizeof *info->global_vars));
+      info->global_vars->alloc = info->vars.alloc;
+      info->global_vars->vars = ((struct ieee_var *)
+                                xmalloc (info->vars.alloc
+                                         * sizeof (*info->vars.vars)));
+      memcpy (info->global_vars->vars, info->vars.vars,
+             info->vars.alloc * sizeof (*info->vars.vars));
+
+      /* We also copy out the non builtin parts of info->types, since
+         the types are discarded when we start a new block.  */
+      info->global_types = ((struct ieee_types *)
+                           xmalloc (sizeof *info->global_types));
+      info->global_types->alloc = info->types.alloc;
+      info->global_types->types = ((struct ieee_type *)
+                                  xmalloc (info->types.alloc
+                                           * sizeof (*info->types.types)));
+      memcpy (info->global_types->types, info->types.types,
+             info->types.alloc * sizeof (*info->types.types));
+      memset (info->global_types->builtins, 0,
+             sizeof (info->global_types->builtins));
+
+      break;
+
     case 4:
     case 6:
       if (! ieee_read_expression (info, pp, &offset))
        return false;
-      if (! debug_end_function (info->dhandle, offset))
-       return false;
+      if (! info->blockstack.bsp->skip)
+       {
+         if (! debug_end_function (info->dhandle, offset + 1))
+           return false;
+       }
       break;
 
     case 0x86:
@@ -1224,7 +1315,7 @@ parse_ieee_be (info, pp)
         function.  */
       if (! ieee_read_expression (info, pp, &offset))
        return false;
-      if (! debug_end_block (info->dhandle, offset))
+      if (! debug_end_block (info->dhandle, offset + 1))
        return false;
       break;
 
@@ -1734,6 +1825,11 @@ parse_ieee_ty (info, pp)
       }
       break;
 
+    case 'V':
+      /* Void.  This is not documented, but the MRI compiler emits it.  */
+      type = debug_make_void_type (dhandle);
+      break;
+
     case 'Z':
       /* Array with 0 lower bound.  */
       {
@@ -1775,16 +1871,31 @@ parse_ieee_ty (info, pp)
     case 'g':
       /* Bitfield type.  */
       {
-       bfd_vma signedp, bitsize;
+       bfd_vma signedp, bitsize, dummy;
+       const bfd_byte *hold;
+       boolean present;
 
        if (! ieee_read_number (info, pp, &signedp)
-           || ! ieee_read_number (info, pp, &bitsize)
-           || ! ieee_read_type_index (info, pp, &type))
+           || ! ieee_read_number (info, pp, &bitsize))
          return false;
 
-       /* FIXME: This is just a guess.  */
-       if (! signedp)
-         type = debug_make_int_type (dhandle, 4, true);
+       /* I think the documentation says that there is a type index,
+           but some actual files do not have one.  */
+       hold = *pp;
+       if (! ieee_read_optional_number (info, pp, &dummy, &present))
+         return false;
+       if (! present)
+         {
+           /* FIXME: This is just a guess.  */
+           type = debug_make_int_type (dhandle, 4,
+                                       signedp ? false : true);
+         }
+       else
+         {
+           *pp = hold;
+           if (! ieee_read_type_index (info, pp, &type))
+             return false;
+         }
        type_bitsize = bitsize;
       }
       break;
@@ -1935,8 +2046,7 @@ parse_ieee_ty (info, pp)
       break;
     }
 
-  /* Record the type in the table.  If the corresponding NN record has
-     a name, name it.  FIXME: Is this always correct?  */
+  /* Record the type in the table.  */
 
   if (type == DEBUG_TYPE_NULL)
     return false;
@@ -2040,8 +2150,38 @@ parse_ieee_atn (info, pp)
       if (varindx >= info->vars.alloc
          || info->vars.vars[varindx].name == NULL)
        {
-         ieee_error (info, atn_start, "undefined variable in ATN");
-         return false;
+         /* The MRI compiler or linker sometimes omits the NN record
+             for a pmisc record.  */
+         if (atn_code == 62)
+           {
+             if (varindx >= info->vars.alloc)
+               {
+                 unsigned int alloc;
+
+                 alloc = info->vars.alloc;
+                 if (alloc == 0)
+                   alloc = 4;
+                 while (varindx >= alloc)
+                   alloc *= 2;
+                 info->vars.vars = ((struct ieee_var *)
+                                    xrealloc (info->vars.vars,
+                                              (alloc
+                                               * sizeof *info->vars.vars)));
+                 memset (info->vars.vars + info->vars.alloc, 0,
+                         ((alloc - info->vars.alloc)
+                          * sizeof *info->vars.vars));
+                 info->vars.alloc = alloc;
+               }
+
+             pvar = info->vars.vars + varindx;
+             pvar->name = "";
+             pvar->namlen = 0;
+           }
+         else
+           {
+             ieee_error (info, atn_start, "undefined variable in ATN");
+             return false;
+           }
        }
 
       pvar = info->vars.vars + varindx;
@@ -2185,9 +2325,11 @@ parse_ieee_atn (info, pp)
       return true;
 
     case 10:
-      /* Locked register.  */
+      /* Locked register.  The spec says that there are two required
+         fields, but at least on occasion the MRI compiler only emits
+         one.  */
       if (! ieee_read_number (info, pp, &v)
-         || ! ieee_read_number (info, pp, &v2))
+         || ! ieee_read_optional_number (info, pp, &v2, &present))
        return false;
 
       /* I think this means a variable that is both in a register and
@@ -3219,60 +3361,79 @@ ieee_read_reference (info, pp)
   pslot = NULL;
   if (flags != 3)
     {
-      int i;
-      struct ieee_var *pv = NULL;
+      int pass;
 
       /* We search from the last variable indices to the first in
-        hopes of finding local variables correctly.  FIXME: This
-        probably won't work in all cases.  On the other hand, I don't
-        know what will.  */
-      for (i = (int) info->vars.alloc - 1; i >= 0; i--)
+        hopes of finding local variables correctly.  We search the
+        local variables on the first pass, and the global variables
+        on the second.  FIXME: This probably won't work in all cases.
+        On the other hand, I don't know what will.  */
+      for (pass = 0; pass < 2; pass++)
        {
-         boolean found;
+         struct ieee_vars *vars;
+         int i;
+         struct ieee_var *pv = NULL;
 
-         pv = info->vars.vars + i;
-
-         if (pv->pslot == NULL
-             || pv->namlen != namlen
-             || strncmp (pv->name, name, namlen) != 0)
-           continue;
+         if (pass == 0)
+           vars = &info->vars;
+         else
+           {
+             vars = info->global_vars;
+             if (vars == NULL)
+               break;
+           }
 
-         found = false;
-         switch (flags)
+         for (i = (int) vars->alloc - 1; i >= 0; i--)
            {
-           default:
-             ieee_error (info, start,
-                         "unrecognized C++ reference type");
-             return false;
+             boolean found;
 
-           case 0:
-             /* Global variable or function.  */
-             if (pv->kind == IEEE_GLOBAL
-                 || pv->kind == IEEE_EXTERNAL
-                 || pv->kind == IEEE_FUNCTION)
-               found = true;
-             break;
+             pv = vars->vars + i;
 
-           case 1:
-             /* Global static variable or function.  */
-             if (pv->kind == IEEE_STATIC
-                 || pv->kind == IEEE_FUNCTION)
-               found = true;
-             break;
+             if (pv->pslot == NULL
+                 || pv->namlen != namlen
+                 || strncmp (pv->name, name, namlen) != 0)
+               continue;
 
-           case 2:
-             /* Local variable.  */
-             if (pv->kind == IEEE_LOCAL)
-               found = true;
-             break;
+             found = false;
+             switch (flags)
+               {
+               default:
+                 ieee_error (info, start,
+                             "unrecognized C++ reference type");
+                 return false;
+
+               case 0:
+                 /* Global variable or function.  */
+                 if (pv->kind == IEEE_GLOBAL
+                     || pv->kind == IEEE_EXTERNAL
+                     || pv->kind == IEEE_FUNCTION)
+                   found = true;
+                 break;
+
+               case 1:
+                 /* Global static variable or function.  */
+                 if (pv->kind == IEEE_STATIC
+                     || pv->kind == IEEE_FUNCTION)
+                   found = true;
+                 break;
+
+               case 2:
+                 /* Local variable.  */
+                 if (pv->kind == IEEE_LOCAL)
+                   found = true;
+                 break;
+               }
+
+             if (found)
+               break;
            }
 
-         if (found)
-           break;
+         if (i >= 0)
+           {
+             pslot = pv->pslot;
+             break;
+           }
        }
-
-      if (i >= 0)
-       pslot = pv->pslot;
     }
   else
     {
@@ -3446,6 +3607,9 @@ ieee_regno_to_genreg (abfd, r)
          32 to 35 for fp0 to fp3.  */
       --r;
       break;
+
+    default:
+      break;
     }
 
   return r;
@@ -3472,6 +3636,9 @@ ieee_genreg_to_regno (abfd, r)
          32 to 35 for fp0 to fp3.  */
       ++r;
       break;
+
+    default:
+      break;
     }
 
   return r;
@@ -3624,6 +3791,8 @@ struct ieee_defined_enum
   struct ieee_defined_enum *next;
   /* Type index.  */
   unsigned int indx;
+  /* Whether this enum has been defined.  */
+  boolean defined;
   /* Tag.  */
   const char *tag;
   /* Names.  */
@@ -3735,6 +3904,10 @@ struct ieee_handle
   struct ieee_modified_type *modified;
   /* Number of entries allocated in modified.  */
   unsigned int modified_alloc;
+  /* 4 byte complex type.  */
+  unsigned int complex_float_index;
+  /* 8 byte complex type.  */
+  unsigned int complex_double_index;
   /* The depth of block nesting.  This is 0 outside a function, and 1
      just after start_function is called.  */
   unsigned int block_depth;
@@ -4559,7 +4732,18 @@ write_ieee_debugging_info (abfd, dhandle)
   /* Prepend the global typedef information to the other data.  */
   if (! ieee_buffer_emptyp (&info.global_types))
     {
+      /* The HP debugger seems to have a bug in which it ignores the
+         last entry in the global types, so we add a dummy entry.  */
       if (! ieee_change_buffer (&info, &info.global_types)
+         || ! ieee_write_byte (&info, (int) ieee_nn_record)
+         || ! ieee_write_number (&info, info.name_indx)
+         || ! ieee_write_id (&info, "")
+         || ! ieee_write_byte (&info, (int) ieee_ty_record_enum)
+         || ! ieee_write_number (&info, info.type_indx)
+         || ! ieee_write_byte (&info, 0xce)
+         || ! ieee_write_number (&info, info.name_indx)
+         || ! ieee_write_number (&info, 'P')
+         || ! ieee_write_number (&info, (int) builtin_void + 32)
          || ! ieee_write_byte (&info, (int) ieee_be_record_enum))
        return false;
 
@@ -4674,6 +4858,14 @@ ieee_write_undefined_tag (h, p)
              return false;
            }
        }
+      else
+       {
+         if (! ieee_change_buffer (info, &info->global_types))
+           {
+             info->error = true;
+             return false;
+           }
+       }
 
       name_indx = info->name_indx;
       ++info->name_indx;
@@ -4893,7 +5085,7 @@ ieee_finish_compilation_unit (info)
 
       /* Coalesce ranges if it seems reasonable.  */
       while (r->next != NULL
-            && high + 64 >= r->next->low
+            && high + 0x1000 >= r->next->low
             && (r->next->high
                 <= (bfd_get_section_vma (info->abfd, s)
                     + bfd_section_size (info->abfd, s))))
@@ -4962,7 +5154,8 @@ ieee_add_bb11_blocks (abfd, sec, data)
          return;
        }
 
-      if (low < r->low)
+      if (low < r->low
+         && r->low - low > 0x100)
        {
          if (! ieee_add_bb11 (info, sec, low, r->low))
            {
@@ -5072,7 +5265,7 @@ ieee_empty_type (p)
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
-  return ieee_push_type (info, 0, 0, false, false);
+  return ieee_push_type (info, (int) builtin_unknown, 0, false, false);
 }
 
 /* Make a void type.  */
@@ -5083,7 +5276,7 @@ ieee_void_type (p)
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
-  return ieee_push_type (info, 1, 0, false, false);
+  return ieee_push_type (info, (int) builtin_void, 0, false, false);
 }
 
 /* Make an integer type.  */
@@ -5168,9 +5361,19 @@ ieee_complex_type (p, size)
   switch (size)
     {
     case 4:
+      if (info->complex_float_index != 0)
+       return ieee_push_type (info, info->complex_float_index, size * 2,
+                              false, false);
       code = 'c';
       break;
+    case 12:
+    case 16:
+      /* These cases can be output by gcc -gstabs.  Outputting the
+         wrong type is better than crashing.  */
     case 8:
+      if (info->complex_double_index != 0)
+       return ieee_push_type (info, info->complex_double_index, size * 2,
+                              false, false);
       code = 'd';
       break;
     default:
@@ -5179,9 +5382,17 @@ ieee_complex_type (p, size)
     }
 
   /* FIXME: I don't know what the string is for.  */
-  return (ieee_define_type (info, size, false, false)
-         && ieee_write_number (info, code)
-         && ieee_write_id (info, ""));
+  if (! ieee_define_type (info, size * 2, false, false)
+      || ! ieee_write_number (info, code)
+      || ! ieee_write_id (info, ""))
+    return false;
+
+  if (size == 4)
+    info->complex_float_index = info->type_stack->type.indx;
+  else
+    info->complex_double_index = info->type_stack->type.indx;
+
+  return true;
 }
 
 /* Make a boolean type.  IEEE doesn't support these, so we just make
@@ -5207,9 +5418,11 @@ ieee_enum_type (p, tag, names, vals)
   struct ieee_handle *info = (struct ieee_handle *) p;
   struct ieee_defined_enum *e;
   boolean localp, simple;
+  unsigned int indx;
   int i;
 
   localp = false;
+  indx = (unsigned int) -1;
   for (e = info->enums; e != NULL; e = e->next)
     {
       if (tag == NULL)
@@ -5225,6 +5438,13 @@ ieee_enum_type (p, tag, names, vals)
            continue;
        }
 
+      if (! e->defined)
+       {
+         /* This enum tag has been seen but not defined.  */
+         indx = e->indx;
+         break;
+       }
+
       if (names != NULL && e->names != NULL)
        {
          for (i = 0; names[i] != NULL && e->names[i] != NULL; i++)
@@ -5237,7 +5457,10 @@ ieee_enum_type (p, tag, names, vals)
        }
 
       if ((names == NULL && e->names == NULL)
-         || (names[i] == NULL && e->names[i] == NULL))
+         || (names != NULL
+             && e->names != NULL
+             && names[i] == NULL
+             && e->names[i] == NULL))
        {
          /* We've seen this enum before.  */
          return ieee_push_type (info, e->indx, 0, true, false);
@@ -5269,8 +5492,8 @@ ieee_enum_type (p, tag, names, vals)
        }
     }
 
-  if (! ieee_define_named_type (info, tag, (unsigned int) -1, 0,
-                               true, localp, (struct ieee_buflist *) NULL)
+  if (! ieee_define_named_type (info, tag, indx, 0, true, localp,
+                               (struct ieee_buflist *) NULL)
       || ! ieee_write_number (info, simple ? 'E' : 'N'))
     return false;
   if (simple)
@@ -5296,16 +5519,20 @@ ieee_enum_type (p, tag, names, vals)
 
   if (! localp)
     {
-      e = (struct ieee_defined_enum *) xmalloc (sizeof *e);
-      memset (e, 0, sizeof *e);
+      if (indx == (unsigned int) -1)
+       {
+         e = (struct ieee_defined_enum *) xmalloc (sizeof *e);
+         memset (e, 0, sizeof *e);
+         e->indx = info->type_stack->type.indx;
+         e->tag = tag;
+
+         e->next = info->enums;
+         info->enums = e;
+       }
 
-      e->indx = info->type_stack->type.indx;
-      e->tag = tag;
       e->names = names;
       e->vals = vals;
-
-      e->next = info->enums;
-      info->enums = e;
+      e->defined = true;
     }
 
   return true;
@@ -5496,14 +5723,21 @@ ieee_array_type (p, low, high, stringp)
   struct ieee_handle *info = (struct ieee_handle *) p;
   unsigned int eleindx;
   boolean localp;
+  unsigned int size;
   struct ieee_modified_type *m = NULL;
   struct ieee_modified_array_type *a;
 
   /* IEEE does not store the range, so we just ignore it.  */
   ieee_pop_unused_type (info);
   localp = info->type_stack->type.localp;
+  size = info->type_stack->type.size;
   eleindx = ieee_pop_type (info);
 
+  /* If we don't know the range, treat the size as exactly one
+     element.  */
+  if (low < high)
+    size *= (high - low) + 1;
+
   if (! localp)
     {
       m = ieee_get_modified_info (info, eleindx);
@@ -5513,11 +5747,11 @@ ieee_array_type (p, low, high, stringp)
       for (a = m->arrays; a != NULL; a = a->next)
        {
          if (a->low == low && a->high == high)
-           return ieee_push_type (info, a->indx, 0, false, false);
+           return ieee_push_type (info, a->indx, size, false, false);
        }
     }
 
-  if (! ieee_define_type (info, 0, false, localp)
+  if (! ieee_define_type (info, size, false, localp)
       || ! ieee_write_number (info, low == 0 ? 'Z' : 'C')
       || ! ieee_write_number (info, eleindx))
     return false;
@@ -6449,6 +6683,30 @@ ieee_tag_type (p, name, id, kind)
   struct ieee_name_type_hash_entry *h;
   struct ieee_name_type *nt;
 
+  if (kind == DEBUG_KIND_ENUM)
+    {
+      struct ieee_defined_enum *e;
+
+      if (name == NULL)
+       abort ();
+      for (e = info->enums; e != NULL; e = e->next)
+       if (e->tag != NULL && strcmp (e->tag, name) == 0)
+         return ieee_push_type (info, e->indx, 0, true, false);
+
+      e = (struct ieee_defined_enum *) xmalloc (sizeof *e);
+      memset (e, 0, sizeof *e);
+
+      e->indx = info->type_indx;
+      ++info->type_indx;
+      e->tag = name;
+      e->defined = false;
+
+      e->next = info->enums;
+      info->enums = e;
+
+      return ieee_push_type (info, e->indx, 0, true, false);
+    }
+
   localp = false;
 
   copy = false;
@@ -7297,7 +7555,7 @@ ieee_lineno (p, filename, lineno, addr)
                return false;
              if (strcmp (info->filename, info->pending_lineno_filename) == 0)
                {
-                 /* We need a new NN record, and we aren't output to
+                 /* We need a new NN record, and we aren't about to
                     output one.  */
                  info->lineno_name_indx = info->name_indx;
                  ++info->name_indx;
@@ -7336,9 +7594,12 @@ ieee_lineno (p, filename, lineno, addr)
        return false;
     }
 
-  info->pending_lineno_filename = filename;
-  info->pending_lineno = lineno;
-  info->pending_lineno_addr = addr;
+  if (addr < info->highaddr)
+    {
+      info->pending_lineno_filename = filename;
+      info->pending_lineno = lineno;
+      info->pending_lineno_addr = addr;
+    }
 
   return true;
 }
This page took 0.033381 seconds and 4 git commands to generate.