Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH]: Convert FRAME_CHAIN into a function for i386
Date: Mon, 16 Apr 2001 06:05:00 -0000	[thread overview]
Message-ID: <200104161305.f3GD5Hr04087@delius.kettenis.local> (raw)

Another step towards multi-arch.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386-tdep.c (i386_frame_chain): New function.
	* config/i386/tm-i386.h (FRAME_CHAIN): Redefine in terms of
	i386_frame_chain.
	(i386_frame_chain): New prototype.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.26
diff -u -p -r1.26 i386-tdep.c
--- i386-tdep.c 2001/04/04 15:09:46 1.26
+++ i386-tdep.c 2001/04/16 13:02:09
@@ -349,6 +349,22 @@ 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;
+}
+
 /* Return number of args passed to a frame.
    Can return -1, meaning no way to tell.  */
 
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.14
diff -u -p -r1.14 tm-i386.h
--- config/i386/tm-i386.h 2001/04/01 12:39:52 1.14
+++ config/i386/tm-i386.h 2001/04/16 13:02:09
@@ -323,17 +323,12 @@ extern CORE_ADDR i386_extract_struct_val
    from the sigcontext structure which is pushed by the kernel on the
    user stack, along with a pointer to it.  */
 
-/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
-   chain-pointer.
-   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.  */
+/* 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.  */
 
-#define FRAME_CHAIN(thisframe)  \
-  ((thisframe)->signal_handler_caller \
-   ? (thisframe)->frame \
-   : (!inside_entry_file ((thisframe)->pc) \
-      ? read_memory_unsigned_integer ((thisframe)->frame, 4) \
-      : 0))
+#define FRAME_CHAIN(frame) i386_frame_chain ((frame))
+extern CORE_ADDR i386_frame_chain (struct frame_info *frame);
 
 /* A macro that tells us whether the function invocation represented
    by FI does not have a frame on the stack associated with it.  If it


                 reply	other threads:[~2001-04-16  6:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200104161305.f3GD5Hr04087@delius.kettenis.local \
    --to=kettenis@wins.uva.nl \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox