Revert call to bfd_cache_close().
[deliverable/binutils-gdb.git] / gdb / i386-tdep.c
index db001dafab7ef26e990e209d8c692a0037c08608..7477266f433ecabc7ed0633d1bab74f3e7e7fc34 100644 (file)
@@ -349,6 +349,43 @@ i386_get_frame_setup (CORE_ADDR pc)
   return (-1);
 }
 
+/* Return the chain-pointer for FRAME.  In the case of the i386, the
+   frame's nominal address is the address of a 4-byte word containing
+   the calling frame's address.  */
+
+CORE_ADDR
+i386_frame_chain (struct frame_info *frame)
+{
+  if (frame->signal_handler_caller)
+    return frame->frame;
+
+  if (! inside_entry_file (frame->pc))
+    return read_memory_unsigned_integer (frame->frame, 4);
+
+  return 0;
+}
+
+/* Determine whether the function invocation represented by FRAME does
+   not have a from on the stack associated with it.  If it does not,
+   return non-zero, otherwise return zero.  */
+
+int
+i386_frameless_function_invocation (struct frame_info *frame)
+{
+  if (frame->signal_handler_caller)
+    return 0;
+
+  return frameless_look_for_prologue (frame);
+}
+
+/* Immediately after a function call, return the saved pc.  */
+
+CORE_ADDR
+i386_saved_pc_after_call (struct frame_info *frame)
+{
+  return read_memory_unsigned_integer (read_register (SP_REGNUM), 4);
+}
+
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
@@ -735,8 +772,10 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf)
 
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT
       && TYPE_NFIELDS (type) == 1)
-    return i386_extract_return_value (TYPE_FIELD_TYPE (type, 0),
-                                     regbuf, valbuf);
+    {
+      i386_extract_return_value (TYPE_FIELD_TYPE (type, 0), regbuf, valbuf);
+      return;
+    }
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
     {
@@ -798,7 +837,10 @@ i386_store_return_value (struct type *type, char *valbuf)
 
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT
       && TYPE_NFIELDS (type) == 1)
-    return i386_store_return_value (TYPE_FIELD_TYPE (type, 0), valbuf);
+    {
+      i386_store_return_value (TYPE_FIELD_TYPE (type, 0), valbuf);
+      return;
+    }
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
     {
@@ -850,6 +892,17 @@ i386_store_return_value (struct type *type, char *valbuf)
                        "Cannot store return value of %d bytes long.", len);
     }
 }
+
+/* Extract from an array REGBUF containing the (raw) register state
+   the address in which a function should return its structure value,
+   as a CORE_ADDR.  */
+
+CORE_ADDR
+i386_extract_struct_value_address (char *regbuf)
+{
+  return extract_address (&regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)],
+                         REGISTER_RAW_SIZE (LOW_RETURN_REGNUM));
+}
 \f
 
 /* Convert data from raw format for register REGNUM in buffer FROM to
This page took 0.024637 seconds and 4 git commands to generate.