symtab.h (SYMTAB_LINETABLE): Renamed from LINETABLE. All uses updated.
[deliverable/binutils-gdb.git] / gdb / mdebugread.c
index 230301014228511d4006e55f27c1acb93db30685..6a3b6dcda74e18602d7dda3265574060fbefe18d 100644 (file)
 #include "complaints.h"
 #include "demangle.h"
 #include "gdb-demangle.h"
-#include "gdb_assert.h"
 #include "block.h"
 #include "dictionary.h"
 #include "mdebugread.h"
 #include <sys/stat.h>
-#include <string.h>
 #include "psympriv.h"
 #include "source.h"
 
@@ -756,7 +754,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       b = top_stack->cur_block;
       if (sh->st == stProc)
        {
-         struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
+         const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
 
          /* The next test should normally be true, but provides a
             hook for nested functions (which we don't want to make
@@ -1131,7 +1129,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
                top_stack->blocktype == stStaticProc))
        {
          /* Finished with procedure */
-         struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
+         const struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
          struct mdebug_extra_func_info *e;
          struct block *b = top_stack->cur_block;
          struct type *ftype = top_stack->cur_type;
@@ -1921,8 +1919,6 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
    to look for the function which contains the MDEBUG_EFI_SYMBOL_NAME symbol
    in question, or NULL to use top_stack->cur_block.  */
 
-static void parse_procedure (PDR *, struct symtab *, struct partial_symtab *);
-
 static void
 parse_procedure (PDR *pr, struct symtab *search_symtab,
                 struct partial_symtab *pst)
@@ -4194,7 +4190,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
 
       psymtab_language = st->language;
 
-      lines = LINETABLE (st);
+      lines = SYMTAB_LINETABLE (st);
 
       /* Get a new lexical context.  */
 
@@ -4284,10 +4280,11 @@ psymtab_to_symtab_1 (struct objfile *objfile,
       size = lines->nitems;
       if (size > 1)
        --size;
-      LINETABLE (st) = obstack_copy (&mdebugread_objfile->objfile_obstack,
-                                    lines,
-                                    (sizeof (struct linetable)
-                                     + size * sizeof (lines->item)));
+      SYMTAB_LINETABLE (st)
+       = obstack_copy (&mdebugread_objfile->objfile_obstack,
+                       lines,
+                       (sizeof (struct linetable)
+                        + size * sizeof (lines->item)));
       xfree (lines);
 
       /* .. and our share of externals.
@@ -4608,7 +4605,9 @@ add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
 static void
 add_block (struct block *b, struct symtab *s)
 {
-  struct blockvector *bv = BLOCKVECTOR (s);
+  /* Cast away "const", but that's ok because we're building the
+     symtab and blockvector here.  */
+  struct blockvector *bv = (struct blockvector *) BLOCKVECTOR (s);
 
   bv = (struct blockvector *) xrealloc ((void *) bv,
                                        (sizeof (struct blockvector)
@@ -4677,7 +4676,9 @@ compare_blocks (const void *arg1, const void *arg2)
 static void
 sort_blocks (struct symtab *s)
 {
-  struct blockvector *bv = BLOCKVECTOR (s);
+  /* We have to cast away const here, but this is ok because we're
+     constructing the blockvector in this code.  */
+  struct blockvector *bv = (struct blockvector *) BLOCKVECTOR (s);
 
   if (BLOCKVECTOR_NBLOCKS (bv) <= FIRST_LOCAL_BLOCK)
     {
@@ -4729,17 +4730,17 @@ static struct symtab *
 new_symtab (const char *name, int maxlines, struct objfile *objfile)
 {
   struct symtab *s = allocate_symtab (name, objfile);
+  struct blockvector *bv;
 
-  LINETABLE (s) = new_linetable (maxlines);
+  SYMTAB_LINETABLE (s) = new_linetable (maxlines);
 
   /* All symtabs must have at least two blocks.  */
-  BLOCKVECTOR (s) = new_bvect (2);
-  BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK)
-    = new_block (NON_FUNCTION_BLOCK);
-  BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
-    = new_block (NON_FUNCTION_BLOCK);
-  BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)) =
-    BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+  bv = new_bvect (2);
+  BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK);
+  BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK);
+  BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
+    BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+  BLOCKVECTOR (s) = bv;
 
   s->debugformat = "ECOFF";
   return (s);
This page took 0.030654 seconds and 4 git commands to generate.