include/elf/
[deliverable/binutils-gdb.git] / gdb / m32c-tdep.c
index b8cd1675c31f14cc406522b64edb204d1da0f70b..9fa672bffa4a825a4514d931ff798e82f1404011 100644 (file)
@@ -1,6 +1,6 @@
 /* Renesas M32C target-dependent code for GDB, the GNU debugger.
 
-   Copyright 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -261,7 +261,7 @@ m32c_debug_info_reg_to_regnum (struct gdbarch *gdbarch, int reg_nr)
 }
 
 
-int
+static int
 m32c_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
                          struct reggroup *group)
 {
@@ -1519,7 +1519,7 @@ check_for_saved (void *prologue_untyped, pv_t addr, CORE_ADDR size, pv_t value)
 /* Analyze the function prologue for ARCH at START, going no further
    than LIMIT, and place a description of what we found in
    PROLOGUE.  */
-void
+static void
 m32c_analyze_prologue (struct gdbarch *arch,
                       CORE_ADDR start, CORE_ADDR limit,
                       struct m32c_prologue *prologue)
@@ -2018,6 +2018,10 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   {
     struct type *func_type = value_type (function);
 
+    /* Dereference function pointer types.  */
+    if (TYPE_CODE (func_type) == TYPE_CODE_PTR)
+      func_type = TYPE_TARGET_TYPE (func_type);
+
     gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC ||
                TYPE_CODE (func_type) == TYPE_CODE_METHOD);
 
@@ -2495,7 +2499,7 @@ m32c_m16c_pointer_to_address (struct type *type, const gdb_byte *buf)
   return ptr;
 }
 
-void
+static void
 m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
                            int *frame_regnum,
                            LONGEST *frame_offset)
@@ -2596,9 +2600,21 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_virtual_frame_pointer (arch, m32c_virtual_frame_pointer);
 
+  /* m32c function boundary addresses are not necessarily even.
+     Therefore, the `vbit', which indicates a pointer to a virtual
+     member function, is stored in the delta field, rather than as
+     the low bit of a function pointer address.  
+
+     In order to verify this, see the definition of
+     TARGET_PTRMEMFUNC_VBIT_LOCATION in gcc/defaults.h along with the
+     definition of FUNCTION_BOUNDARY in gcc/config/m32c/m32c.h.  */
+  set_gdbarch_vbit_in_delta (arch, 1);
+
   return arch;
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_m32c_tdep;
 
 void
 _initialize_m32c_tdep (void)
This page took 0.048045 seconds and 4 git commands to generate.