]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
This commit was manufactured by cvs2svn to create branch 'jimb- jimb-ppc64-linux-20030528-branchpoint
authornobody <>
Wed, 28 May 2003 00:00:03 +0000 (00:00 +0000)
committernobody <>
Wed, 28 May 2003 00:00:03 +0000 (00:00 +0000)
ppc64-linux-20030528-branch'.

Sprout from cagney_fileio-20030521-branch 2003-05-21 19:52:40 UTC nobody 'This commit was manufactured by cvs2svn to create branch'
Cherrypick from master 2003-05-28 00:00:02 UTC gdbadmin <gdbadmin@sourceware.org> '*** empty log message ***':
    ChangeLog
    Makefile.in
    Makefile.tpl
    bfd/ChangeLog
    bfd/elf64-mips.c
    bfd/elfn32-mips.c
    bfd/elfxx-mips.c
    bfd/som.h
    bfd/version.h
    configure
    gdb/ChangeLog
    gdb/Makefile.in
    gdb/ada-lang.h
    gdb/ada-valprint.c
    gdb/blockframe.c
    gdb/coffread.c
    gdb/config/m68k/tm-linux.h
    gdb/config/m68k/tm-m68k.h
    gdb/config/pa/tm-hppah.h
    gdb/config/sparc/tm-sparc.h
    gdb/configure.tgt
    gdb/disasm.c
    gdb/dummy-frame.c
    gdb/dwarf2expr.c
    gdb/dwarf2loc.c
    gdb/findvar.c
    gdb/frame.c
    gdb/hppa-tdep.c
    gdb/hpread.c
    gdb/infptrace.c
    gdb/jv-valprint.c
    gdb/m68k-tdep.c
    gdb/m68k-tdep.h
    gdb/m68klinux-tdep.c
    gdb/objc-lang.c
    gdb/p-valprint.c
    gdb/sparc-tdep.c
    gdb/sparcnbsd-tdep.c
    gdb/stabsread.c
    gdb/stabsread.h
    gdb/stack.c
    gdb/testsuite/ChangeLog
    gdb/testsuite/gdb.base/corefile.exp
    gdb/version.in
    include/opcode/ChangeLog
    include/opcode/i860.h
    opcodes/ChangeLog
    opcodes/i860-dis.c
    readline/ChangeLog.gdb
    readline/aclocal.m4
    readline/configure

51 files changed:
ChangeLog
Makefile.in
Makefile.tpl
bfd/ChangeLog
bfd/elf64-mips.c
bfd/elfn32-mips.c
bfd/elfxx-mips.c
bfd/som.h
bfd/version.h
configure
gdb/ChangeLog
gdb/Makefile.in
gdb/ada-lang.h
gdb/ada-valprint.c
gdb/blockframe.c
gdb/coffread.c
gdb/config/m68k/tm-linux.h
gdb/config/m68k/tm-m68k.h
gdb/config/pa/tm-hppah.h
gdb/config/sparc/tm-sparc.h
gdb/configure.tgt
gdb/disasm.c
gdb/dummy-frame.c
gdb/dwarf2expr.c
gdb/dwarf2loc.c
gdb/findvar.c
gdb/frame.c
gdb/hppa-tdep.c
gdb/hpread.c
gdb/infptrace.c
gdb/jv-valprint.c
gdb/m68k-tdep.c
gdb/m68k-tdep.h
gdb/m68klinux-tdep.c
gdb/objc-lang.c
gdb/p-valprint.c
gdb/sparc-tdep.c
gdb/sparcnbsd-tdep.c
gdb/stabsread.c
gdb/stabsread.h
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/corefile.exp
gdb/version.in
include/opcode/ChangeLog
include/opcode/i860.h
opcodes/ChangeLog
opcodes/i860-dis.c
readline/ChangeLog.gdb
readline/aclocal.m4
readline/configure

index 1c21e6ae9df40304b8919318fb5a33497592fa36..6f0b06e6458d4b428941707833235948af7c6fb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-05-21  DJ Delorie  <dj@redhat.com>
+       
+       * Makefile.tpl (configure-target-libiberty): Depend only on gcc, not
+       newlib or libgloss.
+       * Makefile.in: Regenerate.
+
+2003-05-21  DJ Delorie  <dj@redhat.com>
+
+       * Makefile.tpl: Add missing empty maybe-check-gcc target.
+       * Makefile.in: Regenerate.
+
 2003-05-20  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
 
        * configure.in: Use curly braces in the definition of tooldir.
index a98c09970775c47852b6f9b76a80447763fc1f6b..7511bc057af30de426eba927c445a2d8c130e663 100644 (file)
@@ -7817,6 +7817,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
          LANGUAGES="c c++" all
 
 .PHONY: check-gcc
+maybe-check-gcc:
 check-gcc:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD}`; export r; \
@@ -7980,7 +7981,7 @@ configure-target-zlib: $(ALL_GCC_C)
 configure-target-examples: $(ALL_GCC_C)
 configure-target-libgloss: $(ALL_GCC)
 all-target-libgloss: maybe-configure-target-newlib
-configure-target-libiberty: $(ALL_GCC_C)
+configure-target-libiberty: $(ALL_GCC)
 configure-target-libtermcap: $(ALL_GCC_C)
 configure-target-newlib: $(ALL_GCC)
 configure-target-rda: $(ALL_GCC_C)
index f0f596841be5ffa90042cd5ab2d442e9b5dbfad0..c07fed66392eea8636dbeb2ccbf7e76cd0a99d73 100644 (file)
@@ -1270,6 +1270,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
          LANGUAGES="c c++" all
 
 .PHONY: check-gcc
+maybe-check-gcc:
 check-gcc:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD}`; export r; \
@@ -1433,7 +1434,7 @@ configure-target-zlib: $(ALL_GCC_C)
 configure-target-examples: $(ALL_GCC_C)
 configure-target-libgloss: $(ALL_GCC)
 all-target-libgloss: maybe-configure-target-newlib
-configure-target-libiberty: $(ALL_GCC_C)
+configure-target-libiberty: $(ALL_GCC)
 configure-target-libtermcap: $(ALL_GCC_C)
 configure-target-newlib: $(ALL_GCC)
 configure-target-rda: $(ALL_GCC_C)
index 4b44b409ad29dee82a0d28656bcd9de061216d4e..612884f2f3924f2b7703250a6fb7a63361533399 100644 (file)
@@ -1,3 +1,30 @@
+2003-05-27  Richard Sandiford  <rsandifo@redhat.com>
+
+       * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting.
+       (mips_elf_link_hash_table): Likewise.
+
+2003-05-22  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used
+       R_MIPS_GNU_REL16_S2 support.
+       (bfd_elf64_bfd_reloc_type_lookup): Use it.
+       (mips_elf64_rtype_to_howto): Use it.
+       * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used
+       R_MIPS_GNU_REL16_S2 support.
+       (bfd_elf32_bfd_reloc_type_lookup): Use it.
+       (mips_elf_n32_rtype_to_howto): Use it.
+
+2003-05-21  Stuart F. Downing  <sdowning@fame.com>
+
+       * som.h: Define PA_2_0 before including a.out.h
+
+2003-05-07  Eric Christopher  <echristo@redhat.com>
+           Alexandre Oliva   <aoliva@redhat.com>
+
+       * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust
+       pic tests, change to warning.
+       (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting.
+
 2003-05-21  Marcus Comstedt  <marcus@mc.pp.se>
 
        * config.bfd: Check for a target triplet of shl-...-netbsdelf as
index 6e7321cacc6076327417c0971182ca786af8f081..a43b3da9f706daf88903e9a3b656a748ddb95422 100644 (file)
@@ -1227,6 +1227,38 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto =
         0,                     /* dst_mask */
         FALSE);                /* pcrel_offset */
 \f
+/* 16 bit offset for pc-relative branches.  */
+static reloc_howto_type elf_mips_gnu_rel16_s2 =
+  HOWTO (R_MIPS_GNU_REL16_S2,  /* type */
+        2,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        TRUE,                  /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_signed, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_MIPS_GNU_REL16_S2", /* name */
+        TRUE,                  /* partial_inplace */
+        0x0000ffff,            /* src_mask */
+        0x0000ffff,            /* dst_mask */
+        TRUE);                 /* pcrel_offset */
+
+/* 16 bit offset for pc-relative branches.  */
+static reloc_howto_type elf_mips_gnu_rela16_s2 =
+  HOWTO (R_MIPS_GNU_REL16_S2,  /* type */
+        2,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        TRUE,                  /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_signed, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* special_function */
+        "R_MIPS_GNU_REL16_S2", /* name */
+        FALSE,                 /* partial_inplace */
+        0,                     /* src_mask */
+        0x0000ffff,            /* dst_mask */
+        TRUE);                 /* pcrel_offset */
+\f
 /* Swap in a MIPS 64-bit Rel reloc.  */
 
 static void
@@ -1960,6 +1992,8 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code)
       return &elf_mips_gnu_vtinherit_howto;
     case BFD_RELOC_VTABLE_ENTRY:
       return &elf_mips_gnu_vtentry_howto;
+    case BFD_RELOC_16_PCREL_S2:
+      return &elf_mips_gnu_rela16_s2;
     default:
       bfd_set_error (bfd_error_bad_value);
       return NULL;
@@ -1983,6 +2017,11 @@ mips_elf64_rtype_to_howto (r_type, rela_p)
       return &elf_mips_gnu_vtinherit_howto;
     case R_MIPS_GNU_VTENTRY:
       return &elf_mips_gnu_vtentry_howto;
+    case R_MIPS_GNU_REL16_S2:
+      if (rela_p)
+       return &elf_mips_gnu_rela16_s2;
+      else
+       return &elf_mips_gnu_rel16_s2;
     default:
       BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
       if (rela_p)
index ab255fa697472f150e2065c695c412fd8e855571..2e499488821e8b5e35c80ca93f4edbcb1eb63bd3 100644 (file)
@@ -1199,6 +1199,38 @@ static reloc_howto_type elf_mips_gnu_vtentry_howto =
         0,                     /* dst_mask */
         FALSE);                /* pcrel_offset */
 \f
+/* 16 bit offset for pc-relative branches.  */
+static reloc_howto_type elf_mips_gnu_rel16_s2 =
+  HOWTO (R_MIPS_GNU_REL16_S2,  /* type */
+        2,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        TRUE,                  /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_signed, /* complain_on_overflow */
+        mips_elf_generic_reloc, /* special_function */
+        "R_MIPS_GNU_REL16_S2", /* name */
+        TRUE,                  /* partial_inplace */
+        0x0000ffff,            /* src_mask */
+        0x0000ffff,            /* dst_mask */
+        TRUE);                 /* pcrel_offset */
+
+/* 16 bit offset for pc-relative branches.  */
+static reloc_howto_type elf_mips_gnu_rela16_s2 =
+  HOWTO (R_MIPS_GNU_REL16_S2,  /* type */
+        2,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        TRUE,                  /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_signed, /* complain_on_overflow */
+        mips_elf_generic_reloc, /* special_function */
+        "R_MIPS_GNU_REL16_S2", /* name */
+        FALSE,                 /* partial_inplace */
+        0,                     /* src_mask */
+        0x0000ffff,            /* dst_mask */
+        TRUE);                 /* pcrel_offset */
+\f
 /* This is derived from bfd_elf_generic_reloc.  NewABI allows us to have
    several relocations against the same address.  The addend is derived
    from the addends of preceding relocations.  If we don't need to
@@ -1897,6 +1929,8 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
       return &elf_mips_gnu_vtinherit_howto;
     case BFD_RELOC_VTABLE_ENTRY:
       return &elf_mips_gnu_vtentry_howto;
+    case BFD_RELOC_16_PCREL_S2:
+      return &elf_mips_gnu_rela16_s2;
     default:
       bfd_set_error (bfd_error_bad_value);
       return NULL;
@@ -1920,6 +1954,11 @@ mips_elf_n32_rtype_to_howto (r_type, rela_p)
       return &elf_mips_gnu_vtinherit_howto;
     case R_MIPS_GNU_VTENTRY:
       return &elf_mips_gnu_vtentry_howto;
+    case R_MIPS_GNU_REL16_S2:
+      if (rela_p)
+       return &elf_mips_gnu_rela16_s2;
+      else
+       return &elf_mips_gnu_rel16_s2;
     default:
       BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
       if (rela_p)
index 72516f71f1c3743de350754cb231be5d077581d0..bede3e61293a05110410d9d1d4b51e3ded510dd7 100644 (file)
@@ -163,8 +163,7 @@ struct mips_elf_hash_sort_data
   long min_got_dynindx;
   /* The greatest dynamic symbol table index corresponding to a symbol
      with a GOT entry that is not referenced (e.g., a dynamic symbol
-     with dynamic relocations pointing to it from non-primary
-     GOTs).  */
+     with dynamic relocations pointing to it from non-primary GOTs).  */
   long max_unref_got_dynindx;
   /* The greatest dynamic symbol table index not corresponding to a
      symbol without a GOT entry.  */
@@ -1719,15 +1718,15 @@ mips_elf_get_global_gotsym_index (abfd)
 
   if (abfd == NULL)
     return 0;
-  
+
   sgot = mips_elf_got_section (abfd, TRUE);
   if (sgot == NULL || mips_elf_section_data (sgot) == NULL)
     return 0;
-  
+
   g = mips_elf_section_data (sgot)->u.got_info;
   if (g == NULL || g->global_gotsym == NULL)
     return 0;
-    
+
   return g->global_gotsym->dynindx;
 }
 
@@ -1770,7 +1769,7 @@ mips_elf_global_got_index (abfd, ibfd, h)
   if (g->bfd2got && ibfd)
     {
       struct mips_got_entry e, *p;
-      
+
       BFD_ASSERT (h->dynindx >= 0);
 
       g = mips_elf_got_for_ibfd (g, ibfd);
@@ -1828,7 +1827,7 @@ mips_elf_got_page (abfd, ibfd, info, value, offsetp)
 
   if (!entry)
     return MINUS_ONE;
-  
+
   index = entry->gotidx;
 
   if (offsetp)
@@ -1886,7 +1885,7 @@ mips_elf_got_offset_from_index (dynobj, output_bfd, input_bfd, index)
   g = mips_elf_got_info (dynobj, &sgot);
   gp = _bfd_get_gp_value (output_bfd)
     + mips_elf_adjust_gp (output_bfd, g, input_bfd);
-  
+
   return sgot->output_section->vma + sgot->output_offset + index - gp;
 }
 
@@ -1918,14 +1917,14 @@ mips_elf_create_local_got_entry (abfd, ibfd, gg, sgot, value)
                                                   INSERT);
   if (*loc)
     return *loc;
-      
+
   entry.gotidx = MIPS_ELF_GOT_SIZE (abfd) * g->assigned_gotno++;
 
   *loc = (struct mips_got_entry *)bfd_alloc (abfd, sizeof entry);
 
   if (! *loc)
     return NULL;
-             
+
   memcpy (*loc, &entry, sizeof entry);
 
   if (g->assigned_gotno >= g->local_gotno)
@@ -1965,7 +1964,7 @@ mips_elf_sort_hash_table (info, max_local)
   g = mips_elf_got_info (dynobj, NULL);
 
   hsd.low = NULL;
-  hsd.max_unref_got_dynindx = 
+  hsd.max_unref_got_dynindx =
   hsd.min_got_dynindx = elf_hash_table (info)->dynsymcount
     /* In the multi-got case, assigned_gotno of the master got_info
        indicate the number of entries that aren't referenced in the
@@ -2079,7 +2078,7 @@ mips_elf_record_global_got_symbol (h, abfd, info, g)
 
   if (! *loc)
     return FALSE;
-             
+
   entry.gotidx = -1;
   memcpy (*loc, &entry, sizeof entry);
 
@@ -2121,7 +2120,7 @@ mips_elf_record_local_got_symbol (abfd, symndx, addend, g)
 
   if (! *loc)
     return FALSE;
-             
+
   memcpy (*loc, &entry, sizeof entry);
 
   return TRUE;
@@ -2187,7 +2186,7 @@ mips_elf_make_got_per_bfd (entryp, p)
   struct mips_got_info *g;
   struct mips_elf_bfd2got_hash bfdgot_entry, *bfdgot;
   void **bfdgotp;
-  
+
   /* Find the got_info for this GOT entry's input bfd.  Create one if
      none exists.  */
   bfdgot_entry.bfd = entry->abfd;
@@ -2239,7 +2238,7 @@ mips_elf_make_got_per_bfd (entryp, p)
   entryp = htab_find_slot (g->got_entries, entry, INSERT);
   if (*entryp != NULL)
     return 1;
-  
+
   *entryp = entry;
 
   if (entry->symndx >= 0 || entry->d.h->forced_local)
@@ -2268,7 +2267,7 @@ mips_elf_merge_gots (bfd2got_, p)
   unsigned int lcount = bfd2got->g->local_gotno;
   unsigned int gcount = bfd2got->g->global_gotno;
   unsigned int maxcnt = arg->max_count;
-  
+
   /* If we don't have a primary GOT and this is not too big, use it as
      a starting point for the primary GOT.  */
   if (! arg->primary && lcount + gcount <= maxcnt)
@@ -2336,7 +2335,7 @@ mips_elf_merge_gots (bfd2got_, p)
     {
       bfd2got->g->next = arg->current;
       arg->current = bfd2got->g;
-      
+
       arg->current_count = lcount + gcount;
     }
 
@@ -2417,7 +2416,7 @@ mips_elf_resolve_final_got_entry (entryp, p)
 
       if (entry->d.h == h)
        return 1;
-      
+
       entry->d.h = h;
 
       /* If we can't find this entry with the new bfd hash, re-insert
@@ -2437,7 +2436,7 @@ mips_elf_resolve_final_got_entry (entryp, p)
       /* We might want to decrement the global_gotno count, but it's
         either too early or too late for that at this point.  */
     }
-  
+
   return 1;
 }
 
@@ -2478,7 +2477,7 @@ mips_elf_adjust_gp (abfd, g, ibfd)
   BFD_ASSERT (g->next);
 
   g = g->next;
-  
+
   return (g->local_gotno + g->global_gotno) * MIPS_ELF_GOT_SIZE (abfd);
 }
 
@@ -2566,7 +2565,7 @@ mips_elf_multi_got (abfd, info, g, got, pages)
   {
     struct mips_elf_bfd2got_hash *bfdgot;
     void **bfdgotp;
-  
+
     bfdgot = (struct mips_elf_bfd2got_hash *)bfd_alloc
       (abfd, sizeof (struct mips_elf_bfd2got_hash));
 
@@ -2592,7 +2591,7 @@ mips_elf_multi_got (abfd, info, g, got, pages)
      the cache.  Also, knowing that every external symbol has a GOT
      helps speed up the resolution of local symbols too, so GNU/Linux
      follows IRIX's practice.
-     
+
      The number 2 is used by mips_elf_sort_hash_table_f to count
      global GOT symbols that are unreferenced in the primary GOT, with
      an initial dynamic index computed from gg->assigned_gotno, where
@@ -2665,10 +2664,10 @@ mips_elf_multi_got (abfd, info, g, got, pages)
 
   got->_raw_size = (gg->next->local_gotno
                    + gg->next->global_gotno) * MIPS_ELF_GOT_SIZE (abfd);
-  
+
   return TRUE;
 }
-     
+
 \f
 /* Returns the first relocation of type r_type found, beginning with
    RELOCATION.  RELEND is one-past-the-end of the relocation table.  */
@@ -5370,12 +5369,12 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
            {
              struct mips_elf_link_hash_entry *hmips =
                (struct mips_elf_link_hash_entry *) h;
-             
+
              while (hmips->root.root.type == bfd_link_hash_indirect
                     || hmips->root.root.type == bfd_link_hash_warning)
                hmips = (struct mips_elf_link_hash_entry *)
                  hmips->root.root.u.i.link;
-         
+
              if ((hmips->root.root.type == bfd_link_hash_defined
                   || hmips->root.root.type == bfd_link_hash_defweak)
                  && hmips->root.root.u.def.section
@@ -5599,7 +5598,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again)
          while (h->root.root.type == bfd_link_hash_indirect
                 || h->root.root.type == bfd_link_hash_warning)
            h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
-         
+
          /* If a symbol is undefined, or if it may be overridden,
             skip it.  */
          if (! ((h->root.root.type == bfd_link_hash_defined
@@ -5662,7 +5661,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again)
       /* Check that it's in range.  */
       if (sym_offset < -0x8000 || sym_offset >= 0x8000)
        continue;
-      
+
       /* Get the section contents if we haven't done so already.  */
       if (contents == NULL)
        {
@@ -5711,7 +5710,7 @@ _bfd_mips_relax_section (abfd, sec, link_info, again)
     }
   return TRUE;
 
- relax_return:  
+ relax_return:
   if (free_contents != NULL)
     free (free_contents);
   return FALSE;
@@ -5857,7 +5856,7 @@ _bfd_mips_elf_always_size_sections (output_bfd, info)
   if (dynobj == NULL)
     /* Relocatable links don't have it.  */
     return TRUE;
-  
+
   g = mips_elf_got_info (dynobj, &s);
   if (s == NULL)
     return TRUE;
@@ -6022,7 +6021,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
          struct mips_got_info *g = gg;
          struct mips_elf_set_global_got_offset_arg set_got_offset_arg;
          unsigned int needed_relocs = 0;
-         
+
          if (gg->next)
            {
              set_got_offset_arg.value = MIPS_ELF_GOT_SIZE (output_bfd);
@@ -6782,7 +6781,7 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
       e.abfd = output_bfd;
       e.symndx = -1;
       e.d.h = (struct mips_elf_link_hash_entry *)h;
-      
+
       if (info->shared
          || h->root.type == bfd_link_hash_undefined
          || h->root.type == bfd_link_hash_undefweak)
@@ -8380,17 +8379,6 @@ _bfd_mips_elf_final_link (abfd, info)
     scRData, scSData, scSBss, scBss
   };
 
-  /* If all the things we linked together were PIC, but we're
-     producing an executable (rather than a shared object), then the
-     resulting file is CPIC (i.e., it calls PIC code.)  */
-  if (!info->shared
-      && !info->relocateable
-      && elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
-    {
-      elf_elfheader (abfd)->e_flags &= ~EF_MIPS_PIC;
-      elf_elfheader (abfd)->e_flags |= EF_MIPS_CPIC;
-    }
-
   /* We'd carefully arranged the dynamic symbol indices, and then the
      generic size_dynamic_sections renumbered them out from under us.
      Rather than trying somehow to prevent the renumbering, just do
@@ -9250,25 +9238,22 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
 
   ok = TRUE;
 
-  if ((new_flags & EF_MIPS_PIC) != (old_flags & EF_MIPS_PIC))
+  if (((new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)
+      != ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0))
     {
-      new_flags &= ~EF_MIPS_PIC;
-      old_flags &= ~EF_MIPS_PIC;
       (*_bfd_error_handler)
-       (_("%s: linking PIC files with non-PIC files"),
+       (_("%s: warning: linking PIC files with non-PIC files"),
         bfd_archive_filename (ibfd));
-      ok = FALSE;
+      ok = TRUE;
     }
 
-  if ((new_flags & EF_MIPS_CPIC) != (old_flags & EF_MIPS_CPIC))
-    {
-      new_flags &= ~EF_MIPS_CPIC;
-      old_flags &= ~EF_MIPS_CPIC;
-      (*_bfd_error_handler)
-       (_("%s: linking abicalls files with non-abicalls files"),
-        bfd_archive_filename (ibfd));
-      ok = FALSE;
-    }
+  if (new_flags & (EF_MIPS_PIC | EF_MIPS_CPIC))
+    elf_elfheader (obfd)->e_flags |= EF_MIPS_CPIC;
+  if (! (new_flags & EF_MIPS_PIC))
+    elf_elfheader (obfd)->e_flags &= ~EF_MIPS_PIC;
+
+  new_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
+  old_flags &= ~ (EF_MIPS_PIC | EF_MIPS_CPIC);
 
   /* Compare the ISAs.  */
   if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags))
index 12ac66678bbfb0b15e55dde5acdbb58e5b1153e0..20b8a816d92eaceb73c07422eb3e3c00f0e71766 100644 (file)
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -27,6 +27,9 @@
 
 #include "libhppa.h"
 
+/* Enable PA2.0 if available */
+#define PA_2_0
+
 #include <a.out.h>
 #include <lst.h>
 #include <ar.h>
index 0e1738639598773793d4426e24dd576fa2281ee7..f9de765b097a4aada9cdc6c06c1a5e2d636fdcef 100644 (file)
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030521
+#define BFD_VERSION_DATE 20030523
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING @bfd_version_string@
index fa3d44f80ec155dd26092d497bafce2dca539e33..e0d5acfb6b21ca6d3af88fb0020b1d6610a6f433 100755 (executable)
--- a/configure
+++ b/configure
@@ -1958,7 +1958,7 @@ fi
 
 # Some systems (e.g., one of the i386-aix systems the gas testers are
 # using) don't handle "\$" correctly, so don't use it here.
-tooldir='$(exec_prefix)'/${target_alias}
+tooldir='${exec_prefix}'/${target_alias}
 build_tooldir=${tooldir}
 
 # Generate a default definition for YACC.  This is used if the makefile can't
index 9cf50e6ec024d5b0df90afa96b7a7b92ff985f99..5e2bed1cfc35bac7bc15920fd9f7e0c8b9dfb709 100644 (file)
@@ -1,3 +1,163 @@
+2003-05-26  Elena Zannoni  <ezannoni@redhat.com>
+
+       * stabsread.c (dbx_lookup_type): Make static.
+       (read_type): Ditto.
+       (add_undefined_type): Ditto.
+       * stabsread.h (dbx_lookup_type, read_type, add_undefined_type): Do
+       not export.
+
+2003-05-26  Elena Zannoni  <ezannoni@redhat.com>
+
+       * hpread.c (hpread_has_name): Make static.
+       (hpread_psymtab_to_symtab): Ditto.
+       (file_exists): Ditto.
+       (hpread_call_pxdb): Ditto.
+       (hpread_pxdb_needed): Ditto.
+       (hpread_quick_traverse): Ditto.
+       (hpread_get_header): Ditto.
+       (hpread_get_lntt): Ditto.
+       (hpread_get_slt): Ditto.
+       (class_of): Ditto.
+
+2003-05-25  Andreas Schwab  <schwab@suse.de>
+
+       * m68k-tdep.c (m68k_gdbarch_init): Set parm_boundary instead of
+       stack_align and deprecated_extra_stack_alignment_needed.
+       (m68k_stack_align): Delete.
+
+       * m68k-tdep.c (m68k_register_raw_size): Remove cast.
+       (m68k_register_virtual_size): Likewise.
+       (altos_skip_prologue): Remove obsolete function.
+       (isi_frame_num_args): Likewise.
+       (news_frame_num_args): Likewise.
+       (m68k_fix_call_dummy): Make static.
+       (m68k_push_dummy_frame): Likewise.
+       (m68k_pop_frame): Likewise.
+       (m68k_skip_prologue): Likewise.
+       (m68k_frame_init_saved_regs): Likewise.
+       (m68k_saved_pc_after_call): Likewise.
+       (m68k_get_longjmp_target): Make multi-arch.
+       (m68k_gdbarch_init): Allocate and initialize gdbarch_tdep
+       structure.  Register m68k_get_longjmp_target if enabled.
+       * m68k-tdep.h (struct gdbarch_tdep): Define.
+       * config/m68k/tm-m68k.h: Don't include "regcache.h".
+
+       * Makefile.in (config.status): Also depend on configure.tgt
+       and configure.host.
+       (m68klinux-tdep.o): Update dependencies.
+       * configure.tgt (m68*-*-linux*): Set gdb_multi_arch to 1.
+       * m68klinux-tdep.c (M68K_LINUX_JB_ELEMENT_SIZE): Define.
+       (M68K_LINUX_JB_PC): Define.
+       (m68k_linux_pc_in_sigtramp): Renamed from m68k_linux_in_sigtramp
+       and take additional parameter.
+       (m68k_linux_sigtramp_saved_pc): Update.
+       (m68k_linux_init_abi): Set jb_pc and jb_elt_size.  Register
+       m68k_linux_pc_in_sigtramp, in_plt_section,
+       find_solib_trampoline_target.
+       * config/m68k/tm-linux.h: Don't include any tm headers.
+       (START_INFERIOR_TRAPS_EXPECTED): Remove definition.
+       (JB_ELEMENT_SIZE): Likewise.
+       (JB_PC): Likewise.
+       (GET_LONGJMP_TARGET): Likewise.
+       (IN_SIGTRAMP): Likewise.
+       (SVR4_SHARED_LIBS): Define this and include "solib.h".
+
+2003-05-25  Mark Kettenis  <kettenis@gnu.org>
+
+       * sparc-tdep.c (sparc32_do_push_arguments): New function.
+       (sparc32_push_arguments): Re-implement by calling
+       sparc32_do_push_arguments.
+
+2003-05-25  Mark Kettenis  <kettenis@gnu.org>
+
+       * sparc-tdep.c (SPARC_F0_REGNUM, SPARC_F1_REGNUM, SPARC_O0_REGNUM,
+       SPARC_O1_REGNUM): New defines.
+       (sparc32_extract_return_value): Rewrite to operate on a regcache.
+       (sparc32_store_return_value): New function.
+       (sparc_extract_struct_value_address): Rewrite to operate on a
+       regcache.
+       (sparc_gdbarch_init): Don't set
+       deprecated_extract_struct_value_address.  Set
+       extract_struct_value_address instead. Don't set
+       deprecated_extract_return_value and deprecated_store_return_value
+       for 32-bit targets.  Set extract_return_value and
+       store_return_value instead.
+       * config/sparc/tm-sparc.h (DEPRECATED_STORE_RETURN_VALUE,
+       DEPRECTAED_EXTRACT_RETURN_VALUE,
+       DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS): Don't define these.
+       (STORE_RETURN_VALUE, EXTRACT_RETURN_VALUE,
+       EXTRACT_STRUCT_VALUE_ADDRESS): Define these instead.
+       (sparc_store_return_value): Remove prototype.
+       (sparc32_store_return_value): New prototype.
+       (sparc32_extract_return_value, sparc_extract_struct_value_address):
+       Adjust prototypes.
+
+2003-05-24  Mark Kettenis  <kettenis@gnu.org>
+
+       * sparcnbsd-tdep.c: Include "gdb_string.h".
+
+2003-05-23  Andrew Cagney  <cagney@redhat.com>
+
+       * p-valprint.c (pascal_val_print): Replace extract_address with
+       the inline equivalent extract_unsigned_integer.
+       * jv-valprint.c (java_value_print): Ditto.
+       * ada-valprint.c (ada_val_print_1): Ditto.
+       * ada-lang.h (EXTRACT_ADDRESS): Ditto.
+
+2003-05-23  Theodore A. Roth  <troth@openavr.org>
+
+       * blockframe.c (frameless_look_for_prologue): Remove unused
+       after_prologue variable.
+
+2003-05-23  Mark Kettenis  <kettenis@gnu.org>
+
+       * blockframe.c (get_pc_function_start): Rewrite to avoid
+       asignments in if-statements.
+
+2003-05-23  Raoul Gough  <RaoulGough@yahoo.co.uk>
+
+       Committed by Elena Zannoni  <ezannoni@redhat.com>.
+       * coffread.c(coff_symtab_read): Do relocate static symbols from PE
+       files, don't relocate absolute symbols (and do use mst_abs).
+
+2003-05-23  Andrew Cagney  <cagney@redhat.com>
+
+       * objc-lang.c: Include "gdb_assert.h".
+       (objc_op_print_tab): Use OP_NULL and PREC_NULL instead of 0.
+       (CHECK, CHECK_FATAL, __CHECK_FUNCTION): Delete macros.
+       (gdb_check, gdb_check_fatal): Delete functions.
+       (read_objc_methlist_method): Replace CHECK and CHECK_FATAL with
+       gdb_assert.
+       (parse_selector, parse_method, find_methods, find_imps): Ditto.
+       * Makefile.in (objc-lang.o): Update dependencies.
+
+2003-05-22  Ian Lance Taylor  <ian@airs.com>
+
+       * disasm.c (gdb_disassemble_info): Initialize disassemble_info
+       with fprintf_filtered, not fprintf_unfiltered.
+
+2003-05-22  Andrew Cagney  <cagney@redhat.com>
+
+       * stack.c (frame_info): Inline extract_address, replacing it with
+       extract_unsigned_integer.
+       * findvar.c (unsigned_pointer_to_address): Ditto.
+       * dwarf2loc.c (dwarf_expr_read_reg): Ditto.
+       * dwarf2expr.c (dwarf2_read_address): Ditto.
+       * frame.c (frame_pc_unwind): Update comment.
+       * dummy-frame.c (deprecated_read_register_dummy): Update comment.
+
+2003-05-22  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * infptrace.c (detach): Call print_sys_errmsg rather than
+       perror_with_name to issue warning message when errno is non-zero
+       after calling ptrace detach.
+
+2003-05-21  J. Brobecker  <brobecker@gnat.com>
+
+       * config/pa/tm-hppa.h: Delete some unused macros. Move some
+       macro definitions from here...
+       * hppa-tdep.c: ...to there.
+
 2003-05-20  Kevin Buettner  <kevinb@redhat.com>
 
        * mips-nat.c (REGISTER_PTRACE_ADDR): Convert macro to function
index 38be4f6aadb1d8a99e219840e8c0cf41a6de8f55..c52eadccfc1769cb15eb98ec0b93a7caeb4861ce 100644 (file)
@@ -1157,7 +1157,7 @@ config.h: stamp-h ; @true
 stamp-h: config.in config.status
        CONFIG_HEADERS=config.h:config.in $(SHELL) config.status
 
-config.status: configure
+config.status: configure configure.tgt configure.host
        $(SHELL) config.status --recheck
 
 force:
@@ -1923,7 +1923,8 @@ m68klinux-nat.o: m68klinux-nat.c $(defs_h) $(frame_h) $(inferior_h) \
        $(language_h) $(gdbcore_h) $(gdb_string_h) $(regcache_h) \
        $(m68k_tdep_h) $(gdb_stat_h) $(floatformat_h) $(target_h)
 m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
-       $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_h) $(m68k_tdep_t)
+       $(target_h) $(gdb_string_h) $(gdbtypes_h) $(osabi_h) $(regcache_h) \
+       $(objfiles_h) $(symtab_h) $(m68k_tdep_t)
 m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
        $(regcache_h)
 m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h)
@@ -2007,7 +2008,7 @@ objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
        $(parser_defs_h) $(language_h) $(c_lang_h) $(objc_lang_h) \
        $(complaints_h) $(value_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
        $(target_h) $(gdbcore_h) $(gdbcmd_h) $(frame_h) $(gdb_regex_h) \
-       $(regcache_h) $(block_h) $(infcall_h) $(valprint_h)
+       $(regcache_h) $(block_h) $(infcall_h) $(valprint_h) $(gdb_assert_h)
 objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
        $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \
        $(gdb_obstack_h) $(gdb_string_h) $(breakpoint_h) $(mmalloc_h) \
index ae863bd055779300bc09cd2a795ad50320e59c52..54e56bb0529cb0cf3af36b3a8a7824d94ab53080 100644 (file)
@@ -27,9 +27,9 @@ struct partial_symbol;
 
 struct block;
 
-/* A macro to reorder the bytes of an address depending on the endiannes
-   of the target */
-#define EXTRACT_ADDRESS(x) ((void *) extract_address (&(x), sizeof (x)))
+/* A macro to reorder the bytes of an address depending on the
+   endiannes of the target.  */
+#define EXTRACT_ADDRESS(x) ((void *) extract_unsigned_integer (&(x), sizeof (x)))
 /* A macro to reorder the bytes of an int depending on the endiannes
    of the target */
 #define EXTRACT_INT(x) ((int) extract_signed_integer (&(x), sizeof (x)))
index 11c42bf9e67184f49664f453c13725c9627ee7d2..f5f411898b2716dfe07e5c211ddf8431e8654984 100644 (file)
@@ -742,9 +742,11 @@ ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
       if (addressprint)
        {
          fprintf_filtered (stream, "@");
+         /* Extract an address, assume that the address is unsigned.  */
          print_address_numeric
-           (extract_address (valaddr,
-                             TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
+           (extract_unsigned_integer (valaddr,
+                                      TARGET_PTR_BIT / HOST_CHAR_BIT),
+            1, stream);
          if (deref_ref)
            fputs_filtered (": ", stream);
        }
index 3c713763a7146fe4eb0b20b1093721863f39890f..9f9122674678a5c0ca895826677a486512a6bd4e 100644 (file)
@@ -144,7 +144,7 @@ inside_entry_func (CORE_ADDR pc)
 int
 frameless_look_for_prologue (struct frame_info *frame)
 {
-  CORE_ADDR func_start, after_prologue;
+  CORE_ADDR func_start;
 
   func_start = get_frame_func (frame);
   if (func_start)
@@ -223,28 +223,31 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
 CORE_ADDR
 get_pc_function_start (CORE_ADDR pc)
 {
-  register struct block *bl;
-  register struct symbol *symbol;
-  register struct minimal_symbol *msymbol;
-  CORE_ADDR fstart;
+  struct block *bl;
+  struct minimal_symbol *msymbol;
 
-  if ((bl = block_for_pc (pc)) != NULL &&
-      (symbol = block_function (bl)) != NULL)
-    {
-      bl = SYMBOL_BLOCK_VALUE (symbol);
-      fstart = BLOCK_START (bl);
-    }
-  else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL)
+  bl = block_for_pc (pc);
+  if (bl)
     {
-      fstart = SYMBOL_VALUE_ADDRESS (msymbol);
-      if (!find_pc_section (fstart))
-       return 0;
+      struct symbol *symbol = block_function (bl);
+
+      if (symbol)
+       {
+         bl = SYMBOL_BLOCK_VALUE (symbol);
+         return BLOCK_START (bl);
+       }
     }
-  else
+
+  msymbol = lookup_minimal_symbol_by_pc (pc);
+  if (msymbol)
     {
-      fstart = 0;
+      CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol);
+
+      if (find_pc_section (fstart))
+       return fstart;
     }
-  return (fstart);
+
+  return 0;
 }
 
 /* Return the symbol for the function executing in frame FRAME.  */
index 6daf7b4acc59d6010d1adcb88b52de1793591736..81def0aac9c44b184796c3aaa2038493a9b23a98 100644 (file)
@@ -869,7 +869,6 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
               print_address_symbolic work right without the (now
               gone) "set fast-symbolic-addr off" kludge.  */
 
-           /* FIXME: should use mst_abs, and not relocate, if absolute.  */
            enum minimal_symbol_type ms_type;
            int sec;
 
@@ -891,12 +890,23 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
                  || cs->c_sclass == C_THUMBEXT ?
                  mst_bss : mst_file_bss;
              }
+           else if (cs->c_secnum == N_ABS)
+             {
+               /* Use the correct minimal symbol type (and don't
+                  relocate) for absolute values. */
+               ms_type = mst_abs;
+               sec = cs_to_section (cs, objfile);
+               tmpaddr = cs->c_value;
+             }
            else
              {
                sec = cs_to_section (cs, objfile);
                tmpaddr = cs->c_value;
-               if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
-                   || cs->c_sclass == C_THUMBEXT)
+               /* Statics in a PE file also get relocated */
+               if (cs->c_sclass == C_EXT
+                   || cs->c_sclass == C_THUMBEXTFUNC
+                   || cs->c_sclass == C_THUMBEXT
+                   || (pe_file && (cs->c_sclass == C_STAT)))
                  tmpaddr += ANOFFSET (objfile->section_offsets, sec);
 
                if (sec == SECT_OFF_TEXT (objfile))
index 636df0bb7338ea94563f0d99bea98f6244565c60..fc191b16404cc9ec41ae52ee9f9babb3a14ce229 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "config/tm-linux.h"
-#include "m68k/tm-m68k.h"
-
-#include "regcache.h"
-
-/* Number of traps that happen between exec'ing the shell to run an
-   inferior, and when we finally get to the inferior code.  This is 2
-   on most implementations.  */
-
-#define START_INFERIOR_TRAPS_EXPECTED 2
-
-/* Offsets (in target ints) into jmp_buf.  */
-
-#define JB_ELEMENT_SIZE 4
-#define JB_PC 7
-
-/* Figure out where the longjmp will land.  Slurp the args out of the stack.
-   We expect the first arg to be a pointer to the jmp_buf structure from which
-   we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
-   This routine returns true on success */
-
-#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
-
-#define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc)
-extern int m68k_linux_in_sigtramp (CORE_ADDR pc);
+/* We define SVR4_SHARED_LIBS unconditionally, on the assumption that
+   link.h is available on all linux platforms.  For I386 and SH3/4, 
+   we hard-code the information rather than use link.h anyway (for 
+   the benefit of cross-debugging).  We may move to doing that for
+   other architectures as well.  */
+
+#define SVR4_SHARED_LIBS
+#include "solib.h"             /* Support for shared libraries. */
index cb72c982f809c4f7200b4838434b4c78a9ce8299..f773428a2f0188bee0dc46f478bd3052842f8d68 100644 (file)
@@ -1,6 +1,6 @@
 /* Parameters for execution on a 68000 series machine.
    Copyright 1986, 1987, 1989, 1990, 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2003 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,8 +19,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "regcache.h"
-
 #define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
 
 extern int m68k_get_longjmp_target (CORE_ADDR *);
index 070c83ce514ef87afd9f7938d6fe86fdbbf8fd64..290f752d0a34dbecddb2fe2996d3939657024060 100644 (file)
@@ -35,8 +35,10 @@ struct frame_info;
 #include "somsolib.h"
 #endif
 
+#if !GDB_MULTI_ARCH
 extern int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name);
 #define PC_IN_SIGTRAMP(pc, name) hppa_hpux_pc_in_sigtramp (pc, name)
+#endif
 
 extern void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
                                                   CORE_ADDR *tmp);
index ab18477fab9d4cbe9faf828644f8c2058d5af53b..e51eb63217dc956a1d030057549e85fd781a4e86 100644 (file)
@@ -267,17 +267,16 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
 /* Write into appropriate registers a function return value of type
    TYPE, given in virtual format.  */
 
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE, VALBUF) \
-     sparc_store_return_value (TYPE, VALBUF)
-extern void sparc_store_return_value (struct type *, char *);
+#define STORE_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
+     sparc32_store_return_value (TYPE, REGCACHE, VALBUF)
+extern void sparc32_store_return_value (struct type *, struct regcache *,
+                                       const void *);
 
-/* Extract from an array REGBUF containing the (raw) register state
-   the address in which a function should return its structure value,
-   as a CORE_ADDR (or an expression that can be used as one).  */
-
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
-     sparc_extract_struct_value_address (REGBUF)
+/* Extract from REGCACHE the address in which a function should return
+   its structure value.  */
 
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGCACHE) \
+     sparc_extract_struct_value_address (REGCACHE)
 extern CORE_ADDR sparc_extract_struct_value_address (char *);
 
 /* Stack must be aligned on 64-bit boundaries when synthesizing
@@ -668,9 +667,10 @@ extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int,
    function return value of type TYPE, and copy that, in virtual
    format, into VALBUF.  */
 
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
-     sparc32_extract_return_value (TYPE, REGBUF, VALBUF)
-extern void sparc32_extract_return_value (struct type *, char[], char *);
+#define EXTRACT_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
+     sparc32_extract_return_value (TYPE, REGCACHE, VALBUF)
+extern void sparc32_extract_return_value (struct type *, struct regcache *,
+                                         void *valbuf);
 
 #endif /* GDB_MULTI_ARCH */
 
index fe4cc5d485677c10e817cd180f3e9d55de1a0b2f..955b3a47a6985071dc752bb3c20b2e9751b63c74 100644 (file)
@@ -130,6 +130,7 @@ m68*-*-aout*)               gdb_target=monitor ;;
 m68*-*-coff*)          gdb_target=monitor ;;
 m68*-*-elf*)           gdb_target=monitor ;;
 m68*-*-linux*)         gdb_target=linux
+                       gdb_multi_arch=1
                        build_gdbserver=yes
                        ;;
 m68*-*-lynxos*)                gdb_target=m68klynx ;;
index c8a2029bae8ed31858435bc888b80d9929809c90..553ca1cfc00097f415dc4908baf570ee7d05ad32 100644 (file)
@@ -315,7 +315,7 @@ gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
 {
   disassemble_info di;
   INIT_DISASSEMBLE_INFO_NO_ARCH (di, file,
-                                (fprintf_ftype) fprintf_unfiltered);
+                                (fprintf_ftype) fprintf_filtered);
   di.flavour = bfd_target_unknown_flavour;
   di.memory_error_func = dis_asm_memory_error;
   di.print_address_func = dis_asm_print_address;
index ca11bd675f094f64f278e165ba92e9390922b4b3..94413f4baef05b0c5d171a1525cedadb5de3c5a3 100644 (file)
@@ -183,7 +183,7 @@ deprecated_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
       /* NOTE: cagney/2002-08-12: Replaced a call to
         regcache_raw_read_as_address() with a call to
         regcache_cooked_read_unsigned().  The old, ...as_address
-        function was eventually calling extract_unsigned_integer (via
+        function was eventually calling extract_unsigned_integer (nee
         extract_address) to unpack the registers value.  The below is
         doing an unsigned extract so that it is functionally
         equivalent.  The read needs to be cooked as, otherwise, it
index 410cd54c6227f198cb5c8a771d0958461dd13553..aa391ebd6a5e0b698ee7e808351fdb16daaeec2d 100644 (file)
@@ -178,7 +178,9 @@ dwarf2_read_address (unsigned char *buf, unsigned char *buf_end, int *bytes_read
     error ("dwarf2_read_address: Corrupted DWARF expression.");
 
   *bytes_read = TARGET_ADDR_BIT / TARGET_CHAR_BIT;
-  result = extract_address (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
+  /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
+     address is always unsigned.  That may or may not be true.  */
+  result = extract_unsigned_integer (buf, TARGET_ADDR_BIT / TARGET_CHAR_BIT);
   return result;
 }
 
index 2bb4f268a0b286764a134d2d2a3c7eb75cff26c4..9ed6b7e9665c64a700c0ff61dda44460fbb5c841 100644 (file)
@@ -124,7 +124,9 @@ dwarf_expr_read_reg (void *baton, int dwarf_regnum)
 
   frame_register (debaton->frame, regnum, &optimized, &lval_type, &save_addr,
                  &realnum, buf);
-  result = extract_address (buf, regsize);
+  /* NOTE: cagney/2003-05-22: This extract is assuming that a DWARF 2
+     address is always unsigned.  That may or may not be true.  */
+  result = extract_unsigned_integer (buf, regsize);
 
   return result;
 }
index c9623bf2c4d87802a856fa3062177fc30598b0cf..5d975e43c855ea54171681f2d46c08cb019be77e 100644 (file)
@@ -333,7 +333,7 @@ value_of_register (int regnum, struct frame_info *frame)
 CORE_ADDR
 unsigned_pointer_to_address (struct type *type, const void *buf)
 {
-  return extract_address (buf, TYPE_LENGTH (type));
+  return extract_unsigned_integer (buf, TYPE_LENGTH (type));
 }
 
 CORE_ADDR
index fe863d69d3351e202d56074a0cb1a88e0f7f4270..07e0e5b15b62958e2d0ad34fdb1fdb692d6255e7 100644 (file)
@@ -376,7 +376,7 @@ frame_pc_unwind (struct frame_info *this_frame)
             implementation is no more than:
           
             frame_unwind_register (this_frame, ISA_PC_REGNUM, buf);
-            return extract_address (buf, size of ISA_PC_REGNUM);
+            return extract_unsigned_integer (buf, size of ISA_PC_REGNUM);
 
             Note: this method is very heavily dependent on a correct
             register-unwind implementation, it pays to fix that
index e8d62db6579db1e870aa4342bc86fcf21cb974e0..1f78d06d164723cfb940f0247184f54e2c7f7ed0 100644 (file)
 /* Some local constants.  */
 static const int hppa_num_regs = 128;
 
+/* Get at various relevent fields of an instruction word. */
+#define MASK_5 0x1f
+#define MASK_11 0x7ff
+#define MASK_14 0x3fff
+#define MASK_21 0x1fffff
+
+/* Define offsets into the call dummy for the target function address.
+   See comments related to CALL_DUMMY for more info.  */
+#define FUNC_LDIL_OFFSET (INSTRUCTION_SIZE * 9)
+#define FUNC_LDO_OFFSET (INSTRUCTION_SIZE * 10)
+
+/* Define offsets into the call dummy for the _sr4export address.
+   See comments related to CALL_DUMMY for more info.  */
+#define SR4EXPORT_LDIL_OFFSET (INSTRUCTION_SIZE * 12)
+#define SR4EXPORT_LDO_OFFSET (INSTRUCTION_SIZE * 13)
+
 /* To support detection of the pseudo-initial frame
    that threads have. */
 #define THREAD_INITIAL_FRAME_SYMBOL  "__pthread_exit"
 #define THREAD_INITIAL_FRAME_SYM_LEN  sizeof(THREAD_INITIAL_FRAME_SYMBOL)
 
+/* Sizes (in bytes) of the native unwind entries.  */
+#define UNWIND_ENTRY_SIZE 16
+#define STUB_UNWIND_ENTRY_SIZE 8
+
+static int get_field (unsigned word, int from, int to);
+
 static int extract_5_load (unsigned int);
 
 static unsigned extract_5R_store (unsigned int);
@@ -224,6 +246,15 @@ low_sign_extend (unsigned val, unsigned bits)
   return (int) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1);
 }
 
+/* Extract the bits at positions between FROM and TO, using HP's numbering
+   (MSB = 0). */
+
+static int
+get_field (unsigned word, int from, int to)
+{
+  return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1));
+}
+
 /* extract the immediate field from a ld{bhw}s instruction */
 
 static int
@@ -275,15 +306,15 @@ extract_21 (unsigned word)
 
   word &= MASK_21;
   word <<= 11;
-  val = GET_FIELD (word, 20, 20);
+  val = get_field (word, 20, 20);
   val <<= 11;
-  val |= GET_FIELD (word, 9, 19);
+  val |= get_field (word, 9, 19);
   val <<= 2;
-  val |= GET_FIELD (word, 5, 6);
+  val |= get_field (word, 5, 6);
   val <<= 5;
-  val |= GET_FIELD (word, 0, 4);
+  val |= get_field (word, 0, 4);
   val <<= 2;
-  val |= GET_FIELD (word, 7, 8);
+  val |= get_field (word, 7, 8);
   return sign_extend (val, 21) << 11;
 }
 
@@ -296,15 +327,15 @@ deposit_21 (unsigned opnd, unsigned word)
 {
   unsigned val = 0;
 
-  val |= GET_FIELD (opnd, 11 + 14, 11 + 18);
+  val |= get_field (opnd, 11 + 14, 11 + 18);
   val <<= 2;
-  val |= GET_FIELD (opnd, 11 + 12, 11 + 13);
+  val |= get_field (opnd, 11 + 12, 11 + 13);
   val <<= 2;
-  val |= GET_FIELD (opnd, 11 + 19, 11 + 20);
+  val |= get_field (opnd, 11 + 19, 11 + 20);
   val <<= 11;
-  val |= GET_FIELD (opnd, 11 + 1, 11 + 11);
+  val |= get_field (opnd, 11 + 1, 11 + 11);
   val <<= 1;
-  val |= GET_FIELD (opnd, 11 + 0, 11 + 0);
+  val |= get_field (opnd, 11 + 0, 11 + 0);
   return word | val;
 }
 
@@ -314,9 +345,9 @@ deposit_21 (unsigned opnd, unsigned word)
 static int
 extract_17 (unsigned word)
 {
-  return sign_extend (GET_FIELD (word, 19, 28) |
-                     GET_FIELD (word, 29, 29) << 10 |
-                     GET_FIELD (word, 11, 15) << 11 |
+  return sign_extend (get_field (word, 19, 28) |
+                     get_field (word, 29, 29) << 10 |
+                     get_field (word, 11, 15) << 11 |
                      (word & 0x1) << 16, 17) << 2;
 }
 \f
index 958507f748a4115104679ddacd7125103ff29639..f955fb9c5536cf3aa7ae7cfc5baafa1f4fcf0fab 100644 (file)
@@ -140,9 +140,7 @@ lbrac_mismatch_complaint (int arg1)
 
 /* Forward procedure declarations */
 
-static void set_namestring (union dnttentry *sym, char **namep,
-                            struct objfile *objfile);
-
+/* Used in somread.c.  */
 void hpread_symfile_init (struct objfile *);
 
 void do_pxdb (bfd *);
@@ -151,6 +149,9 @@ void hpread_build_psymtabs (struct objfile *, int);
 
 void hpread_symfile_finish (struct objfile *);
 
+static void set_namestring (union dnttentry *sym, char **namep,
+                            struct objfile *objfile);
+
 static union dnttentry *hpread_get_gntt (int, struct objfile *);
 
 static union dnttentry *hpread_get_lntt (int index, struct objfile *objfile);
@@ -172,11 +173,11 @@ static unsigned long hpread_get_line (sltpointer, struct objfile *);
 
 static CORE_ADDR hpread_get_location (sltpointer, struct objfile *);
 
-int hpread_has_name (enum dntt_entry_type kind);
+static int hpread_has_name (enum dntt_entry_type kind);
 
 static void hpread_psymtab_to_symtab_1 (struct partial_symtab *);
 
-void hpread_psymtab_to_symtab (struct partial_symtab *);
+static void hpread_psymtab_to_symtab (struct partial_symtab *);
 
 static struct symtab *hpread_expand_symtab
   (struct objfile *, int, int, CORE_ADDR, int,
@@ -261,7 +262,7 @@ static struct type *fixup_method = NULL;
 #include "gdb_string.h"
 
 /* check for the existence of a file, given its full pathname */
-int
+static int
 file_exists (char *filename)
 {
   if (filename)
@@ -321,7 +322,7 @@ set_namestring (union dnttentry *sym, char **namep, struct objfile *objfile)
    NOTE: uses system function and string functions directly.
 
    Return value: 1 if ok, 0 if not */
-int
+static int
 hpread_call_pxdb (const char *file_name)
 {
   char *p;
@@ -354,7 +355,7 @@ hpread_call_pxdb (const char *file_name)
    by PXDB, and we have thus called PXDB to do this processing
    and the file therefore needs to be re-loaded.  Otherwise
    return 0. */
-int
+static int
 hpread_pxdb_needed (bfd *sym_bfd)
 {
   asection *pinfo_section, *debug_section, *header_section;
@@ -837,7 +838,7 @@ scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
    a file can result in a compiled object which does not have a module
    entry for it, so in such cases we create a psymtab for the file.  */
 
-int
+static int
 hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
                       char *vt_bits, PXDB_header_ptr pxdb_header_p)
 {
@@ -1542,7 +1543,7 @@ hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
 
 /* Get appropriate header, based on pxdb type. 
    Return value: 1 if ok, 0 if not */
-int
+static int
 hpread_get_header (struct objfile *objfile, PXDB_header_ptr pxdb_header_p)
 {
   asection *pinfo_section, *debug_section, *header_section;
@@ -2294,7 +2295,7 @@ hpread_symfile_finish (struct objfile *objfile)
 
 /* Various small functions to get entries in the debug symbol sections.  */
 
-union dnttentry *
+static union dnttentry *
 hpread_get_lntt (int index, struct objfile *objfile)
 {
   return (union dnttentry *)
@@ -2308,7 +2309,7 @@ hpread_get_gntt (int index, struct objfile *objfile)
     &(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
 }
 
-union sltentry *
+static union sltentry *
 hpread_get_slt (int index, struct objfile *objfile)
 {
   return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]);
@@ -2588,7 +2589,7 @@ hpread_get_location (sltpointer index, struct objfile *objfile)
  * leave it here in case it proves useful later on. - RT).
  */
 
-int
+static int
 hpread_has_name (enum dntt_entry_type kind)
 {
   switch (kind)
@@ -2721,7 +2722,7 @@ hpread_psymtab_to_symtab_1 (struct partial_symtab *pst)
 /* Read in all of the symbols for a given psymtab for real.
    Be verbose about it if the user wants that.  */
 
-void
+static void
 hpread_psymtab_to_symtab (struct partial_symtab *pst)
 {
   /* Get out quick if given junk.  */
@@ -5016,7 +5017,7 @@ hpread_record_lines (struct subfile *subfile, sltpointer s_idx,
  * Called from hpread_process_one_debug_symbol()
  * If "f" is not a member function, return NULL.
  */
-char *
+static char *
 class_of (struct type *functype)
 {
   struct type *first_param_type;
index 1225dd8a62c133441785edaee45207033a8e89c3..6147cbe896453cc65bcea376257cfeb8a7245a42 100644 (file)
@@ -301,8 +301,8 @@ detach (int signal)
   errno = 0;
   ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1,
           signal);
-  if (errno && errno != ESRCH)
-    perror_with_name ("ptrace");
+  if (errno)
+    print_sys_errmsg ("ptrace", errno);
   attach_flag = 0;
 }
 #endif /* ATTACH_DETACH */
index 8620175bbbaccd1f21ba169c8025e4a41add1db5..ef258475fde737629cc2ba2926525ecbe651d30c 100644 (file)
@@ -110,14 +110,22 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
                {
                  read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 element = extract_address (buf, sizeof (buf));
+                 /* FIXME: cagney/2003-05-24: Bogus or what.  It
+                     pulls a host sized pointer out of the target and
+                     then extracts that as an address (while assuming
+                     that the address is unsigned)!  */
+                 element = extract_unsigned_integer (buf, sizeof (buf));
                }
 
              for (reps = 1; i + reps < length; reps++)
                {
                  read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 next_element = extract_address (buf, sizeof (buf));
+                 /* FIXME: cagney/2003-05-24: Bogus or what.  It
+                     pulls a host sized pointer out of the target and
+                     then extracts that as an address (while assuming
+                     that the address is unsigned)!  */
+                 next_element = extract_unsigned_integer (buf, sizeof (buf));
                  if (next_element != element)
                    break;
                }
@@ -468,7 +476,8 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset,
          /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if we ARE using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_STRUCT.) */
-         print_address_demangle (extract_address (valaddr, TYPE_LENGTH (type)),
+         /* Extract an address, assume that it is unsigned.  */
+         print_address_demangle (extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
                                  stream, demangle);
          break;
        }
index 087d0bb263342b4f5324bede9108508ed88fb4d5..fbbac634cae6a6d1eb09a8d6b626eebf61dbcdf4 100644 (file)
 #endif
 
 
-void m68k_frame_init_saved_regs (struct frame_info *frame_info);
+static void m68k_frame_init_saved_regs (struct frame_info *frame_info);
 
 
 /* gdbarch_breakpoint_from_pc is set to m68k_local_breakpoint_from_pc
    so m68k_remote_breakpoint_from_pc is currently not used.  */
 
-const static unsigned char *
+static const unsigned char *
 m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)};
@@ -91,7 +91,7 @@ m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
   return break_insn;
 }
 
-const static unsigned char *
+static const unsigned char *
 m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
   static unsigned char break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
@@ -110,13 +110,11 @@ m68k_register_bytes_ok (long numbytes)
 /* Number of bytes of storage in the actual machine representation
    for register regnum.  On the 68000, all regs are 4 bytes
    except the floating point regs which are 12 bytes.  */
-/* Note that the unsigned cast here forces the result of the
-   subtraction to very high positive values if regnum < FP0_REGNUM */
 
 static int
 m68k_register_raw_size (int regnum)
 {
-  return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+  return (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 8 ? 12 : 4);
 }
 
 /* Number of bytes of storage in the program's representation
@@ -126,7 +124,7 @@ m68k_register_raw_size (int regnum)
 static int
 m68k_register_virtual_size (int regnum)
 {
-  return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+  return (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 8 ? 12 : 4);
 }
 
 /* Return the GDB type object for the "standard" data type of data in
@@ -178,14 +176,6 @@ m68k_register_name (int regnum)
     return register_names[regnum];
 }
 
-/* Stack must be kept short aligned when doing function calls.  */
-
-static CORE_ADDR
-m68k_stack_align (CORE_ADDR addr)
-{
-  return ((addr + 1) & ~1);
-}
-
 /* Index within `registers' of the first byte of the space for
    register regnum.  */
 
@@ -296,28 +286,6 @@ m68k_frame_saved_pc (struct frame_info *frame)
 }
 
 
-/* The only reason this is here is the tm-altos.h reference below.  It
-   was moved back here from tm-m68k.h.  FIXME? */
-
-extern CORE_ADDR
-altos_skip_prologue (CORE_ADDR pc)
-{
-  register int op = read_memory_unsigned_integer (pc, 2);
-  if (op == P_LINKW_FP)
-    pc += 4;                   /* Skip link #word */
-  else if (op == P_LINKL_FP)
-    pc += 6;                   /* Skip link #long */
-  /* Not sure why branches are here.  */
-  /* From tm-altos.h */
-  else if (op == 0060000)
-    pc += 4;                   /* Skip bra #word */
-  else if (op == 00600377)
-    pc += 6;                   /* skip bra #long */
-  else if ((op & 0177400) == 0060000)
-    pc += 2;                   /* skip bra #char */
-  return pc;
-}
-
 int
 delta68_in_sigtramp (CORE_ADDR pc, char *name)
 {
@@ -353,31 +321,6 @@ delta68_frame_saved_pc (struct frame_info *frame_info)
                                       + 4, 4);
 }
 
-/* Return number of args passed to a frame.
-   Can return -1, meaning no way to tell.  */
-
-int
-isi_frame_num_args (struct frame_info *fi)
-{
-  int val;
-  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
-  int insn = read_memory_unsigned_integer (pc, 2);
-  val = 0;
-  if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
-    val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
-          || (insn & 0170777) == 0050117)      /* addqw */
-    {
-      val = (insn >> 9) & 7;
-      if (val == 0)
-       val = 8;
-    }
-  else if (insn == 0157774)    /* addal #WW, sp */
-    val = read_memory_integer (pc + 2, 4);
-  val >>= 2;
-  return val;
-}
-
 int
 delta68_frame_num_args (struct frame_info *fi)
 {
@@ -400,33 +343,11 @@ delta68_frame_num_args (struct frame_info *fi)
   return val;
 }
 
-int
-news_frame_num_args (struct frame_info *fi)
-{
-  int val;
-  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
-  int insn = read_memory_unsigned_integer (pc, 2);
-  val = 0;
-  if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
-    val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217 /* addql #N, sp */
-          || (insn & 0170777) == 0050117)      /* addqw */
-    {
-      val = (insn >> 9) & 7;
-      if (val == 0)
-       val = 8;
-    }
-  else if (insn == 0157774)    /* addal #WW, sp */
-    val = read_memory_integer (pc + 2, 4);
-  val >>= 2;
-  return val;
-}
-
 /* Insert the specified number of args and function address
    into a call sequence of the above form stored at DUMMYNAME.
    We use the BFD routines to store a big-endian value of known size.  */
 
-void
+static void
 m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
                     struct value **args, struct type *type, int gcc_p)
 {
@@ -438,7 +359,7 @@ m68k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
 
 /* Push an empty stack frame, to record the current PC, etc.  */
 
-void
+static void
 m68k_push_dummy_frame (void)
 {
   register CORE_ADDR sp = read_register (SP_REGNUM);
@@ -468,7 +389,7 @@ m68k_push_dummy_frame (void)
 /* Discard from the stack the innermost frame,
    restoring all saved registers.  */
 
-void
+static void
 m68k_pop_frame (void)
 {
   register struct frame_info *frame = get_current_frame ();
@@ -539,7 +460,7 @@ m68k_pop_frame (void)
 
  */
 
-CORE_ADDR
+static CORE_ADDR
 m68k_skip_prologue (CORE_ADDR ip)
 {
   register CORE_ADDR limit;
@@ -580,7 +501,7 @@ m68k_skip_prologue (CORE_ADDR ip)
    ways in the stack frame.  sp is even more special:
    the address we return for it IS the sp for the next frame.  */
 
-void
+static void
 m68k_frame_init_saved_regs (struct frame_info *frame_info)
 {
   register int regnum;
@@ -905,17 +826,19 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
    we extract the pc (JB_PC) that we will land at.  The pc is copied into PC.
    This routine returns true on success. */
 
-/* NOTE: cagney/2000-11-08: For this function to be fully multi-arched
-   the macro's JB_PC and JB_ELEMENT_SIZE would need to be moved into
-   the ``struct gdbarch_tdep'' object and then set on a target ISA/ABI
-   dependant basis. */
-
 int
 m68k_get_longjmp_target (CORE_ADDR *pc)
 {
-#if defined (JB_PC) && defined (JB_ELEMENT_SIZE)
   char *buf;
   CORE_ADDR sp, jb_addr;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  if (tdep->jb_pc < 0)
+    {
+      internal_error (__FILE__, __LINE__,
+                     "m68k_get_longjmp_target: not implemented");
+      return 0;
+    }
 
   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
   sp = read_register (SP_REGNUM);
@@ -926,18 +849,12 @@ m68k_get_longjmp_target (CORE_ADDR *pc)
 
   jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
 
-  if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
+  if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf,
                          TARGET_PTR_BIT / TARGET_CHAR_BIT))
     return 0;
 
   *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-
   return 1;
-#else
-  internal_error (__FILE__, __LINE__,
-                 "m68k_get_longjmp_target: not implemented");
-  return 0;
-#endif
 }
 
 /* Immediately after a function call, return the saved pc before the frame
@@ -945,7 +862,7 @@ m68k_get_longjmp_target (CORE_ADDR *pc)
    system call, and if so, we know that Sun pushes the call # on the stack
    prior to doing the trap. */
 
-CORE_ADDR
+static CORE_ADDR
 m68k_saved_pc_after_call (struct frame_info *frame)
 {
 #ifdef SYSCALL_TRAP
@@ -979,11 +896,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (arches != NULL)
     return (arches->gdbarch);
 
-#if 0
-  tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
-#endif
-  gdbarch = gdbarch_alloc (&info, 0);
+  tdep = xmalloc (sizeof (struct gdbarch_tdep));
+  gdbarch = gdbarch_alloc (&info, tdep);
 
   /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
      ready to unwind the PC first (see frame.c:get_prev_frame()).  */
@@ -1000,8 +914,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Stack grows down. */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  set_gdbarch_stack_align (gdbarch, m68k_stack_align);
-  set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
+  set_gdbarch_parm_boundary (gdbarch, 32);
 
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
@@ -1053,9 +966,22 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Should be using push_dummy_call.  */
   set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
 
+#if defined JB_PC && defined JB_ELEMENT_SIZE
+  tdep->jb_pc = JB_PC;
+  tdep->jb_elt_size = JB_ELEMENT_SIZE;
+#else
+  tdep->jb_pc = -1;
+#endif
+
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
+  /* Now we have tuned the configuration, set a few final things,
+     based on what the OS ABI has told us.  */
+
+  if (tdep->jb_pc >= 0)
+    set_gdbarch_get_longjmp_target (gdbarch, m68k_get_longjmp_target);
+
   return gdbarch;
 }
 
@@ -1063,7 +989,10 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 static void
 m68k_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
+  if (tdep == NULL)
+    return;
 }
 
 void
index 8da568e6e27633b3f883d924e7c3cb7f07a7f219..7c499a73ca949a9560b010fdaa77650d2dad55fd 100644 (file)
@@ -1,5 +1,5 @@
 /* Common target dependent code for the Motorola 68000 series.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2003
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -44,4 +44,14 @@ enum
   M68K_FPI_REGNUM = 28
 };
 
+/* Target-dependent structure in gdbarch.  */
+struct gdbarch_tdep
+{
+  /* Offset to PC value in the jump buffer.  If this is negative,
+     longjmp support will be disabled.  */
+  int jb_pc;
+  /* The size of each entry in the jump buffer.  */
+  size_t jb_elt_size;
+};
+
 #endif /* M68K_TDEP_H */
index 8b9193d2cc3b57826bd7d634dfc77844ab7e5920..612f9fd5d9dfc92b9b316f7df09531a8850e0cf6 100644 (file)
 #include "gdb_string.h"
 #include "gdbtypes.h"
 #include "osabi.h"
+#include "regcache.h"
+#include "objfiles.h"
+#include "symtab.h"
 #include "m68k-tdep.h"
 \f
+/* Offsets (in target ints) into jmp_buf.  */
+
+#define M68K_LINUX_JB_ELEMENT_SIZE 4
+#define M68K_LINUX_JB_PC 7
+
 /* Check whether insn1 and insn2 are parts of a signal trampoline.  */
 
 #define IS_SIGTRAMP(insn1, insn2)                                      \
@@ -47,8 +55,8 @@
    of m68k_linux_frame_saved_pc we also distinguish between non-RT and RT
    signal trampolines.  */
 
-int
-m68k_linux_in_sigtramp (CORE_ADDR pc)
+static int
+m68k_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
 {
   CORE_ADDR sp;
   char buf[12];
@@ -110,7 +118,7 @@ m68k_linux_sigtramp_saved_pc (struct frame_info *frame)
 
   /* Don't cause a memory_error when accessing sigcontext in case the
      stack layout has changed or the stack is corrupt.  */
-  if (m68k_linux_in_sigtramp (get_frame_pc (frame)) == 2)
+  if (m68k_linux_pc_in_sigtramp (get_frame_pc (frame), 0) == 2)
     target_read_memory (sigcontext_addr + UCONTEXT_PC_OFFSET, buf, ptrbytes);
   else
     target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, buf, ptrbytes);
@@ -189,6 +197,11 @@ m68k_linux_extract_struct_value_address (char *regbuf)
 static void
 m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  tdep->jb_pc = M68K_LINUX_JB_PC;
+  tdep->jb_elt_size = M68K_LINUX_JB_ELEMENT_SIZE;
+
   set_gdbarch_deprecated_frame_saved_pc (gdbarch,
                                         m68k_linux_frame_saved_pc);
   set_gdbarch_deprecated_extract_return_value (gdbarch,
@@ -197,6 +210,12 @@ m68k_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                             m68k_linux_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
                                                       m68k_linux_extract_struct_value_address);
+
+  set_gdbarch_pc_in_sigtramp (gdbarch, m68k_linux_pc_in_sigtramp);
+
+  /* Shared library handling.  */
+  set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+  set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 }
 
 void
index 0b98a96b3e6716d88a936160afb3a26379660e17..c3577476eb57c78f158d14569fb5b1ce9a3adf20 100644 (file)
@@ -44,6 +44,7 @@
 #include "block.h"
 #include "infcall.h"
 #include "valprint.h"
+#include "gdb_assert.h"
 
 #include <ctype.h>
 
@@ -75,38 +76,6 @@ struct objc_method {
   CORE_ADDR imp;
 };
 
-/* Complaints about ObjC classes, selectors, etc.  */
-
-#if (!defined __GNUC__ || __GNUC__ < 2 || __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4))
-#define __CHECK_FUNCTION ((__const char *) 0)
-#else
-#define __CHECK_FUNCTION __PRETTY_FUNCTION__
-#endif
-
-#define CHECK(expression) \
-  ((void) ((expression) ? 0 : gdb_check (#expression, __FILE__, __LINE__, \
-                                         __CHECK_FUNCTION)))
-
-#define CHECK_FATAL(expression) \
-  ((void) ((expression) ? 0 : gdb_check_fatal (#expression, __FILE__, \
-                              __LINE__, __CHECK_FUNCTION)))
-
-static void 
-gdb_check (const char *str, const char *file, 
-          unsigned int line, const char *func)
-{
-  error ("assertion failure on line %u of \"%s\" in function \"%s\": %s\n",
-        line, file, func, str);
-}
-
-static void 
-gdb_check_fatal (const char *str, const char *file, 
-                unsigned int line, const char *func)
-{
-  internal_error (file, line, 
-                 "assertion failure in function \"%s\": %s\n", func, str);
-}
-
 /* Lookup a structure type named "struct NAME", visible in lexical
    block BLOCK.  If NOERR is nonzero, return zero if NAME is not
    suitably defined.  */
@@ -658,7 +627,7 @@ static const struct op_print objc_op_print_tab[] =
     {"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
     {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
     {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
-    {NULL, 0, 0, 0}
+    {NULL, OP_NULL, PREC_NULL, 0}
 };
 
 struct type ** const (objc_builtin_types[]) = 
@@ -1153,7 +1122,7 @@ parse_selector (char *method, char **selector)
 
   char *nselector = NULL;
 
-  CHECK (selector != NULL);
+  gdb_assert (selector != NULL);
 
   s1 = method;
 
@@ -1212,10 +1181,10 @@ parse_method (char *method, char *type, char **class,
   char *ncategory = NULL;
   char *nselector = NULL;
 
-  CHECK (type != NULL);
-  CHECK (class != NULL);
-  CHECK (category != NULL);
-  CHECK (selector != NULL);
+  gdb_assert (type != NULL);
+  gdb_assert (class != NULL);
+  gdb_assert (category != NULL);
+  gdb_assert (selector != NULL);
   
   s1 = method;
 
@@ -1325,8 +1294,8 @@ find_methods (struct symtab *symtab, char type,
   static char *tmp = NULL;
   static unsigned int tmplen = 0;
 
-  CHECK (nsym != NULL);
-  CHECK (ndebug != NULL);
+  gdb_assert (nsym != NULL);
+  gdb_assert (ndebug != NULL);
 
   if (symtab)
     block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
@@ -1438,8 +1407,8 @@ char *find_imps (struct symtab *symtab, struct block *block,
   char *buf = NULL;
   char *tmp = NULL;
 
-  CHECK (nsym != NULL);
-  CHECK (ndebug != NULL);
+  gdb_assert (nsym != NULL);
+  gdb_assert (ndebug != NULL);
 
   if (nsym != NULL)
     *nsym = 0;
@@ -1826,7 +1795,7 @@ static void
 read_objc_methlist_method (CORE_ADDR addr, unsigned long num, 
                           struct objc_method *method)
 {
-  CHECK_FATAL (num < read_objc_methlist_nmethods (addr));
+  gdb_assert (num < read_objc_methlist_nmethods (addr));
   read_objc_method (addr + 8 + (12 * num), method);
 }
   
index 84189dd2894877a8727caaa157934757d14f9ef0..ddd508ac0448316537354a783e41945c9c8428b1 100644 (file)
@@ -141,7 +141,8 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
          /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if we ARE using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_STRUCT.) */
-         print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
+         /* Extract the address, assume that it is unsigned.  */
+         print_address_demangle (extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type)),
                                  stream, demangle);
          break;
        }
@@ -272,9 +273,11 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
       if (addressprint)
        {
          fprintf_filtered (stream, "@");
+         /* Extract the address, assume that it is unsigned.  */
          print_address_numeric
-           (extract_address (valaddr + embedded_offset,
-                             TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
+           (extract_unsigned_integer (valaddr + embedded_offset,
+                                      TARGET_PTR_BIT / HOST_CHAR_BIT),
+            1, stream);
          if (deref_ref)
            fputs_filtered (": ", stream);
        }
@@ -312,10 +315,11 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
          /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if NOT using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_PTR.) */
-         print_address_demangle (extract_address (
-                                                   valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
-                 TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
-                                 stream, demangle);
+         /* Extract the address, assume that it is unsigned.  */
+         print_address_demangle
+           (extract_unsigned_integer (valaddr + embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+                                      TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
+            stream, demangle);
        }
       else
        {
index 6735b0814ee829bf0c5f03b86965f2572d9a1114..ab5b9732d5f83ae7b9442d1325e53bcd4936b445 100644 (file)
@@ -466,13 +466,6 @@ sparc_frame_chain (struct frame_info *frame)
   return ~ (CORE_ADDR) 0;
 }
 
-CORE_ADDR
-sparc_extract_struct_value_address (char *regbuf)
-{
-  return extract_address (regbuf + REGISTER_BYTE (O0_REGNUM),
-                         REGISTER_RAW_SIZE (O0_REGNUM));
-}
-
 /* Find the pc saved in frame FRAME.  */
 
 CORE_ADDR
@@ -2214,101 +2207,259 @@ gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
   return print_insn_sparc (memaddr, info);
 }
 \f
-/* The SPARC passes the arguments on the stack; arguments smaller
-   than an int are promoted to an int.  The first 6 words worth of 
-   args are also passed in registers o0 - o5.  */
 
-CORE_ADDR
-sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
-                       int struct_return, CORE_ADDR struct_addr)
+#define SPARC_F0_REGNUM                FP0_REGNUM      /* %f0 */
+#define SPARC_F1_REGNUM                (FP0_REGNUM + 1)/* %f1 */
+#define SPARC_O0_REGNUM                O0_REGNUM       /* %o0 */
+#define SPARC_O1_REGNUM                O1_REGNUM       /* %o1 */
+
+/* Push the arguments onto the stack and into the appropriate registers.  */
+
+static CORE_ADDR
+sparc32_do_push_arguments (struct regcache *regcache, int nargs,
+                          struct value **args, CORE_ADDR sp)
 {
-  int i, j, oregnum;
-  int accumulate_size = 0;
-  struct sparc_arg
+  CORE_ADDR *addr;
+  int size = 0;
+  int i;
+
+  /* Structure, union and quad-precision arguments are passed by
+     reference.  We allocate space for these arguments on the stack
+     and record their addresses in an array.  Array elements for
+     arguments that are passed by value will be set to zero.*/
+  addr = alloca (nargs * sizeof (CORE_ADDR));
+
+  for (i = nargs - 1; i >= 0; i--)
+    {
+      struct type *type = VALUE_ENCLOSING_TYPE (args[i]);
+      enum type_code code = TYPE_CODE (type);
+      int len = TYPE_LENGTH (type);
+
+      /* Push the contents of structure, union and quad-precision
+        arguments on the stack.  */
+      if (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION || len > 8)
+       {
+         /* Keep the stack doubleword aligned.  */
+         sp -= (len + 7) & ~7;
+         write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
+         addr[i] = sp;
+         size += 4;
+       }
+      else
+       {
+         addr[i] = 0;
+         size += (len > 4) ? 8 : 4;
+       }
+    }
+
+  /* The needed space for outgoing arguments should be a multiple of 4.  */
+  gdb_assert (size % 4 == 0);
+
+  /* Make sure we reserve space for the first six words of arguments
+     in the stack frame, even if we don't need them.  */
+  if (size < 24)
+    sp -= (24 - size);
+
+  /* Make sure we end up with a doubleword aligned stack in the end.
+     Reserve an extra word if necessary in order to accomplish this.  */
+  if ((sp - size) % 8 == 0)
+    sp -= 4;
+
+  /* Now push the arguments onto the stack.  */
+  for (i = nargs - 1; i >=0; i--)
     {
-      char *contents;
+      char buf[8];
       int len;
-      int offset;
-    };
-  struct sparc_arg *sparc_args =
-    (struct sparc_arg *) alloca (nargs * sizeof (struct sparc_arg));
-  struct sparc_arg *m_arg;
-
-  /* Promote arguments if necessary, and calculate their stack offsets
-     and sizes. */
-  for (i = 0, m_arg = sparc_args; i < nargs; i++, m_arg++)
-    {
-      struct value *arg = args[i];
-      struct type *arg_type = check_typedef (VALUE_TYPE (arg));
-      /* Cast argument to long if necessary as the compiler does it too.  */
-      switch (TYPE_CODE (arg_type))
+
+      if (addr[i])
        {
-       case TYPE_CODE_INT:
-       case TYPE_CODE_BOOL:
-       case TYPE_CODE_CHAR:
-       case TYPE_CODE_RANGE:
-       case TYPE_CODE_ENUM:
-         if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
+         store_unsigned_integer (buf, 4, addr[i]);
+         len = 4;
+       }
+      else
+       {
+         struct value *arg = args[i];
+
+         len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+
+         /* Expand signed and unsigned bytes and halfwords as needed.  */
+         if (len < 4)
            {
-             arg_type = builtin_type_long;
-             arg = value_cast (arg_type, arg);
+             arg = value_cast (builtin_type_long, arg);
+             len = 4;
            }
-         break;
-       default:
-         break;
+         else if (len > 4 && len < 8)
+           {
+             arg = value_cast (builtin_type_long_long, arg);
+             len = 4;
+           }
+
+         gdb_assert (len == 4 || len == 8);
+         memcpy (buf, VALUE_CONTENTS_ALL (arg), len);
+       }
+
+      /* We always write the argument word on the stack.  */
+      sp -= len;
+      write_memory (sp, buf, len);
+
+      /* If this argument occupies one of the first 6 words, write it
+         into the appropriate register too.  */
+      size -= len;
+      if (size < 24)
+       {
+         int regnum = SPARC_O0_REGNUM + (size / 4);
+
+         regcache_cooked_write (regcache, regnum, buf);
+         if (len == 8 && size < 20)
+           regcache_cooked_write (regcache, regnum + 1, buf + 4);
        }
-      m_arg->len = TYPE_LENGTH (arg_type);
-      m_arg->offset = accumulate_size;
-      accumulate_size = (accumulate_size + m_arg->len + 3) & ~3;
-      m_arg->contents = VALUE_CONTENTS (arg);
     }
 
-  /* Make room for the arguments on the stack.  */
-  accumulate_size += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
-  sp = ((sp - accumulate_size) & ~7) + DEPRECATED_CALL_DUMMY_STACK_ADJUST;
+  /* Reserve space for the struct/union return value pointer.  */
+  sp -= 4;
+
+  /* Stack should be doubleword aligned at this point.  */
+  gdb_assert (sp % 8 == 0);
+
+  /* Return the adjusted stack pointer.  */
+  return sp;
+}
+
+/* The SPARC passes the arguments on the stack; arguments smaller
+   than an int are promoted to an int.  The first 6 words worth of 
+   args are also passed in registers o0 - o5.  */
 
-  /* `Push' arguments on the stack.  */
-  for (i = 0, oregnum = 0, m_arg = sparc_args; 
-       i < nargs;
-       i++, m_arg++)
+CORE_ADDR
+sparc32_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+                       int struct_return, CORE_ADDR struct_addr)
+{
+  sp = sparc32_do_push_arguments (current_regcache, nargs, args, sp);
+
+  /* FIXME: kettenis/20030525: We don't let this function set the
+     struct/union return pointer just yet.  */
+#if 0
+  if (struct_return)
     {
-      write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len);
-      for (j = 0; 
-          j < m_arg->len && oregnum < 6; 
-          j += SPARC_INTREG_SIZE, oregnum++)
-       deprecated_write_register_gen (O0_REGNUM + oregnum, m_arg->contents + j);
+      char buf[4];
+
+      /* The space for the struct/union return value pointer has
+         already been reserved.  */
+      store_unsigned_integer (buf, 4, struct_addr);
+      write (sp, buf, 4);
     }
 
   return sp;
+#else
+  return sp + 4;
+#endif
 }
 
+/* Extract from REGCACHE a function return value of type TYPE and copy
+   that into VALBUF.
 
-/* Extract from an array REGBUF containing the (raw) register state
-   a function return value of type TYPE, and copy that, in virtual format,
-   into VALBUF.  */
+   Note that REGCACHE specifies the register values for the frame of
+   the calling function.  This means that we need to fetch the value
+   form %o0 and %o1, which correspond to %i0 and %i1 in the frame of
+   the called function.  */
 
 void
-sparc32_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+sparc32_extract_return_value (struct type *type, struct regcache *regcache,
+                             void *valbuf)
 {
-  int typelen = TYPE_LENGTH (type);
-  int regsize = REGISTER_RAW_SIZE (O0_REGNUM);
+  int len = TYPE_LENGTH (type);
+  char buf[8];
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
-    memcpy (valbuf, &regbuf[REGISTER_BYTE (FP0_REGNUM)], typelen);
+    {
+      if (len == 4 || len == 8)
+       {
+         regcache_cooked_read (regcache, SPARC_F0_REGNUM, buf);
+         regcache_cooked_read (regcache, SPARC_F1_REGNUM, buf + 4);
+         memcpy (valbuf, buf, len);
+         return;
+       }
+      else
+       internal_error (__FILE__, __LINE__, "\
+Cannot extract floating-point return value of %d bytes long.", len);
+    }
+
+  if (len <= 4)
+    {
+      regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf);
+      memcpy (valbuf, buf + 4 - len, len);
+    }
+  else if (len <= 8)
+    {
+      regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf);
+      regcache_cooked_read (regcache, SPARC_O1_REGNUM, buf + 4);
+      memcpy (valbuf, buf + 8 - len, len);
+    }
   else
-    memcpy (valbuf,
-           &regbuf[O0_REGNUM * regsize +
-                   (typelen >= regsize
-                    || TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE ? 0
-                    : regsize - typelen)],
-           typelen);
+    internal_error (__FILE__, __LINE__,
+                   "Cannot extract return value of %d bytes long.", len);
 }
 
+/* Write into REGBUF a function return value VALBUF of type TYPE.  */
 
-/* Write into appropriate registers a function return value
-   of type TYPE, given in virtual format.  On SPARCs with FPUs,
-   float values are returned in %f0 (and %f1).  In all other cases,
-   values are returned in register %o0.  */
+void
+sparc32_store_return_value (struct type *type, struct regcache *regcache,
+                           const void *valbuf)
+{
+  int len = TYPE_LENGTH (type);
+  char buf[8];
+
+  if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
+    {
+      const char *buf = valbuf;
+
+      if (len == 4)
+       {
+         regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
+         return;
+       }
+      else if (len == 8)
+       {
+         regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
+         regcache_cooked_write (regcache, SPARC_F1_REGNUM, buf + 4);
+         return;
+       }
+      else
+       internal_error (__FILE__, __LINE__, "\
+Cannot extract floating-point return value of %d bytes long.", len);
+    }
+
+  /* Add leading zeros to the value.  */
+  memset (buf, 0, sizeof buf);
+
+  if (len <= 4)
+    {
+      memcpy (buf + 4 - len, valbuf, len);
+      regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
+    }
+  else if (len <= 8)
+    {
+      memcpy (buf + 8 - len, valbuf, len);
+      regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
+      regcache_cooked_write (regcache, SPARC_O1_REGNUM, buf);
+    }
+  else
+    internal_error (__FILE__, __LINE__,
+                   "Cannot extract return value of %d bytes long.", len);
+}
+
+/* Extract from REGCACHE the address in which a function should return
+   its structure value.  */
+
+CORE_ADDR
+sparc_extract_struct_value_address (struct regcache *regcache)
+{
+  ULONGEST addr;
+
+  regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr);
+  return addr;
+}
+
+/* FIXME: kettenis/2003/05/24: Still used for sparc64.  */
 
 void
 sparc_store_return_value (struct type *type, char *valbuf)
@@ -3164,7 +3315,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
   set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sparc_extract_struct_value_address);
+  set_gdbarch_extract_struct_value_address (gdbarch,
+                                          sparc_extract_struct_value_address);
   set_gdbarch_deprecated_fix_call_dummy (gdbarch, sparc_gdbarch_fix_call_dummy);
   set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
   set_gdbarch_deprecated_fp_regnum (gdbarch, SPARC_FP_REGNUM);
@@ -3379,11 +3531,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   switch (info.bfd_arch_info->mach)
     {
     case bfd_mach_sparc:
-      set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value);
       set_gdbarch_num_regs (gdbarch, 72);
       set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
       set_gdbarch_register_name (gdbarch, sparc32_register_name);
-      set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
 #if 0
       // OBSOLETE       tdep->has_fpu = 1;     /* (all but sparclet and sparclite) */
 #endif
@@ -3415,11 +3567,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       // OBSOLETE       break;
 #endif
     case bfd_mach_sparc_v8plus:
-      set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value);
       set_gdbarch_num_regs (gdbarch, 72);
       set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
       set_gdbarch_register_name (gdbarch, sparc32_register_name);
-      set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
       tdep->print_insn_mach = bfd_mach_sparc;
       tdep->fp_register_bytes = 32 * 4;
 #if 0
@@ -3427,11 +3579,11 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 #endif
       break;
     case bfd_mach_sparc_v8plusa:
-      set_gdbarch_deprecated_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_extract_return_value (gdbarch, sparc32_extract_return_value);
+      set_gdbarch_store_return_value (gdbarch, sparc32_store_return_value);
       set_gdbarch_num_regs (gdbarch, 72);
       set_gdbarch_deprecated_register_bytes (gdbarch, 32*4 + 32*4 + 8*4);
       set_gdbarch_register_name (gdbarch, sparc32_register_name);
-      set_gdbarch_deprecated_store_return_value (gdbarch, sparc_store_return_value);
 #if 0
       // OBSOLETE       tdep->has_fpu = 1;     /* (all but sparclet and sparclite) */
 #endif
index ab984ff88ad437af2f0e3e379e703a63b5f4d517..1299d06972ba153dde28fc52e239c10c4c3f1249 100644 (file)
@@ -1,5 +1,5 @@
 /* Target-dependent code for SPARC systems running NetBSD.
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
@@ -26,6 +26,8 @@
 #include "value.h"
 #include "osabi.h"
 
+#include "gdb_string.h"
+
 #include "sparcnbsd-tdep.h"
 #include "nbsd-tdep.h"
 
index e0c88aa8f506ed62bdeb1276af29e177d4eda350..d49c5830d1e913b8a4bebd72c80331b706c206ee 100644 (file)
@@ -105,6 +105,8 @@ static void fix_common_block (struct symbol *, int);
 
 static int read_type_number (char **, int *);
 
+static struct type *read_type (char **, struct objfile *);
+
 static struct type *read_range_type (char **, int[2], struct objfile *);
 
 static struct type *read_sun_builtin_type (char **, int[2], struct objfile *);
@@ -146,6 +148,8 @@ static struct type *read_array_type (char **, struct type *,
 
 static struct field *read_args (char **, int, struct objfile *, int *, int *);
 
+static void add_undefined_type (struct type *);
+
 static int
 read_cpp_abbrev (struct field_info *, char **, struct type *,
                 struct objfile *);
@@ -248,7 +252,7 @@ static struct symbol *current_symbol = NULL;
    This can be used for finding the type associated with that pair
    or for associating a new type with the pair.  */
 
-struct type **
+static struct type **
 dbx_lookup_type (int typenums[2])
 {
   register int filenum = typenums[0];
@@ -2259,7 +2263,7 @@ error_type (char **pp, struct objfile *objfile)
    assume that type information starts with a digit, '-', or '(' in
    deciding whether to call read_type.  */
 
-struct type *
+static struct type *
 read_type (register char **pp, struct objfile *objfile)
 {
   register struct type *type = 0;
@@ -5128,7 +5132,7 @@ fix_common_block (struct symbol *sym, int valu)
 /* Add a type to the list of undefined types to be checked through
    once this file has been read in.  */
 
-void
+static void
 add_undefined_type (struct type *type)
 {
   if (undef_types_length == undef_types_allocated)
index b70f16242eecf6bbc9ecb80dfb104325ae2467b8..91db978153c245f18f5d6ca685c3565434cd937c 100644 (file)
@@ -130,16 +130,10 @@ EXTERN int n_this_object_header_files;
 
 EXTERN int n_allocated_this_object_header_files;
 
-extern struct type *read_type (char **, struct objfile *);
-
 extern void cleanup_undefined_types (void);
 
-extern struct type **dbx_lookup_type (int[2]);
-
 extern long read_number (char **, int);
 
-extern void add_undefined_type (struct type *);
-
 extern struct symbol *define_symbol (CORE_ADDR, char *, int, int,
                                     struct objfile *);
 
index e865270a812ff4f2d972da0853edc2ab2202c117..a0bd7a4ae68222b59daa5e4f6648d410282e8670 100644 (file)
@@ -818,7 +818,10 @@ frame_info (char *addr_exp, int from_tty)
            CORE_ADDR sp;
            frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
                                   &realnum, value);
-           sp = extract_address (value, REGISTER_RAW_SIZE (SP_REGNUM));
+           /* NOTE: cagney/2003-05-22: This is assuming that the
+               stack pointer was packed as an unsigned integer.  That
+               may or may not be valid.  */
+           sp = extract_unsigned_integer (value, REGISTER_RAW_SIZE (SP_REGNUM));
            printf_filtered (" Previous frame's sp is ");
            print_address_numeric (sp, 1, gdb_stdout);
            printf_filtered ("\n");
index 8f118767d4db48f2f823880f1d7e9144147d4d76..f0e5d82102ceee6feb251ad6e16a721e4329138e 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-22  Jim Blandy  <jimb@redhat.com>
+
+       * gdb.base/corefile.exp: Tolerate stuff after argument parens in
+       backtrace.
+       
 2003-05-20  David Carlton  <carlton@math.stanford.edu>
 
        * gdb.c++/namespace1.cc: Actually do 'cvs add' before committing
index e25c03c2ea6220d50460c130cf0e091f2edb1f53..73217775e0d84f2e82addbc5114dfc76833ccefa 100644 (file)
@@ -227,6 +227,6 @@ gdb_expect {
 
 gdb_load ${binfile}
 setup_xfail "*-*-*" CLLbs17002
-gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)"
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)"
 
 gdb_test "core" "No core file now."
index 8379ea398ecc944b75b280192d56d4922ea11dff..4c17a67d46c284a90ab49707bae54999cb3cefc2 100644 (file)
@@ -1 +1 @@
-2003-05-21-cvs
+2003-05-28-cvs
index 48004d0b674a0ce671192f4b8401ab1f896086d0..9514813354bc192b39e60e73ded210a272b7be6e 100644 (file)
@@ -1,11 +1,26 @@
+2003-05-23  Jason Eckhardt  <jle@rice.edu>
+
+       * i860.h (expand_type): Add XP_ONLY.
+       (scyc.b): New XP instruction.
+       (ldio.l): Likewise.
+       (ldio.s): Likewise.
+       (ldio.b): Likewise.
+       (ldint.l): Likewise.
+       (ldint.s): Likewise.
+       (ldint.b): Likewise.
+       (stio.l): Likewise.
+       (stio.s): Likewise.
+       (stio.b): Likewise.
+       (pfld.q): Likewise.
+
 2003-05-20  Jason Eckhardt  <jle@rice.edu>
 
-       opcode/i860.h (flush): Set lower 3 bits properly and use 'L'
+       i860.h (flush): Set lower 3 bits properly and use 'L'
        for the immediate operand type instead of 'i'.
 
 2003-05-20  Jason Eckhardt  <jle@rice.edu>
 
-       opcode/i860.h (fzchks): Both S and R bits must be set.
+       i860.h (fzchks): Both S and R bits must be set.
        (pfzchks): Likewise.
        (faddp): Likewise.
        (pfaddp): Likewise.
index 6fdcdba6ecc77d81630a4e3ef37a1568b17fc02e..6e2a683a499d644660477cc01976346942be25bb 100644 (file)
@@ -40,7 +40,7 @@ struct i860_opcode
 
 enum expand_type
 {
-    E_MOV = 1, E_ADDR, E_U32, E_AND, E_S32, E_DELAY
+    E_MOV = 1, E_ADDR, E_U32, E_AND, E_S32, E_DELAY, XP_ONLY
 };
 
 
@@ -135,6 +135,10 @@ static const struct i860_opcode i860_opcodes[] =
 { "pfld.d",    0x64000000, 0x98000007, "L(2),g", E_ADDR },     /* pfld.d #const(isrc2),fdest */
 { "pfld.d",    0x60000001, 0x9c000006, "1(2)++,g", 0 },        /* pfld.d isrc1(isrc2)++,fdest */
 { "pfld.d",    0x64000001, 0x98000006, "L(2)++,g", E_ADDR },   /* pfld.d #const(isrc2)++,fdest */
+{ "pfld.q",    0x60000004, 0x9c000003, "1(2),g", XP_ONLY },    /* pfld.q isrc1(isrc2),fdest */
+{ "pfld.q",    0x64000004, 0x98000003, "L(2),g", XP_ONLY },    /* pfld.q #const(isrc2),fdest */
+{ "pfld.q",    0x60000005, 0x9c000002, "1(2)++,g", XP_ONLY },  /* pfld.q isrc1(isrc2)++,fdest */
+{ "pfld.q",    0x64000005, 0x98000002, "L(2)++,g", XP_ONLY },  /* pfld.q #const(isrc2)++,fdest */
 
 { "fst.l",     0x28000002, 0xd4000001, "g,1(2)", 0 },  /* fst.l fdest,isrc1(isrc2) */
 { "fst.l",     0x2c000002, 0xd0000001, "g,K(2)", E_ADDR },     /* fst.l fdest,#const(isrc2) */
@@ -204,6 +208,16 @@ static const struct i860_opcode i860_opcodes[] =
 { "calli",     0x4c000002, 0xb000001d, "1", E_DELAY }, /* calli isrc1ni */
 { "intovr",    0x4c000004, 0xb000001b, "", 0 },        /* intovr trap on integer overflow */
 { "unlock",    0x4c000007, 0xb0000018, "", 0 },        /* unlock clear BL in dirbase */
+{ "ldio.l",    0x4c000408, 0xb00003f7, "2,d", XP_ONLY },       /* ldio.l isrc2,idest */
+{ "ldio.s",    0x4c000208, 0xb00005f7, "2,d", XP_ONLY },       /* ldio.s isrc2,idest */
+{ "ldio.b",    0x4c000008, 0xb00007f7, "2,d", XP_ONLY },       /* ldio.b isrc2,idest */
+{ "stio.l",    0x4c000409, 0xb00003f6, "1,2", XP_ONLY },       /* stio.l isrc1ni,isrc2 */
+{ "stio.s",    0x4c000209, 0xb00005f6, "1,2", XP_ONLY },       /* stio.s isrc1ni,isrc2 */
+{ "stio.b",    0x4c000009, 0xb00007f6, "1,2", XP_ONLY },       /* stio.b isrc1ni,isrc2 */
+{ "ldint.l",   0x4c00040a, 0xb00003f5, "2,d", XP_ONLY },       /* ldint.l isrc2,idest */
+{ "ldint.s",   0x4c00020a, 0xb00005f5, "2,d", XP_ONLY },       /* ldint.s isrc2,idest */
+{ "ldint.b",   0x4c00000a, 0xb00007f5, "2,d", XP_ONLY },       /* ldint.b isrc2,idest */
+{ "scyc.b",    0x4c00000b, 0xb00007f4, "2", XP_ONLY },         /* scyc.b isrc2 */
 
 /* CTRL-Format Instructions */
 { "br",                0x68000000, 0x94000000, "l", E_DELAY }, /* br lbroff */
index de8f363dac5355f6d51fb4a46862848cd2c8358d..cbdcc3cfa68f29a60944c2bac0c5943a08311281 100644 (file)
@@ -1,3 +1,9 @@
+2003-05-23  Jason Eckhardt  <jle@rice.edu>
+
+       * i860-dis.c (crnames): Add bear, ccr, p0, p1, p2, p3.
+       (print_insn_i860): Grab 4 bits of the control register field
+       instead of 3.
+
 2003-05-18  Jason Eckhardt  <jle@rice.edu>
 
        * i860-dis.c (print_insn_i860): Instruction shrd has a dual bit,
index 69a106d41cab5b7b04715f4f996fdb745af0cbc3..a3e87b0f5521f619ce29f7e220a7f1fab8f8ee71 100644 (file)
@@ -1,5 +1,5 @@
 /* Disassembler for the i860.
-   Copyright 2000 Free Software Foundation, Inc.
+   Copyright 2000, 2003 Free Software Foundation, Inc.
 
    Contributed by Jason Eckhardt <jle@cygnus.com>.
 
@@ -37,9 +37,11 @@ static const char *const frnames[] =
   "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
   "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"};
 
-/* Control/status register names (encoded as 0..5 in the instruction).  */
+/* Control/status register names (encoded as 0..11 in the instruction).
+   Registers bear, ccr, p0, p1, p2 and p3 are XP only.  */
 static const char *const crnames[] = 
- {"fir", "psr", "dirbase", "db", "fsr", "epsr", "", ""};
+ {"fir", "psr", "dirbase", "db", "fsr", "epsr", "bear", "ccr",
+  "p0", "p1", "p2", "p3", "--", "--", "--", "--" };
 
 
 /* Prototypes.  */
@@ -190,7 +192,7 @@ print_insn_i860 (memaddr, info)
            /* Control register.  */
            case 'c':
              (*info->fprintf_func) (info->stream, "%s%s", I860_REG_PREFIX,
-                                    crnames[(insn >> 21) & 0x7]);
+                                    crnames[(insn >> 21) & 0xf]);
              break;
 
            /* 16-bit immediate (sign extend, except for bitwise ops).  */
index 28376b78e8bb646a7c81c1e1cc45eeeafa7af99a..3cb58e216187f440567aaf257405944e7d1a7936 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-25  Mark Kettenis  <kettenis@gnu.org>
+
+       * aclocal.m4: Don't add wcwidth.o if we don't have wchar.h.
+       * configure: Regenerate.
+
 2003-05-13  Andreas Jaeger  <aj@suse.de>
 
         * support/config.guess: Update to 2003-05-09 version.
index bc43d8db013c816fe8e3aa1d3463b53e870f935e..a87e2dcb93b762278975987a271cd2703bf82b0c 100644 (file)
@@ -1654,13 +1654,13 @@ AC_CHECK_HEADERS(langinfo.h)
 
 AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC))
 AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
-AC_CHECK_FUNC(wcwidth, have_wcwidth=yes)
-if test "$have_wcwidth" = yes; then
-  AC_DEFINE(HAVE_WCWIDTH)
-  AC_SUBST(WCWIDTH_OBJ,)
+AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
+if test "$ac_cv_func_wcwidth" = no && test "$ac_cv_header_wchar_h" = yes; then
+  WCWIDTH_OBJ=wcwidth.o
 else
-  AC_SUBST(WCWIDTH_OBJ,wcwidth.o)
+  WCWIDTH_OBJ=
 fi
+AC_SUBST(WCWIDTH_OBJ)
 
 AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
 [AC_TRY_RUN([
index b5c2e8dcbf9a316dd961aa39f2262aa079e7cef1..236327cf7f63414bc5f373ee9e6b426d15fa49f7 100755 (executable)
@@ -6235,20 +6235,19 @@ fi
 echo "$as_me:$LINENO: result: $ac_cv_func_wcwidth" >&5
 echo "${ECHO_T}$ac_cv_func_wcwidth" >&6
 if test $ac_cv_func_wcwidth = yes; then
-  have_wcwidth=yes
-fi
-
-if test "$have_wcwidth" = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_WCWIDTH 1
 _ACEOF
 
+fi
 
-else
+if test "$ac_cv_func_wcwidth" = no && test "$ac_cv_header_wchar_h" = yes; then
   WCWIDTH_OBJ=wcwidth.o
-
+else
+  WCWIDTH_OBJ=
 fi
 
+
 echo "$as_me:$LINENO: checking for mbstate_t" >&5
 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
 if test "${bash_cv_have_mbstate_t+set}" = set; then