Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb make sh3 compile.



details:   https://anonhg.NetBSD.org/src/rev/b8d21d78edc2
branches:  trunk
changeset: 770599:b8d21d78edc2
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 24 23:58:01 2011 +0000

description:
make sh3 compile.

diffstat:

 external/gpl3/gdb/dist/gdb/shnbsd-nat.c                 |     1 -
 external/gpl3/gdb/dist/gdb/shnbsd-tdep.c                |    45 +-
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfd-in3.h       |  5976 +++++++++++++++
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfd.h           |  5976 +++++++++++++++
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfd_stdint.h    |    51 +
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfdver.h        |     8 +
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/config.h        |   356 +
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/defs.mk         |     9 +
 external/gpl3/gdb/lib/libbfd/arch/sh3eb/targmatch.h     |  2622 ++++++
 external/gpl3/gdb/lib/libdecnumber/arch/sh3eb/config.h  |   243 +
 external/gpl3/gdb/lib/libdecnumber/arch/sh3eb/defs.mk   |     5 +
 external/gpl3/gdb/lib/libdecnumber/arch/sh3eb/gstdint.h |    51 +
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/config.h        |   986 ++
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/defs.mk         |     7 +
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/init.c          |   252 +
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/observer.h      |   246 +
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/observer.inc    |  1034 ++
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/version.c       |     8 +
 external/gpl3/gdb/lib/libgdb/arch/sh3eb/xml-builtin.c   |   534 +
 external/gpl3/gdb/lib/libiberty/arch/sh3eb/config.h     |   495 +
 external/gpl3/gdb/lib/libiberty/arch/sh3eb/defs.mk      |     8 +
 external/gpl3/gdb/lib/libopcodes/arch/sh3eb/config.h    |   114 +
 external/gpl3/gdb/lib/libopcodes/arch/sh3eb/defs.mk     |     7 +
 external/gpl3/gdb/lib/libreadline/arch/sh3eb/config.h   |   243 +
 external/gpl3/gdb/lib/libreadline/arch/sh3eb/defs.mk    |     6 +
 25 files changed, 19256 insertions(+), 27 deletions(-)

diffs (truncated from 19446 to 300 lines):

diff -r a3eca94caac1 -r b8d21d78edc2 external/gpl3/gdb/dist/gdb/shnbsd-nat.c
--- a/external/gpl3/gdb/dist/gdb/shnbsd-nat.c   Mon Oct 24 22:20:59 2011 +0000
+++ b/external/gpl3/gdb/dist/gdb/shnbsd-nat.c   Mon Oct 24 23:58:01 2011 +0000
@@ -41,7 +41,6 @@
 || (regno) == gdbarch_pc_regnum (gdbarch) || (regno) == PR_REGNUM \
 || (regno) == MACH_REGNUM || (regno) == MACL_REGNUM \
 || (regno) == SR_REGNUM || (regno) == GBR_REGNUM)
-|| (regno) == SR_REGNUM)
 
 /* Sizeof `struct reg' in <machine/reg.h>.  */
 #define SHNBSD_SIZEOF_GREGS    (21 * 4)
diff -r a3eca94caac1 -r b8d21d78edc2 external/gpl3/gdb/dist/gdb/shnbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/shnbsd-tdep.c  Mon Oct 24 22:20:59 2011 +0000
+++ b/external/gpl3/gdb/dist/gdb/shnbsd-tdep.c  Mon Oct 24 23:58:01 2011 +0000
@@ -260,7 +260,7 @@
 }
 
 static CORE_ADDR
-shnbsd_get_next_pc (CORE_ADDR pc)
+shnbsd_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
   unsigned short insn;
   ULONGEST sr;
@@ -285,7 +285,7 @@
   /* BT, BF, BT/S, BF/S */
   if (CONDITIONAL_BRANCH_P(insn))
     {
-      sr = read_register (SR_REGNUM);
+      regcache_cooked_read_unsigned (regcache, SR_REGNUM, &sr);
 
       delay_slot = CONDITIONAL_BRANCH_SLOT_P(insn);
       if (!CONDITIONAL_BRANCH_TAKEN_P(insn, sr))
@@ -310,8 +310,8 @@
   /* BRAF, BSRF */
   else if (BRANCH_FAR_P(insn))
     {
-      displacement = read_register (BRANCH_FAR_REG(insn));
-
+      regcache_cooked_read_unsigned (regcache, BRANCH_FAR_REG(insn),
+         &displacement);
       next_pc = pc + 4 + displacement;
       delay_slot = 1;
     }
@@ -319,21 +319,21 @@
   /* JMP, JSR */
   else if (JUMP_P(insn))
     {
-      next_pc = read_register (JUMP_REG(insn));
+      regcache_cooked_read_unsigned (regcache, JUMP_REG(insn), &next_pc);
       delay_slot = 1;
     }
 
   /* RTS */
   else if (insn == RTS_INSN)
     {
-      next_pc = read_register (PR_REGNUM);
+      regcache_cooked_read_unsigned (regcache, PR_REGNUM, &next_pc);
       delay_slot = 1;
     }
 
   /* RTE - XXX: privileged */
   else if (insn == RTE_INSN)
     {
-      next_pc = read_register (SPC_REGNUM);
+      regcache_cooked_read_unsigned (regcache, SPC_REGNUM, &next_pc);
       delay_slot = 1;
     }
 
@@ -356,28 +356,20 @@
    instruction and setting a breakpoint on the "next" instruction
    which would be executed.
  */
-void
-shnbsd_software_single_step (struct gdbarch *gdbarch,
-                            enum target_signal sig,
-                            int insert_breakpoints_p)
+int
+shnbsd_software_single_step (struct frame_info *frame)
 {
   static CORE_ADDR next_pc;
-  CORE_ADDR pc;
-
-  if (insert_breakpoints_p)
-    {
-      pc = read_pc ();
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+  struct address_space *aspace = get_frame_address_space (frame);
+  struct regcache  *regcache= get_current_regcache ();
+  CORE_ADDR pc = regcache_read_pc (regcache);
 
-      /* If inferior was signalled before it had a chance to execute
-        the single step breakpoint, keep the breakpoint where it
-        was */
-      if (sig == 0 || pc != next_pc)
-       next_pc = shnbsd_get_next_pc (pc);
+  if (pc != next_pc)
+    next_pc = shnbsd_get_next_pc (regcache, pc);
 
-      insert_single_step_breakpoint (gdbarch, next_pc);
-    }
-  else
-      remove_single_step_breakpoints ();
+  insert_single_step_breakpoint (gdbarch, aspace, next_pc);
+  return 1;
 }
 
 /* SH register sets.  */
@@ -458,7 +450,8 @@
 {
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-  CORE_ADDR sp = get_frame_register_unsigned (next_frame, SP_REGNUM);
+  int sp_regnum = gdbarch_sp_regnum (gdbarch);
+  CORE_ADDR sp = get_frame_register_unsigned (next_frame, sp_regnum);
   CORE_ADDR base;
   const int *reg_offset;
   int num_regs;
diff -r a3eca94caac1 -r b8d21d78edc2 external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfd-in3.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl3/gdb/lib/libbfd/arch/sh3eb/bfd-in3.h Mon Oct 24 23:58:01 2011 +0000
@@ -0,0 +1,5976 @@
+/* This file is automatically generated.  DO NOT EDIT! */
+/* Generated from:     NetBSD: mknative-gdb,v 1.4 2011/10/09 02:03:30 christos Exp  */
+/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp  */
+
+/* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
+   generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 
+   "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", 
+   "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", 
+   "linker.c", "simple.c" and "compress.c".
+   Run "make headers" in your build bfd/ to regenerate.  */
+
+/* Main header file for the bfd library -- portable access to object files.
+
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
+
+   Contributed by Cygnus Support.
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef __BFD_H_SEEN__
+#define __BFD_H_SEEN__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ansidecl.h"
+#include "symcat.h"
+#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
+#ifndef SABER
+/* This hack is to avoid a problem with some strict ANSI C preprocessors.
+   The problem is, "32_" is not a valid preprocessing token, and we don't
+   want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
+   cause the inner CONCAT2 macros to be evaluated first, producing
+   still-valid pp-tokens.  Then the final concatenation can be done.  */
+#undef CONCAT4
+#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
+#endif
+#endif
+
+/* This is a utility macro to handle the situation where the code
+   wants to place a constant string into the code, followed by a
+   comma and then the length of the string.  Doing this by hand
+   is error prone, so using this macro is safer.  */
+#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1)
+/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
+   to create the arguments to another macro, since the preprocessor
+   will mis-count the number of arguments to the outer macro (by not
+   evaluating STRING_COMMA_LEN and so missing the comma).  This is a
+   problem for example when trying to use STRING_COMMA_LEN to build
+   the arguments to the strncmp() macro.  Hence this alternative
+   definition of strncmp is provided here.
+   
+   Note - these macros do NOT work if STR2 is not a constant string.  */
+#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
+  /* strcpy() can have a similar problem, but since we know we are
+     copying a constant string, we can use memcpy which will be faster
+     since there is no need to check for a NUL byte inside STR.  We
+     can also save time if we do not need to copy the terminating NUL.  */
+#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
+#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
+
+
+#define BFD_SUPPORTS_PLUGINS 0
+
+/* The word size used by BFD on the host.  This may be 64 with a 32
+   bit target if the host is 64 bit, or if other 64 bit targets have
+   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
+#define BFD_ARCH_SIZE 64
+
+/* The word size of the default bfd target.  */
+#define BFD_DEFAULT_TARGET_SIZE 32
+
+#define BFD_HOST_64BIT_LONG 0
+#define BFD_HOST_64BIT_LONG_LONG 1
+#if 1
+#define BFD_HOST_64_BIT long long
+#define BFD_HOST_U_64_BIT unsigned long long
+typedef BFD_HOST_64_BIT bfd_int64_t;
+typedef BFD_HOST_U_64_BIT bfd_uint64_t;
+#endif
+
+#if BFD_ARCH_SIZE >= 64
+#define BFD64
+#endif
+
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
+/* Declaring a type wide enough to hold a host long and a host pointer.  */
+#define BFD_HOSTPTR_T  unsigned long
+typedef BFD_HOSTPTR_T bfd_hostptr_t;
+
+/* Forward declaration.  */
+typedef struct bfd bfd;
+
+/* Boolean type used in bfd.  Too many systems define their own
+   versions of "boolean" for us to safely typedef a "boolean" of
+   our own.  Using an enum for "bfd_boolean" has its own set of
+   problems, with strange looking casts required to avoid warnings
+   on some older compilers.  Thus we just use an int.
+
+   General rule: Functions which are bfd_boolean return TRUE on
+   success and FALSE on failure (unless they're a predicate).  */
+
+typedef int bfd_boolean;
+#undef FALSE
+#undef TRUE
+#define FALSE 0
+#define TRUE 1
+
+#ifdef BFD64
+
+#ifndef BFD_HOST_64_BIT
+ #error No 64 bit integer type available
+#endif /* ! defined (BFD_HOST_64_BIT) */
+
+typedef BFD_HOST_U_64_BIT bfd_vma;
+typedef BFD_HOST_64_BIT bfd_signed_vma;
+typedef BFD_HOST_U_64_BIT bfd_size_type;
+typedef BFD_HOST_U_64_BIT symvalue;
+
+#if BFD_HOST_64BIT_LONG
+#define BFD_VMA_FMT "l"
+#elif defined (__MSVCRT__)
+#define BFD_VMA_FMT "I64"
+#else
+#define BFD_VMA_FMT "ll"
+#endif
+
+#ifndef fprintf_vma
+#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x)
+#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x)
+#endif
+
+#else /* not BFD64  */
+
+/* Represent a target address.  Also used as a generic unsigned type
+   which is guaranteed to be big enough to hold any arithmetic types
+   we need to deal with.  */
+typedef unsigned long bfd_vma;
+
+/* A generic signed type which is guaranteed to be big enough to hold any
+   arithmetic types we need to deal with.  Can be assumed to be compatible
+   with bfd_vma in the same way that signed and unsigned ints are compatible
+   (as parameters, in assignment, etc).  */
+typedef long bfd_signed_vma;
+
+typedef unsigned long symvalue;
+typedef unsigned long bfd_size_type;
+
+/* Print a bfd_vma x on stream s.  */
+#define BFD_VMA_FMT "l"
+#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x)
+#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x)
+
+#endif /* not BFD64  */
+



Home | Main Index | Thread Index | Old Index