* dw2gencfi.c, dw2gencfi.h: New files.
[binutils-gdb.git] / gdb / std-regs.c
index 8177fc281cb3e1d93083f6187845b028df66b6d8..93d5102661c8b3f2dfd50fc43ecae7cb9f7132a1 100644 (file)
@@ -64,7 +64,8 @@ value_of_builtin_frame_reg (struct frame_info *frame)
   memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
   /* frame.base.  */
   if (frame != NULL)
-    ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
+    ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+                       get_frame_base (frame));
   buf += TYPE_LENGTH (builtin_type_void_data_ptr);
   /* frame.XXX.  */
   return val;
@@ -73,37 +74,43 @@ value_of_builtin_frame_reg (struct frame_info *frame)
 static struct value *
 value_of_builtin_frame_fp_reg (struct frame_info *frame)
 {
-#ifdef FP_REGNUM
-  if (FP_REGNUM >= 0)
-    return value_of_register (FP_REGNUM, frame);
-#endif
-  {
-    struct value *val = allocate_value (builtin_type_void_data_ptr);
-    char *buf = VALUE_CONTENTS_RAW (val);
-    if (frame == NULL)
-      memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
-    else
-      ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
-    return val;
-  }
+  if (DEPRECATED_FP_REGNUM >= 0)
+    /* NOTE: cagney/2003-04-24: Since the mere presence of "fp" in the
+       register name table overrides this built-in $fp register, there
+       is no real reason for this DEPRECATED_FP_REGNUM trickery here.
+       An architecture wanting to implement "$fp" as alias for a raw
+       register can do so by adding "fp" to register name table (mind
+       you, doing this is probably a dangerous thing).  */
+    return value_of_register (DEPRECATED_FP_REGNUM, frame);
+  else
+    {
+      struct value *val = allocate_value (builtin_type_void_data_ptr);
+      char *buf = VALUE_CONTENTS_RAW (val);
+      if (frame == NULL)
+       memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+      else
+       ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+                           get_frame_base (frame));
+      return val;
+    }
 }
 
 static struct value *
 value_of_builtin_frame_pc_reg (struct frame_info *frame)
 {
-#ifdef PC_REGNUM
   if (PC_REGNUM >= 0)
     return value_of_register (PC_REGNUM, frame);
-#endif
-  {
-    struct value *val = allocate_value (builtin_type_void_data_ptr);
-    char *buf = VALUE_CONTENTS_RAW (val);
-    if (frame == NULL)
-      memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
-    else
-      ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->pc);
-    return val;
-  }
+  else
+    {
+      struct value *val = allocate_value (builtin_type_void_data_ptr);
+      char *buf = VALUE_CONTENTS_RAW (val);
+      if (frame == NULL)
+       memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+      else
+       ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+                           get_frame_pc (frame));
+      return val;
+    }
 }
 
 static struct value *