]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge with interps-20030203-mergepoint.
authorAndrew Cagney <cagney@redhat.com>
Mon, 3 Feb 2003 22:00:56 +0000 (22:00 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 3 Feb 2003 22:00:56 +0000 (22:00 +0000)
15 files changed:
gdb/ChangeLog
gdb/arm-tdep.c
gdb/dwarf2cfi.c
gdb/dwarf2read.c
gdb/minsyms.c
gdb/objfiles.c
gdb/objfiles.h
gdb/s390-tdep.c
gdb/sh-tdep.c
gdb/solib-sunos.c
gdb/symfile.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/advance.c
gdb/testsuite/gdb.base/advance.exp
gdb/testsuite/gdb.base/until.exp

index 5a1b7db165fcf74e8bbfb6fc71d85923e90717c9..413d75a9a9e79da910969be11cc3a00f7398c87d 100644 (file)
        * cli/cli-setshow.c (cmd_show_list): Use
        make_cleanup_ui_out_tuple_begin_end.
        
+2003-02-03  Jim Blandy  <jimb@redhat.com>
+
+       Use a single, consistent representation for an empty minimal
+       symbol table in an objfile.
+       * objfiles.c (terminate_minimal_symbol_table): New function.
+       (allocate_objfile): Call it.
+       * objfiles.h (terminate_minimal_symbol_table): New declaration.
+       (ALL_MSYMBOLS): No need to test whether (objfile)->msymbols is
+       non-NULL. 
+       * minsyms.c (lookup_minimal_symbol_by_pc_section): To see whether
+       objfile has minimal symbols, compare minimal_symbol_count to zero,
+       instead of comparing msymbols with NULL.
+       * objfiles.c (have_minimal_symbols): Same.
+       * solib-sunos.c (solib_add_common_symbols): Call
+       terminate_minimal_symbol_table.
+       * symfile.c (reread_symbols): Same.
+       
+2003-02-03  Kevin Buettner  <kevinb@redhat.com>
+
+       * s390-tdep.c (s390_address_class_type_flags)
+       (s390_address_class_type_flags_to_name)
+       (s390_address_class_name_to_type_flags): New functions.
+       (s390_gdbarch_init): Define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME,
+       ADDRESS_CLASS_NAME_TO_TYPE_FLAGS, and ADDRESS_CLASS_TYPE_FLAGS.
+
+2003-02-03  Michael Snyder  <msnyder@redhat.com>
+
+       * arm-tdep.c: Fix spell-o in comment.
+
+2003-02-03  Michal Ludvig  <mludvig@suse.cz>
+
+       * dwarf2cfi.c (pointer_encoding): Added new parameter.
+       * dwarf2cfi.c, dwarf2read.c: Changed all warnings and
+       error messages to contain BFD filename. 
+
+2003-02-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       Fix PR gdb/742 gdb/743 gdb/877
+       * disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end.
+       (do_mixed_source_and_assembly): Use
+       make_cleanup_ui_out_tuple_begin_end and
+       make_cleanup_ui_out_tuple_begin_end.
+       (do_mixed_source_and_assembly): Ditto.
+       * thread.c (do_captured_list_thread_ids): Ditto.
+       * ui-out.h (ui_out_table_begin, ui_out_list_begin,
+       ui_out_tuple_begin, ui_out_table_end, ui_out_list_end,
+       ui_out_tuple_end): Delete prototypes.
+       * ui-out.c (ui_out_list_begin, ui_out_tuple_begin,
+       ui_out_list_end, ui_out_tuple_end): Delete.
+
+       From Kevin Buettner  <kevinb@redhat.com>:
+       * ui-out.h (make_cleanup_ui_out_table_begin_end): New function.
+        * ui-out.c (make_cleanup_ui_out_table_begin_end)
+        (do_cleanup_table_end):  New functions.
+        * breakpoint.c (print_it_typical, print_one_breakpoint, mention):
+        Use cleanups to invoke_ui_out_tuple_end().
+        (breakpoint_1): Use cleanup to invoke ui_out_table_end().
+       * cli/cli-setshow.c (cmd_show_list): Use
+       make_cleanup_ui_out_tuple_begin_end.
+       
 2003-02-02  Andrew Cagney  <ac131313@redhat.com>
 
        * frame.c (frame_unwind_register): New function.
        * config.in: Regenerated.
        * configure: Regenerated.
 
+2003-01-24  Nick Clifton  <nickc@redhat.com>
+
+       * Add sh2e support:
+
+       2002-04-02  Elena Zannoni  <ezannoni@redhat.com>
+
+               * gdb/sh-tdep.c (sh_sh2e_register_name): New.
+               (sh2e_show_regs): New.
+               (sh_gdbarch_init): Handle bfd_mach_sh2e.
+               * config/sh/tm-sh.h: Added sh2e to comments.
+
 2003-01-23  Jim Blandy  <jimb@redhat.com>
 
        * symfile.c (syms_from_objfile): Don't print the "(no debugging
index 7ff473f2de97d4476b3d441c3ec2208a37c7a6dc..93ed5bd500eba67ec2cd1c018c61ec3f67e0365a 100644 (file)
@@ -1503,7 +1503,7 @@ arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
        }
     }
 
-  /* Return the botom of the argument list (pointed to by fp).  */
+  /* Return the bottom of the argument list (pointed to by fp).  */
   return fp;
 }
 
index c92885574c5557a7893b63fe25e0ca8ad7efa4df..618bede45ae57c7b5942f643ed41ce87bee3438f 100644 (file)
@@ -199,7 +199,7 @@ static LONGEST read_sleb128 (bfd *abfd, char **p);
 static CORE_ADDR read_pointer (bfd *abfd, char **p);
 static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p,
                                       unsigned char encoding);
-static enum ptr_encoding pointer_encoding (unsigned char encoding);
+static enum ptr_encoding pointer_encoding (unsigned char encoding, struct objfile *objfile);
 
 static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read);
 static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read,
@@ -462,7 +462,8 @@ read_pointer (bfd *abfd, char **p)
     case 8:
       return read_8u (abfd, p);
     default:
-      error ("dwarf cfi error: unsupported target address length.");
+      error ("dwarf cfi error: unsupported target address length [in module %s]", 
+                     bfd_get_filename (abfd));
     }
 }
 
@@ -509,7 +510,8 @@ read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
 
     default:
       internal_error (__FILE__, __LINE__,
-                     "read_encoded_pointer: unknown pointer encoding");
+                     "read_encoded_pointer: unknown pointer encoding [in module %s]",
+                     bfd_get_filename (abfd));
     }
 
   return ret;
@@ -520,12 +522,13 @@ read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
    - encoding & 0x70 : type (absolute, relative, ...)
    - encoding & 0x80 : indirect flag (DW_EH_PE_indirect == 0x80).  */
 enum ptr_encoding
-pointer_encoding (unsigned char encoding)
+pointer_encoding (unsigned char encoding, struct objfile *objfile)
 {
   int ret;
 
   if (encoding & DW_EH_PE_indirect)
-    warning ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect");
+    warning ("CFI: Unsupported pointer encoding: DW_EH_PE_indirect [in module %s]",
+                   objfile->name);
 
   switch (encoding & 0x70)
     {
@@ -537,7 +540,8 @@ pointer_encoding (unsigned char encoding)
       ret = encoding & 0x70;
       break;
     default:
-      internal_error (__FILE__, __LINE__, "CFI: unknown pointer encoding");
+      internal_error (__FILE__, __LINE__, "CFI: unknown pointer encoding [in module %s]", 
+                     objfile->name);
     }
   return ret;
 }
@@ -614,8 +618,9 @@ execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end,
            fs->pc = read_encoded_pointer (objfile->obfd, &insn_ptr,
                                           fs->addr_encoding);
 
-           if (pointer_encoding (fs->addr_encoding) != PE_absptr)
-             warning ("CFI: DW_CFA_set_loc uses relative addressing");
+           if (pointer_encoding (fs->addr_encoding, objfile) != PE_absptr)
+             warning ("CFI: DW_CFA_set_loc uses relative addressing [in module %s]", 
+                             objfile->name);
 
            break;
 
@@ -764,7 +769,8 @@ execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end,
            break;
 
          default:
-           error ("dwarf cfi error: unknown cfa instruction %d.", insn);
+           error ("dwarf cfi error: unknown cfa instruction %d [in module %s]", insn, 
+                           objfile->name);
          }
     }
 }
@@ -1027,25 +1033,25 @@ execute_stack_op (struct objfile *objfile,
 
        case DW_OP_dup:
          if (stack_elt < 1)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          result = stack[stack_elt - 1];
          break;
 
        case DW_OP_drop:
          if (--stack_elt < 0)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          goto no_push;
 
        case DW_OP_pick:
          offset = *op_ptr++;
          if (offset >= stack_elt - 1)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          result = stack[stack_elt - 1 - offset];
          break;
 
        case DW_OP_over:
          if (stack_elt < 2)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          result = stack[stack_elt - 2];
          break;
 
@@ -1054,7 +1060,7 @@ execute_stack_op (struct objfile *objfile,
            CORE_ADDR t1, t2, t3;
 
            if (stack_elt < 3)
-             internal_error (__FILE__, __LINE__, "execute_stack_op error");
+             internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
            t1 = stack[stack_elt - 1];
            t2 = stack[stack_elt - 2];
            t3 = stack[stack_elt - 3];
@@ -1072,7 +1078,7 @@ execute_stack_op (struct objfile *objfile,
        case DW_OP_plus_uconst:
          /* Unary operations.  */
          if (--stack_elt < 0)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          result = stack[stack_elt];
 
          switch (op)
@@ -1082,7 +1088,7 @@ execute_stack_op (struct objfile *objfile,
                int len = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
                if (len != 4 && len != 8)
                  internal_error (__FILE__, __LINE__,
-                                 "execute_stack_op error");
+                                 "execute_stack_op error [in module %s]", objfile->name);
                result = read_memory_unsigned_integer (result, len);
              }
              break;
@@ -1092,7 +1098,7 @@ execute_stack_op (struct objfile *objfile,
                int len = *op_ptr++;
                if (len != 1 && len != 2 && len != 4 && len != 8)
                  internal_error (__FILE__, __LINE__,
-                                 "execute_stack_op error");
+                                 "execute_stack_op error [in module %s]", objfile->name);
                result = read_memory_unsigned_integer (result, len);
              }
              break;
@@ -1132,7 +1138,7 @@ execute_stack_op (struct objfile *objfile,
            /* Binary operations.  */
            CORE_ADDR first, second;
            if ((stack_elt -= 2) < 0)
-             internal_error (__FILE__, __LINE__, "execute_stack_op error");
+             internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
            second = stack[stack_elt];
            first = stack[stack_elt + 1];
 
@@ -1190,7 +1196,7 @@ execute_stack_op (struct objfile *objfile,
                result = (LONGEST) first != (LONGEST) second;
                break;
              default:
-               error ("execute_stack_op: Unknown DW_OP_ value");
+               error ("execute_stack_op: Unknown DW_OP_ value [in module %s]", objfile->name);
                break;
              }
          }
@@ -1203,7 +1209,7 @@ execute_stack_op (struct objfile *objfile,
 
        case DW_OP_bra:
          if (--stack_elt < 0)
-           internal_error (__FILE__, __LINE__, "execute_stack_op error");
+           internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
          offset = read_2s (objfile->obfd, &op_ptr);
          if (stack[stack_elt] != 0)
            op_ptr += offset;
@@ -1213,12 +1219,12 @@ execute_stack_op (struct objfile *objfile,
          goto no_push;
 
        default:
-         internal_error (__FILE__, __LINE__, "execute_stack_op error");
+         internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
        }
 
       /* Most things push a result value.  */
       if ((size_t) stack_elt >= sizeof (stack) / sizeof (*stack))
-       internal_error (__FILE__, __LINE__, "execute_stack_op error");
+       internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
       stack[++stack_elt] = result;
     no_push:;
     }
@@ -1226,7 +1232,7 @@ execute_stack_op (struct objfile *objfile,
   /* We were executing this program to get a value.  It should be
      at top of stack.  */
   if (--stack_elt < 0)
-    internal_error (__FILE__, __LINE__, "execute_stack_op error");
+    internal_error (__FILE__, __LINE__, "execute_stack_op error [in module %s]", objfile->name);
   return stack[stack_elt];
 }
 
@@ -1311,7 +1317,8 @@ update_context (struct context *context, struct frame_state *fs, int chain)
              orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr;
            break;
          default:
-           internal_error (__FILE__, __LINE__, "bad switch");
+           internal_error (__FILE__, __LINE__, "bad switch 0x%02X", 
+                           orig_context->reg[fs->regs.reg[i].loc.reg].how);
          }
        break;
       case REG_SAVED_EXP:
@@ -1328,7 +1335,8 @@ update_context (struct context *context, struct frame_state *fs, int chain)
        }
        break;
       default:
-       internal_error (__FILE__, __LINE__, "bad switch");
+       internal_error (__FILE__, __LINE__, "bad switch 0x%02X",
+                       fs->regs.reg[i].how);
       }
   get_reg ((char *) &context->ra, context, fs->retaddr_column);
   unwind_tmp_obstack_free ();
@@ -1540,13 +1548,14 @@ parse_frame_info (struct objfile *objfile, file_ptr frame_offset,
                      cie = cie->next;
                    }
                  if (!cie)
-                   error ("CFI: can't find CIE pointer");
+                   error ("CFI: can't find CIE pointer [in module %s]", 
+                                   bfd_get_filename (abfd));
                }
 
              init_loc = read_encoded_pointer (abfd, &start,
                                               cie->addr_encoding);
 
-             switch (pointer_encoding (cie->addr_encoding))
+             switch (pointer_encoding (cie->addr_encoding, objfile))
                {
                case PE_absptr:
                  break;
@@ -1556,7 +1565,8 @@ parse_frame_info (struct objfile *objfile, file_ptr frame_offset,
                  init_loc += curr_section_vma + start - frame_buffer;
                  break;
                default:
-                 warning ("CFI: Unsupported pointer encoding\n");
+                 warning ("CFI: Unsupported pointer encoding [in module %s]",
+                                 bfd_get_filename (abfd));
                }
 
              /* For relocatable objects we must add an offset telling
@@ -1890,7 +1900,8 @@ cfi_get_saved_register (char *raw_buffer,
          break;
        default:
          internal_error (__FILE__, __LINE__,
-                         "cfi_get_saved_register: unknown register rule");
+                         "cfi_get_saved_register: unknown register rule 0x%02X",
+                         UNWIND_CONTEXT (frame)->reg[regnum].how);
        }
     }
 }
index 62f0fee2ed5a8f2fa9ae5b8b7b4dac6ddfa8a722..dd6614529d63e6d49c600080d748c745b7eaa3f2 100644 (file)
@@ -1218,22 +1218,24 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
 
       if (cu_header.version != 2)
        {
-         error ("Dwarf Error: wrong version in compilation unit header.");
+         error ("Dwarf Error: wrong version in compilation unit header (is %d, should be %d) [in module %s]", cu_header.version, 2, bfd_get_filename (abfd));
          return;
        }
       if (cu_header.abbrev_offset >= dwarf_abbrev_size)
        {
-         error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (offset 0x%lx + 6).",
+         error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (offset 0x%lx + 6) [in module %s]",
                 (long) cu_header.abbrev_offset,
-                (long) (beg_of_comp_unit - dwarf_info_buffer));
+                (long) (beg_of_comp_unit - dwarf_info_buffer),
+                bfd_get_filename (abfd));
          return;
        }
       if (beg_of_comp_unit + cu_header.length + cu_header.initial_length_size
          > dwarf_info_buffer + dwarf_info_size)
        {
-         error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0).",
+         error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0) [in module %s]",
                 (long) cu_header.length,
-                (long) (beg_of_comp_unit - dwarf_info_buffer));
+                (long) (beg_of_comp_unit - dwarf_info_buffer),
+                bfd_get_filename (abfd));
          return;
        }
       /* Complete the cu_header */
@@ -3787,7 +3789,8 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
   abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
   if (!abbrev)
     {
-      error ("Dwarf Error: Could not find abbrev number %d.", abbrev_number);
+      error ("Dwarf Error: Could not find abbrev number %d [in module %s]", abbrev_number,
+                     bfd_get_filename (abfd));
     }
   part_die->offset = info_ptr - dwarf_info_buffer;
   part_die->tag = abbrev->tag;
@@ -3931,7 +3934,8 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr,
   abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
   if (!abbrev)
     {
-      error ("Dwarf Error: could not find abbrev number %d.", abbrev_number);
+      error ("Dwarf Error: could not find abbrev number %d [in module %s]", abbrev_number, 
+                     bfd_get_filename (abfd));
     }
   die = dwarf_alloc_die ();
   die->offset = offset;
@@ -4067,8 +4071,9 @@ read_attribute_value (struct attribute *attr, unsigned form,
       info_ptr = read_attribute_value (attr, form, abfd, info_ptr, cu_header);
       break;
     default:
-      error ("Dwarf Error: Cannot handle %s in DWARF reader.",
-            dwarf_form_name (form));
+      error ("Dwarf Error: Cannot handle %s in DWARF reader [in module %s]",
+            dwarf_form_name (form),
+            bfd_get_filename (abfd));
     }
   return info_ptr;
 }
@@ -4149,7 +4154,8 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
          break;
        default:
          internal_error (__FILE__, __LINE__,
-                         "read_address: bad switch, signed");
+                         "read_address: bad switch, signed [in module %s]",
+                         bfd_get_filename (abfd));
        }
     }
   else
@@ -4167,7 +4173,8 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
          break;
        default:
          internal_error (__FILE__, __LINE__,
-                         "read_address: bad switch, unsigned");
+                         "read_address: bad switch, unsigned [in module %s]",
+                         bfd_get_filename (abfd));
        }
     }
 
@@ -4282,7 +4289,8 @@ read_offset (bfd *abfd, char *buf, const struct comp_unit_head *cu_header,
       break;
     default:
       internal_error (__FILE__, __LINE__,
-                     "read_offset: bad switch");
+                     "read_offset: bad switch [in module %s]",
+                     bfd_get_filename (abfd));
     }
 
  return retval;
@@ -4324,12 +4332,14 @@ read_indirect_string (bfd *abfd, char *buf,
 
   if (dwarf_str_buffer == NULL)
     {
-      error ("DW_FORM_strp used without .debug_str section");
+      error ("DW_FORM_strp used without .debug_str section [in module %s]",
+                     bfd_get_filename (abfd));
       return NULL;
     }
   if (str_offset >= dwarf_str_size)
     {
-      error ("DW_FORM_strp pointing outside of .debug_str section");
+      error ("DW_FORM_strp pointing outside of .debug_str section [in module %s]",
+                     bfd_get_filename (abfd));
       return NULL;
     }
   gdb_assert (HOST_CHAR_BIT == 8);
@@ -5349,7 +5359,8 @@ die_type (struct die_info *die, struct objfile *objfile,
       type_die = follow_die_ref (ref);
       if (!type_die)
        {
-         error ("Dwarf Error: Cannot find referent at offset %d.", ref);
+         error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", 
+                         ref, objfile->name);
          return NULL;
        }
     }
@@ -5357,7 +5368,8 @@ die_type (struct die_info *die, struct objfile *objfile,
   if (!type)
     {
       dump_die (type_die);
-      error ("Dwarf Error: Problem turning type die at offset into gdb type.");
+      error ("Dwarf Error: Problem turning type die at offset into gdb type [in module %s]",
+                     objfile->name);
     }
   return type;
 }
@@ -5381,7 +5393,8 @@ die_containing_type (struct die_info *die, struct objfile *objfile,
       type_die = follow_die_ref (ref);
       if (!type_die)
        {
-         error ("Dwarf Error: Cannot find referent at offset %d.", ref);
+         error ("Dwarf Error: Cannot find referent at offset %d [in module %s]", ref, 
+                         objfile->name);
          return NULL;
        }
       type = tag_type_to_type (type_die, objfile, cu_header);
@@ -5390,7 +5403,8 @@ die_containing_type (struct die_info *die, struct objfile *objfile,
     {
       if (type_die)
        dump_die (type_die);
-      error ("Dwarf Error: Problem turning containing type into gdb type.");
+      error ("Dwarf Error: Problem turning containing type into gdb type [in module %s]", 
+                     objfile->name);
     }
   return type;
 }
@@ -5427,7 +5441,8 @@ tag_type_to_type (struct die_info *die, struct objfile *objfile,
       if (!die->type)
        {
          dump_die (die);
-         error ("Dwarf Error: Cannot find type of die.");
+         error ("Dwarf Error: Cannot find type of die [in module %s]", 
+                         objfile->name);
        }
       return die->type;
     }
@@ -6602,8 +6617,8 @@ dwarf2_fundamental_type (struct objfile *objfile, int typeid)
 {
   if (typeid < 0 || typeid >= FT_NUM_MEMBERS)
     {
-      error ("Dwarf Error: internal error - invalid fundamental type id %d.",
-            typeid);
+      error ("Dwarf Error: internal error - invalid fundamental type id %d [in module %s]",
+            typeid, objfile->name);
     }
 
   /* Look for this particular type in the fundamental type vector.  If
index 9823c87a10987cd4c0f00c588430ab78e9b10b52..92dfa8296bb50ce0df2ab3831781dfd7e31a2c55 100644 (file)
@@ -411,8 +411,9 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section)
          "null symbol".  If there are no real symbols, then there is no
          minimal symbol table at all. */
 
-      if ((msymbol = objfile->msymbols) != NULL)
+      if (objfile->minimal_symbol_count > 0)
        {
+          msymbol = objfile->msymbols;
          lo = 0;
          hi = objfile->minimal_symbol_count - 1;
 
index d62b28f4547af16cb0a4f0b5070da5121a4a320b..16d8527a7debdbef84fd2a1b42ed8b1d3e2f7b27 100644 (file)
@@ -281,6 +281,8 @@ allocate_objfile (bfd *abfd, int flags)
       obstack_specify_allocation (&objfile->type_obstack, 0, 0, xmalloc,
                                  xfree);
       flags &= ~OBJF_MAPPED;
+
+      terminate_minimal_symbol_table (objfile);
     }
 
   /* Update the per-objfile information that comes from the bfd, ensuring
@@ -333,6 +335,33 @@ allocate_objfile (bfd *abfd, int flags)
   return (objfile);
 }
 
+
+/* Create the terminating entry of OBJFILE's minimal symbol table.
+   If OBJFILE->msymbols is zero, allocate a single entry from
+   OBJFILE->symbol_obstack; otherwise, just initialize
+   OBJFILE->msymbols[OBJFILE->minimal_symbol_count].  */
+void
+terminate_minimal_symbol_table (struct objfile *objfile)
+{
+  if (! objfile->msymbols)
+    objfile->msymbols = ((struct minimal_symbol *)
+                         obstack_alloc (&objfile->symbol_obstack,
+                                        sizeof (objfile->msymbols[0])));
+
+  {
+    struct minimal_symbol *m
+      = &objfile->msymbols[objfile->minimal_symbol_count];
+
+    memset (m, 0, sizeof (*m));
+    SYMBOL_NAME (m) = NULL;
+    SYMBOL_VALUE_ADDRESS (m) = 0;
+    MSYMBOL_INFO (m) = NULL;
+    MSYMBOL_TYPE (m) = mst_unknown;
+    SYMBOL_INIT_LANGUAGE_SPECIFIC (m, language_unknown);
+  }
+}
+
+
 /* Put one object file before a specified on in the global list.
    This can be used to make sure an object file is destroyed before
    another when using ALL_OBJFILES_SAFE to free all objfiles. */
@@ -810,7 +839,7 @@ have_minimal_symbols (void)
 
   ALL_OBJFILES (ofp)
   {
-    if (ofp->msymbols != NULL)
+    if (ofp->minimal_symbol_count > 0)
       {
        return 1;
       }
index 587e71c74384a79ec5cf29eaf2977d592f4f87b7..44b820187c1a32abc26946e9ba385b1044275180 100644 (file)
@@ -515,6 +515,8 @@ extern struct objfile *allocate_objfile (bfd *, int);
 
 extern int build_objfile_section_table (struct objfile *);
 
+extern void terminate_minimal_symbol_table (struct objfile *objfile);
+
 extern void put_objfile_before (struct objfile *, struct objfile *);
 
 extern void objfile_to_front (struct objfile *);
@@ -595,8 +597,7 @@ extern int is_in_import_list (char *, struct objfile *);
 
 #define        ALL_MSYMBOLS(objfile, m) \
   ALL_OBJFILES (objfile)        \
-    if ((objfile)->msymbols)    \
-      ALL_OBJFILE_MSYMBOLS (objfile, m)
+    ALL_OBJFILE_MSYMBOLS (objfile, m)
 
 #define ALL_OBJFILE_OSECTIONS(objfile, osect)  \
   for (osect = objfile->sections; osect < objfile->sections_end; osect++)
index c3135321b2df0c9d19c5bdafd24231b09fa053d9..21efca8fb77b21dd91858e13b3fa4265614016d3 100644 (file)
@@ -1748,6 +1748,37 @@ s390_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
   return sp;
 }
 
+static int
+s390_address_class_type_flags (int byte_size, int dwarf2_addr_class)
+{
+  if (byte_size == 4)
+    return TYPE_FLAG_ADDRESS_CLASS_1;
+  else
+    return 0;
+}
+
+static const char *
+s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
+{
+  if (type_flags & TYPE_FLAG_ADDRESS_CLASS_1)
+    return "mode32";
+  else
+    return NULL;
+}
+
+int
+s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name,
+                                      int *type_flags_ptr)
+{
+  if (strcmp (name, "mode32") == 0)
+    {
+      *type_flags_ptr = TYPE_FLAG_ADDRESS_CLASS_1;
+      return 1;
+    }
+  else
+    return 0;
+}
+
 struct gdbarch *
 s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
@@ -1869,6 +1900,12 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_ptr_bit (gdbarch, 64);
       set_gdbarch_register_bytes (gdbarch, S390X_REGISTER_BYTES);
+      set_gdbarch_address_class_type_flags (gdbarch,
+                                            s390_address_class_type_flags);
+      set_gdbarch_address_class_type_flags_to_name (gdbarch,
+                                                    s390_address_class_type_flags_to_name);
+      set_gdbarch_address_class_name_to_type_flags (gdbarch,
+                                                    s390_address_class_name_to_type_flags);
       break;
     }
 
index 1f044d054a6d284df5c65cd4258b830a872ff127..46b7deec1fcde169f8486cce70807106e9c4b0a6 100644 (file)
@@ -156,6 +156,28 @@ sh_sh3e_register_name (int reg_nr)
   return register_names[reg_nr];
 }
 
+static const char *
+sh_sh2e_register_name (int reg_nr)
+{
+  static char *register_names[] =
+  {
+    "r0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
+    "r8",   "r9",   "r10",  "r11",  "r12",  "r13",  "r14",  "r15",
+    "pc",   "pr",   "gbr",  "vbr",  "mach", "macl", "sr",
+    "fpul", "fpscr",
+    "fr0",  "fr1",  "fr2",  "fr3",  "fr4",  "fr5",  "fr6",  "fr7",
+    "fr8",  "fr9",  "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
+    "",  "",
+    "", "", "", "", "", "", "", "",
+    "", "", "", "", "", "", "", "",
+  };
+  if (reg_nr < 0)
+    return NULL;
+  if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
+    return NULL;
+  return register_names[reg_nr];
+}
+
 static const char *
 sh_sh_dsp_register_name (int reg_nr)
 {
@@ -2624,6 +2646,62 @@ sh3_show_regs (void)
 }
 
 
+static void
+sh2e_show_regs (void)
+{
+  printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
+                  paddr (read_register (PC_REGNUM)),
+                  (long) read_register (SR_REGNUM),
+                  (long) read_register (PR_REGNUM),
+                  (long) read_register (MACH_REGNUM),
+                  (long) read_register (MACL_REGNUM));
+
+  printf_filtered ("GBR=%08lx VBR=%08lx",
+                  (long) read_register (GBR_REGNUM),
+                  (long) read_register (VBR_REGNUM));
+  printf_filtered (" FPUL=%08lx FPSCR=%08lx",
+                  (long) read_register (gdbarch_tdep (current_gdbarch)->FPUL_REGNUM),
+                   (long) read_register (gdbarch_tdep (current_gdbarch)->FPSCR_REGNUM));
+
+  printf_filtered ("\nR0-R7  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
+                  (long) read_register (0),
+                  (long) read_register (1),
+                  (long) read_register (2),
+                  (long) read_register (3),
+                  (long) read_register (4),
+                  (long) read_register (5),
+                  (long) read_register (6),
+                  (long) read_register (7));
+  printf_filtered ("R8-R15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
+                  (long) read_register (8),
+                  (long) read_register (9),
+                  (long) read_register (10),
+                  (long) read_register (11),
+                  (long) read_register (12),
+                  (long) read_register (13),
+                  (long) read_register (14),
+                  (long) read_register (15));
+
+  printf_filtered (("FP0-FP7  %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
+                  (long) read_register (FP0_REGNUM + 0),
+                  (long) read_register (FP0_REGNUM + 1),
+                  (long) read_register (FP0_REGNUM + 2),
+                  (long) read_register (FP0_REGNUM + 3),
+                  (long) read_register (FP0_REGNUM + 4),
+                  (long) read_register (FP0_REGNUM + 5),
+                  (long) read_register (FP0_REGNUM + 6),
+                  (long) read_register (FP0_REGNUM + 7));
+  printf_filtered (("FP8-FP15 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
+                  (long) read_register (FP0_REGNUM + 8),
+                  (long) read_register (FP0_REGNUM + 9),
+                  (long) read_register (FP0_REGNUM + 10),
+                  (long) read_register (FP0_REGNUM + 11),
+                  (long) read_register (FP0_REGNUM + 12),
+                  (long) read_register (FP0_REGNUM + 13),
+                  (long) read_register (FP0_REGNUM + 14),
+                  (long) read_register (FP0_REGNUM + 15));
+}
+
 static void
 sh3e_show_regs (void)
 {
@@ -4329,6 +4407,20 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size);
       set_gdbarch_register_byte (gdbarch, sh_default_register_byte);
       break;      
+    case bfd_mach_sh2e:
+      sh_register_name = sh_sh2e_register_name;
+      sh_show_regs = sh2e_show_regs;
+      sh_store_return_value = sh3e_sh4_store_return_value;
+      sh_register_virtual_type = sh_sh3e_register_virtual_type;
+      set_gdbarch_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
+      set_gdbarch_register_raw_size (gdbarch, sh_default_register_raw_size);
+      set_gdbarch_register_virtual_size (gdbarch, sh_default_register_raw_size);
+      set_gdbarch_register_byte (gdbarch, sh_default_register_byte);
+      set_gdbarch_fp0_regnum (gdbarch, 25);
+      tdep->FPUL_REGNUM = 23;
+      tdep->FPSCR_REGNUM = 24;
+      tdep->FP_LAST_REGNUM = 40;
+      break;
     case bfd_mach_sh_dsp:
       sh_register_name = sh_sh_dsp_register_name;
       sh_show_regs = sh_dsp_show_regs;
index ae115673c2b5719a19028d27464a531e49bddc04..25682e02caaedea122be3c466fac789c185a73a0 100644 (file)
@@ -184,6 +184,7 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
                                  xmalloc, xfree);
       rt_common_objfile->minimal_symbol_count = 0;
       rt_common_objfile->msymbols = NULL;
+      terminate_minimal_symbol_table (rt_common_objfile);
     }
 
   init_minimal_symbol_collection ();
index c83c025bbfb409880457baf0e237df31b2d347be..7a53bee1b1f7818e463051c9267d7bd04b732035 100644 (file)
@@ -2019,6 +2019,7 @@ reread_symbols (void)
                  error ("Can't find the file sections in `%s': %s",
                         objfile->name, bfd_errmsg (bfd_get_error ()));
                }
+              terminate_minimal_symbol_table (objfile);
 
              /* We use the same section offsets as from last time.  I'm not
                 sure whether that is always correct for shared libraries.  */
index 9757675c39b62c4a044f3d135d6c6c1077a9e513..935c5898698ee969b93c58f4207c6281081d5091 100644 (file)
        out what version of MI is running. Use this to determine the proper
        output of setting a breakpoint.
 
+2003-02-01  Michael Chastain  <mec@shout.net>
+
+       * gdb.base/advance.c (marker1): New marker function.
+       * gdb.base/advance.exp: When the 'advance' command lands on the
+       return breakpoint, it can legitimately stop on either the
+       current line or the next line.  Accommodate both outcomes.
+       * gdb.base/until.exp: Likewise.
+
 2003-02-02  Andrew Cagney  <ac131313@redhat.com>
 
        2002-11-10 Jason Molenda (jason-cl@molenda.com):
index 2ae3cc50c4ae2bf1106fa991cb684ebfa76a07e8..8066deec421d0a1253eba604b1c7d7c1d9d1575b 100644 (file)
@@ -29,6 +29,10 @@ int func3 ()
   x = 4;
 }
 
+void marker1 ()
+{
+}
+
 int
 main ()
 {
@@ -38,6 +42,7 @@ main ()
   b = 3;    /* advance this location */
     
   func (c); /* stop here after leaving current frame */
+  marker1 (); /* stop here after leaving current frame */
   func3 (); /* break here */
   result = bar (b + foo (c));
   return 0; /* advance malformed */
index aea5a6d57fcbca3a5f9635d8bfce21deaa2ac6a3..e5061d8fbf61903d0cc73f1db1e155c1d4cc5b6a 100644 (file)
@@ -63,8 +63,12 @@ gdb_test "advance func" \
 # Verify that "advance <funcname>" when funcname is NOT called by the current
 # frame, stops at the end of the current frame.
 #
+# gdb can legitimately stop on either the current line or the next line,
+# depending on whether the machine instruction for 'call' on the current
+# line has more instructions after it or not.
+#
 gdb_test "advance func3" \
-       "in main.*func \\(c\\).*stop here after leaving current frame..."\
+       "(in main|).*(func \\(c\\)|marker1 \\(\\)).*stop here after leaving current frame..."\
        "advance function not called by current frame"
 
 # break at main again
index 815933279c9d0f07719ffb757346299c41a6c4eb..f646c6d36ae58f221498a8fbdaa9750723965926 100644 (file)
@@ -76,6 +76,6 @@ delete_breakpoints
 # stop at main, the caller, where we put the 'guard' breakpoint.
 #
 gdb_test "until marker3" \
-       "$hex in main.*argc.*argv.*envp.*at.*${srcfile}:82.*marker2 \\(43\\)." \
+       "($hex in |)main.*argc.*argv.*envp.*at.*${srcfile}:(82.*marker2 \\(43\\)|83.*marker3 \\(.stack., .trace.\\))." \
        "until func, not called by current frame"