gdbtypes.resolve_dynamic_range: Add function description.
[deliverable/binutils-gdb.git] / gdb / score-tdep.c
index 4ddcd2773cd681c61e46b15218878ce783a09453..c224189d16b76a5f95ef346a64b17939d1ba8b5b 100644 (file)
@@ -1,8 +1,7 @@
 /* Target-dependent code for the S+core architecture, for GDB,
    the GNU Debugger.
 
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2006-2014 Free Software Foundation, Inc.
 
    Contributed by Qinwei (qinwei@sunnorth.com.cn)
    Contributed by Ching-Peng Lin (cplin@sunplus.com)
@@ -138,11 +137,11 @@ score_print_insn (bfd_vma memaddr, struct disassemble_info *info)
 }
 
 static inst_t *
-score7_fetch_inst (struct gdbarch *gdbarch, CORE_ADDR addr, char *memblock)
+score7_fetch_inst (struct gdbarch *gdbarch, CORE_ADDR addr, gdb_byte *memblock)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   static inst_t inst = { 0, 0, 0 };
-  char buf[SCORE_INSTLEN] = { 0 };
+  gdb_byte buf[SCORE_INSTLEN] = { 0 };
   int big;
   int ret;
 
@@ -222,7 +221,6 @@ score3_adjust_pc_and_fetch_inst (CORE_ADDR *pcptr, int *lenptr,
 
 #define EXTRACT_LEN 2
   CORE_ADDR adjust_pc = *pcptr & ~0x1;
-  int inst_len;
   gdb_byte buf[5][EXTRACT_LEN] =
     {
       {'\0', '\0'},
@@ -451,7 +449,7 @@ score_xfer_register (struct regcache *regcache, int regnum, int length,
 }
 
 static enum return_value_convention
-score_return_value (struct gdbarch *gdbarch, struct type *func_type,
+score_return_value (struct gdbarch *gdbarch, struct value *function,
                     struct type *type, struct regcache *regcache,
                     gdb_byte * readbuf, const gdb_byte * writebuf)
 {
@@ -809,11 +807,11 @@ score3_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR cur_pc)
     return 0;
 }
 
-static char *
+static gdb_byte *
 score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
 {
   int ret;
-  char *memblock = NULL;
+  gdb_byte *memblock = NULL;
 
   if (size < 0)
     {
@@ -824,7 +822,7 @@ score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
   else if (size == 0)
     return NULL;
 
-  memblock = (char *) xmalloc (size);
+  memblock = xmalloc (size);
   memset (memblock, 0, size);
   ret = target_read_memory (addr & ~0x3, memblock, size);
   if (ret)
@@ -837,13 +835,13 @@ score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size)
 }
 
 static void
-score7_free_memblock (char *memblock)
+score7_free_memblock (gdb_byte *memblock)
 {
   xfree (memblock);
 }
 
 static void
-score7_adjust_memblock_ptr (char **memblock, CORE_ADDR prev_pc,
+score7_adjust_memblock_ptr (gdb_byte **memblock, CORE_ADDR prev_pc,
                            CORE_ADDR cur_pc)
 {
   if (prev_pc == -1)
@@ -879,8 +877,8 @@ score7_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
   int fp_offset_p = 0;
   int inst_len = 0;
 
-  char *memblock = NULL;
-  char *memblock_ptr = NULL;
+  gdb_byte *memblock = NULL;
+  gdb_byte *memblock_ptr = NULL;
   CORE_ADDR prev_pc = -1;
 
   /* Allocate MEMBLOCK if PC - STARTADDR > 0.  */
@@ -1449,6 +1447,12 @@ score7_linux_supply_gregset(const struct regset *regset,
   }
 }
 
+static const struct regset score7_linux_gregset =
+  {
+    NULL,
+    score7_linux_supply_gregset, NULL
+  };
+
 /* Return the appropriate register set from the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
@@ -1456,20 +1460,11 @@ static const struct regset *
 score7_linux_regset_from_core_section(struct gdbarch *gdbarch,
                     const char *sect_name, size_t sect_size)
 {
-  struct gdbarch_tdep *tdep;
-
   gdb_assert (gdbarch != NULL);
   gdb_assert (sect_name != NULL);
 
-  tdep = gdbarch_tdep (gdbarch);
-
   if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t))
-    {
-      if (tdep->gregset == NULL)
-       tdep->gregset = regset_alloc (gdbarch,
-                                     score7_linux_supply_gregset, NULL);
-      return tdep->gregset;
-    }
+    return &score7_linux_gregset;
 
   return NULL;
 }
@@ -1478,7 +1473,6 @@ static struct gdbarch *
 score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch *gdbarch;
-  struct gdbarch_tdep *tdep;
   target_mach = info.bfd_arch_info->mach;
 
   arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -1486,8 +1480,7 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     {
       return (arches->gdbarch);
     }
-  tdep = xcalloc(1, sizeof(struct gdbarch_tdep));
-  gdbarch = gdbarch_alloc (&info, tdep);
+  gdbarch = gdbarch_alloc (&info, NULL);
 
   set_gdbarch_short_bit (gdbarch, 16);
   set_gdbarch_int_bit (gdbarch, 32);
This page took 0.026569 seconds and 4 git commands to generate.