* breakpoint.h (struct breakpoint): New member GDBARCH.
[deliverable/binutils-gdb.git] / gdb / arm-tdep.c
index 7ffc885886750de107c35de7a3c814b824fb08ac..ffc08638a4b54adb9a2b24813ff35807da075bc5 100644 (file)
@@ -1,7 +1,7 @@
 /* Common target dependent code for GDB on ARM systems.
 
    Copyright (C) 1988, 1989, 1991, 1992, 1993, 1995, 1996, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -63,11 +63,10 @@ static int arm_debug;
    MSYMBOL_IS_SPECIAL   Tests the "special" bit in a minimal symbol.  */
 
 #define MSYMBOL_SET_SPECIAL(msym)                                      \
-       MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym))    \
-                                       | 0x80000000)
+       MSYMBOL_TARGET_FLAG_1 (msym) = 1
 
 #define MSYMBOL_IS_SPECIAL(msym)                               \
-       (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+       MSYMBOL_TARGET_FLAG_1 (msym)
 
 /* Macros for swapping shorts and ints. In the unlikely case that anybody else needs these,
    move to a general header. (A better solution might be to define memory read routines that
@@ -396,7 +395,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
 
   for (i = 0; i < 16; i++)
     regs[i] = pv_register (i, 0);
-  stack = make_pv_area (ARM_SP_REGNUM);
+  stack = make_pv_area (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch));
   back_to = make_cleanup_free_pv_area (stack);
 
   while (start < limit)
@@ -540,7 +539,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
   struct symtab_and_line sal;
 
   /* If we're in a dummy frame, don't even try to skip the prologue.  */
-  if (deprecated_pc_in_call_dummy (pc))
+  if (deprecated_pc_in_call_dummy (gdbarch, pc))
     return pc;
 
   /* See if we can determine the end of the prologue via the symbol table.
@@ -548,7 +547,8 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      is greater.  */
   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
     {
-      CORE_ADDR post_prologue_pc = skip_prologue_using_sal (func_addr);
+      CORE_ADDR post_prologue_pc
+       = skip_prologue_using_sal (gdbarch, func_addr);
       if (post_prologue_pc != 0)
        return max (pc, post_prologue_pc);
     }
@@ -560,7 +560,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
      information.  If the debug information could not be used to provide
      that bound, then use an arbitrary large number as the upper bound.  */
   /* Like arm_scan_prologue, stop no later than pc + 64. */
-  limit_pc = skip_prologue_using_sal (pc);
+  limit_pc = skip_prologue_using_sal (gdbarch, pc);
   if (limit_pc == 0)
     limit_pc = pc + 64;          /* Magic.  */
 
@@ -863,7 +863,7 @@ arm_scan_prologue (struct frame_info *this_frame,
 
   for (regno = 0; regno < ARM_FPS_REGNUM; regno++)
     regs[regno] = pv_register (regno, 0);
-  stack = make_pv_area (ARM_SP_REGNUM);
+  stack = make_pv_area (ARM_SP_REGNUM, gdbarch_addr_bit (gdbarch));
   back_to = make_cleanup_free_pv_area (stack);
 
   for (current_pc = prologue_start;
@@ -1593,6 +1593,20 @@ arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
   print_fpu_flags (status);
 }
 
+/* Construct the ARM extended floating point type.  */
+static struct type *
+arm_ext_type (struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  if (!tdep->arm_ext_type)
+    tdep->arm_ext_type
+      = arch_float_type (gdbarch, -1, "builtin_type_arm_ext",
+                        floatformats_arm_ext);
+
+  return tdep->arm_ext_type;
+}
+
 /* Return the GDB type object for the "standard" data type of data in
    register N.  */
 
@@ -1600,7 +1614,7 @@ static struct type *
 arm_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS)
-    return builtin_type_arm_ext;
+    return arm_ext_type (gdbarch);
   else if (regnum == ARM_SP_REGNUM)
     return builtin_type (gdbarch)->builtin_data_ptr;
   else if (regnum == ARM_PC_REGNUM)
@@ -1608,9 +1622,9 @@ arm_register_type (struct gdbarch *gdbarch, int regnum)
   else if (regnum >= ARRAY_SIZE (arm_register_names))
     /* These registers are only supported on targets which supply
        an XML description.  */
-    return builtin_type_int0;
+    return builtin_type (gdbarch)->builtin_int0;
   else
-    return builtin_type_uint32;
+    return builtin_type (gdbarch)->builtin_uint32;
 }
 
 /* Map a DWARF register REGNUM onto the appropriate GDB register
@@ -2166,12 +2180,14 @@ arm_get_next_pc (struct frame_info *frame, CORE_ADDR pc)
 int
 arm_software_single_step (struct frame_info *frame)
 {
+  struct gdbarch *gdbarch = get_frame_arch (frame);
+
   /* NOTE: This may insert the wrong breakpoint instruction when
      single-stepping over a mode-changing instruction, if the
      CPSR heuristics are used.  */
 
   CORE_ADDR next_pc = arm_get_next_pc (frame, get_frame_pc (frame));
-  insert_single_step_breakpoint (next_pc);
+  insert_single_step_breakpoint (gdbarch, next_pc);
 
   return 1;
 }
This page took 0.029703 seconds and 4 git commands to generate.