* config/monitor.exp: Detect the "Couldn't establish connection"
[deliverable/binutils-gdb.git] / gdb / mdebugread.c
index a992658d26f04516aa4a60a61249ec3c2fc1566e..8047798738faf1781711cf08e3da62ea19586e92 100644 (file)
@@ -254,8 +254,8 @@ static int cur_sdx;
 /* Note how much "debuggable" this image is.  We would like
    to see at least one FDR with full symbols */
 
-static max_gdbinfo;
-static max_glevel;
+static int max_gdbinfo;
+static int max_glevel;
 
 /* When examining .o files, report on undefined symbols */
 
@@ -721,6 +721,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
   switch (sh->sc)
     {
     case scText:
+    case scRConst:
       /* Do not relocate relative values.
         The value of a stEnd symbol is the displacement from the
         corresponding start symbol value.
@@ -790,7 +791,8 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       add_symbol (s, b);
 
       /* Type could be missing if file is compiled without debugging info.  */
-      if (sh->sc == scUndefined || sh->sc == scNil || sh->index == indexNil)
+      if (sh->sc == scUndefined || sh->sc == scSUndefined
+         || sh->sc == scNil || sh->index == indexNil)
        SYMBOL_TYPE (s) = nodebug_var_symbol_type;
       else
        SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
@@ -849,7 +851,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
       SYMBOL_CLASS (s) = LOC_BLOCK;
       /* Type of the return value */
-      if (sh->sc == scUndefined || sh->sc == scNil)
+      if (sh->sc == scUndefined || sh->sc == scSUndefined || sh->sc == scNil)
        t = mdebug_type_int;
       else
        {
@@ -866,7 +868,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
                 patch up the type and make it void*
                 instead. (davidm@azstarnet.com)
                 */
-             t = t->pointer_type;
+             t = make_pointer_type (t, NULL);
            }
        }
       b = top_stack->cur_block;
@@ -898,7 +900,7 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
       add_block (b, top_stack->cur_st);
 
       /* Not if we only have partial info */
-      if (sh->sc == scUndefined || sh->sc == scNil)
+      if (sh->sc == scUndefined || sh->sc == scSUndefined || sh->sc == scNil)
        break;
 
       push_parse_stack ();
@@ -2081,7 +2083,8 @@ parse_external (es, bigend, section_offsets)
     }
 
   /* Reading .o files */
-  if (es->asym.sc == scUndefined || es->asym.sc == scNil)
+  if (es->asym.sc == scUndefined || es->asym.sc == scSUndefined
+      || es->asym.sc == scNil)
     {
       char *what;
       switch (es->asym.st)
@@ -2387,7 +2390,8 @@ parse_partial_symbols (objfile, section_offsets)
       extern_tab[fdr_to_pst[ext_in->ifd].globals_offset
                 + fdr_to_pst[ext_in->ifd].n_globals++] = *ext_in;
 
-      if (ext_in->asym.sc == scUndefined || ext_in->asym.sc == scNil)
+      if (ext_in->asym.sc == scUndefined || ext_in->asym.sc == scSUndefined
+         || ext_in->asym.sc == scNil)
        continue;
 
       name = debug_info->ssext + ext_in->asym.iss;
@@ -2448,9 +2452,12 @@ parse_partial_symbols (objfile, section_offsets)
            }
          break;
        case stLocal:
+       case stNil:
          /* The alpha has the section start addresses in stLocal symbols
             whose name starts with a `.'. Skip those but complain for all
-            other stLocal symbols.  */
+            other stLocal symbols.
+            Irix6 puts the section start addresses in stNil symbols, skip
+            those too.  */
          if (name[0] == '.')
            continue;
          /* Fall through.  */
@@ -2567,7 +2574,7 @@ parse_partial_symbols (objfile, section_offsets)
                {
                  if (sh.st == stProc || sh.st == stStaticProc)
                    {
-                     long procaddr;
+                     CORE_ADDR procaddr;
                      long isym;
        
                      sh.value += ANOFFSET (section_offsets, SECT_OFF_TEXT);
@@ -2579,6 +2586,7 @@ parse_partial_symbols (objfile, section_offsets)
                                                               mst_file_text,
                                                               NULL,
                                                               SECT_OFF_TEXT,
+                                                              NULL,
                                                               objfile);
                        }
                      procaddr = sh.value;
@@ -2594,7 +2602,7 @@ parse_partial_symbols (objfile, section_offsets)
                                      &sh);
                      if (sh.st == stEnd)
                        {
-                         long high = procaddr + sh.value;
+                         CORE_ADDR high = procaddr + sh.value;
 
                          /* Kludge for Irix 5.2 zero fh->adr.  */
                          if (!relocatable
@@ -2609,6 +2617,7 @@ parse_partial_symbols (objfile, section_offsets)
                      switch (sh.sc)
                        {
                        case scUndefined:
+                       case scSUndefined:
                        case scNil:
                        case scAbs:
                          break;
@@ -2625,6 +2634,7 @@ parse_partial_symbols (objfile, section_offsets)
                                                               mst_file_data,
                                                               NULL,
                                                               SECT_OFF_DATA,
+                                                              NULL,
                                                               objfile);
                          break;
 
@@ -2636,6 +2646,7 @@ parse_partial_symbols (objfile, section_offsets)
                                                               mst_file_bss,
                                                               NULL,
                                                               SECT_OFF_BSS,
+                                                              NULL,
                                                               objfile);
                          break;
                        }
@@ -2674,7 +2685,8 @@ parse_partial_symbols (objfile, section_offsets)
                }
 
              /* Non absolute static symbols go into the minimal table.  */
-             if (sh.sc == scUndefined || sh.sc == scNil
+             if (sh.sc == scUndefined || sh.sc == scSUndefined
+                 || sh.sc == scNil
                  || (sh.index == indexNil
                      && (sh.st != stStatic || sh.sc == scAbs)))
                {
@@ -2688,6 +2700,7 @@ parse_partial_symbols (objfile, section_offsets)
              switch (sh.sc)
                {
                case scText:
+               case scRConst:
                  /* The value of a stEnd symbol is the displacement from the
                     corresponding start symbol value, do not relocate it.  */
                  if (sh.st != stEnd)
@@ -2708,14 +2721,15 @@ parse_partial_symbols (objfile, section_offsets)
 
              switch (sh.st)
                {
-                 long high;
-                 long procaddr;
+                 CORE_ADDR high;
+                 CORE_ADDR procaddr;
                  int new_sdx;
 
                case stStaticProc:
                  prim_record_minimal_symbol_and_info (name, sh.value,
                                                       mst_file_text, NULL,
-                                                      SECT_OFF_TEXT, objfile);
+                                                      SECT_OFF_TEXT, NULL,
+                                                      objfile);
 
                  /* FALLTHROUGH */
 
@@ -2735,12 +2749,12 @@ parse_partial_symbols (objfile, section_offsets)
                    add_psymbol_to_list (name, strlen (name),
                                         VAR_NAMESPACE, LOC_BLOCK,
                                         &objfile->global_psymbols,
-                                        sh.value, 0, psymtab_language, objfile);
+                                        0, sh.value, psymtab_language, objfile);
                  else
                    add_psymbol_to_list (name, strlen (name),
                                         VAR_NAMESPACE, LOC_BLOCK,
                                         &objfile->static_psymbols,
-                                        sh.value, 0, psymtab_language, objfile);
+                                        0, sh.value, psymtab_language, objfile);
 
                  /* Skip over procedure to next one. */
                  if (sh.index >= hdr->iauxMax)
@@ -2792,11 +2806,13 @@ parse_partial_symbols (objfile, section_offsets)
                    prim_record_minimal_symbol_and_info (name, sh.value,
                                                         mst_file_data, NULL,
                                                         SECT_OFF_DATA,
+                                                        NULL,
                                                         objfile);
                  else
                    prim_record_minimal_symbol_and_info (name, sh.value,
                                                         mst_file_bss, NULL,
                                                         SECT_OFF_BSS,
+                                                        NULL,
                                                         objfile);
                  class = LOC_STATIC;
                  break;
@@ -2831,7 +2847,7 @@ parse_partial_symbols (objfile, section_offsets)
                      add_psymbol_to_list (name, strlen (name),
                                           STRUCT_NAMESPACE, LOC_TYPEDEF,
                                           &objfile->static_psymbols,
-                                          sh.value, 0,
+                                          0, (CORE_ADDR) 0,
                                           psymtab_language, objfile);
                    }
                  handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
@@ -2869,8 +2885,8 @@ parse_partial_symbols (objfile, section_offsets)
              /* Use this gdb symbol */
              add_psymbol_to_list (name, strlen (name),
                                   VAR_NAMESPACE, class,
-                                  &objfile->static_psymbols, sh.value,
-                                  0, psymtab_language, objfile);
+                                  &objfile->static_psymbols,
+                                  0, sh.value, psymtab_language, objfile);
            skip:
              cur_sdx++;        /* Go to next file symbol */
            }
@@ -2892,13 +2908,15 @@ parse_partial_symbols (objfile, section_offsets)
              psh = &ext_ptr->asym;
 
              /* Do not add undefined symbols to the partial symbol table.  */
-             if (psh->sc == scUndefined || psh->sc == scNil)
+             if (psh->sc == scUndefined || psh->sc == scSUndefined
+                 || psh->sc == scNil)
                continue;
 
              svalue = psh->value;
              switch (psh->sc)
                {
                case scText:
+               case scRConst:
                  svalue += ANOFFSET (section_offsets, SECT_OFF_TEXT);
                  break;
                case scData:
@@ -3115,7 +3133,7 @@ handle_psymbol_enumerators (objfile, fh, stype, svalue)
       add_psymbol_to_list (name, strlen (name),
                           VAR_NAMESPACE, LOC_CONST,
                           &objfile->static_psymbols, 0,
-                          0, psymtab_language, objfile);
+                          (CORE_ADDR) 0, psymtab_language, objfile);
       ext_sym += external_sym_size;
     }
 }
This page took 0.027544 seconds and 4 git commands to generate.