* stabsread.c (patch_block_stabs): If stab & no symbol, make
authorJim Kingdon <jkingdon@engr.sgi.com>
Fri, 2 Apr 1993 19:35:30 +0000 (19:35 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Fri, 2 Apr 1993 19:35:30 +0000 (19:35 +0000)
a LOC_OPTIMIZED_OUT symbol.
symtab.h (enum address_class): Add LOC_OPTIMIZED_OUT.
findvar.c (read_var_value), printcmd.c (address_info),
symmisc.c (print_{,partial_}symbol), c-exp.y (variable),
m2-exp.y (yylex): Deal with it.

gdb/ChangeLog
gdb/c-exp.y
gdb/ch-exp.y
gdb/m2-exp.y
gdb/stabsread.c
gdb/xcoffexec.c

index 408f1c1dd19a734457e5df7ba3ecb2796de86d20..cf03d7222479bae06586aa0cf1558b0e138bece4 100644 (file)
@@ -1,3 +1,24 @@
+Fri Apr  2 08:23:14 1993  Jim Kingdon  (kingdon@cygnus.com)
+
+       * xcoffexec.c: Call fatal() not abort().
+
+       * stabsread.c (patch_block_stabs): If stab & no symbol, make
+       a LOC_OPTIMIZED_OUT symbol.
+       symtab.h (enum address_class): Add LOC_OPTIMIZED_OUT.
+       findvar.c (read_var_value), printcmd.c (address_info),
+       symmisc.c (print_{,partial_}symbol), c-exp.y (variable),
+       m2-exp.y (yylex): Deal with it.
+       **** start-sanitize-chill ****
+       ch-exp.y (yylex): Deal with it.
+       **** end-sanitize-chill ****
+
+Thu Apr  1 18:43:02 1993  Stu Grossman  (grossman@cygnus.com)
+
+       * findvar.c (value_from_register):  H8500 specific, check to see
+       if we are looking at short pointer.  If so, skip crock.
+       * h8500-tdep.c (h8500_frame_chain):  Mask down value from
+       read_memory_integer() to avoid getting messed up by sign extension.
+
 Thu Apr  1 16:44:41 1993  K. Richard Pixley  (rich@rtl.cygnus.com)
 
        * sparc-tdep.c (in_solib_trampoline), symfile.c (find_pc_section):
index 933007ed33fe6c19112fc1b758b599c29cb665a6..654bf75c356453652d3804f0bd14f9abb1b70118 100644 (file)
@@ -671,6 +671,7 @@ variable:   name_not_typename
                                case LOC_LABEL:
                                case LOC_BLOCK:
                                case LOC_CONST_BYTES:
+                               case LOC_OPTIMIZED_OUT:
 
                                  /* In this case the expression can
                                     be evaluated regardless of what
index 41ff24586500350f4d53e8f3e46938697c60267b..0a2efd15e5bf47d417e95aba0c6d0d9bbd3644ff 100644 (file)
@@ -1979,6 +1979,7 @@ yylex ()
              case LOC_UNDEF:
              case LOC_TYPEDEF:
              case LOC_CONST_BYTES:
+             case LOC_OPTIMIZED_OUT:
                error ("Symbol \"%s\" names no location.", simplename);
                break;
              }
index 8a7dbbacbf33c6c44ff77aec5a84c080dd3ae931..449b13f4bb126e871fa2a1943976834460a945b0 100644 (file)
@@ -617,6 +617,7 @@ variable:   NAME
                                case LOC_LABEL: /* maybe should go above? */
                                case LOC_BLOCK:
                                case LOC_CONST_BYTES:
+                               case LOC_OPTIMIZED_OUT:
                                  /* These are listed so gcc -Wall will reveal
                                     un-handled cases.  */
                                  break;
index 796fac522f1101268bf45c298fa8fc3195f46b10..170dbe8e346d067051757f030e6ed7fc2b524a4c 100644 (file)
@@ -382,9 +382,32 @@ patch_block_stabs (symbols, stabs, objfile)
          sym = find_symbol_in_list (symbols, name, pp-name);
          if (!sym)
            {
-#ifndef IBM6000_TARGET
-             printf ("ERROR! stab symbol not found!\n");       /* FIXME */
-#endif
+             /* On xcoff, if a global is defined and never referenced,
+                ld will remove it from the executable.  There is then
+                a N_GSYM stab for it, but no regular (C_EXT) symbol.  */
+             sym = (struct symbol *)
+               obstack_alloc (&objfile->symbol_obstack,
+                              sizeof (struct symbol));
+
+             memset (sym, 0, sizeof (struct symbol));
+             SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+             SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
+             SYMBOL_NAME (sym) =
+               obstack_copy0 (&objfile->symbol_obstack, name, pp - name);
+             pp += 2;
+             if (*(pp-1) == 'F' || *(pp-1) == 'f')
+               {
+                 /* I don't think the linker does this with functions,
+                    so as far as I know this is never executed.
+                    But it doesn't hurt to check.  */
+                 SYMBOL_TYPE (sym) =
+                   lookup_function_type (read_type (&pp, objfile));
+               }
+             else
+               {
+                 SYMBOL_TYPE (sym) = read_type (&pp, objfile);
+               }
+             add_symbol_to_list (sym, &global_symbols);
            }
          else
            {
index 0fae0902de04fc9f6f5baa2e6704a45c2bfc65fd..400d3cd914d3ca4ec69bfbb9dde50a852fa57350 100644 (file)
@@ -228,14 +228,14 @@ build_section_table (some_bfd, start, end)
 
   count = bfd_count_sections (some_bfd);
   if (count == 0)
-    abort();   /* return 1? */
+    fatal ("aborting");        /* return 1? */
   if (*start)
     free (*start);
   *start = (struct section_table *) xmalloc (count * sizeof (**start));
   *end = *start;
   bfd_map_over_sections (some_bfd, add_to_section_table, (char *)end);
   if (*end > *start + count)
-    abort();
+    fatal ("aborting");
   /* We could realloc the table, but it probably loses for most files.  */
   return 0;
 }
@@ -644,7 +644,7 @@ xfer_memory (memaddr, myaddr, len, write, target)
   boolean (*xfer_fn) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
 
   if (len <= 0)
-    abort();
+    fatal ("aborting");
 
   memend = memaddr + len;
   xfer_fn = write? bfd_set_section_contents: bfd_get_section_contents;