From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Even more macro-into-function conversion for x86
Date: Wed, 09 May 2001 09:18:00 -0000 [thread overview]
Message-ID: <200105091617.f49GHes00392@delius.kettenis.local> (raw)
Committed.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_frame_saved_pc): New function.
* config/i386/tm-i386.h (FRAME_SAVED_PC): Redefine in terms of
i386_frame_saved_pc.
(i386_frame_saved_pc): New prototype.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.30
diff -u -p -r1.30 i386-tdep.c
--- i386-tdep.c 2001/05/09 09:58:45 1.30
+++ i386-tdep.c 2001/05/09 16:07:48
@@ -378,6 +378,23 @@ i386_frameless_function_invocation (stru
return frameless_look_for_prologue (frame);
}
+/* Return the saved program counter for FRAME. */
+
+CORE_ADDR
+i386_frame_saved_pc (struct frame_info *frame)
+{
+ /* FIXME: kettenis/2001-05-09: Conditionalizing the next bit of code
+ on SIGCONTEXT_PC_OFFSET and I386V4_SIGTRAMP_SAVED_PC should be
+ considered a temporary hack. I plan to come up with something
+ better when we go multi-arch. */
+#if defined (SIGCONTEXT_PC_OFFSET) || defined (I386V4_SIGTRAMP_SAVED_PC)
+ if (frame->signal_handler_caller)
+ return sigtramp_saved_pc (frame);
+#endif
+
+ return read_memory_unsigned_integer (frame->frame + 4, 4);
+}
+
/* Immediately after a function call, return the saved pc. */
CORE_ADDR
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.18
diff -u -p -r1.18 tm-i386.h
--- config/i386/tm-i386.h 2001/05/09 09:58:45 1.18
+++ config/i386/tm-i386.h 2001/05/09 16:07:49
@@ -330,15 +330,10 @@ extern CORE_ADDR i386_frame_chain (struc
i386_frameless_function_invocation (frame)
extern int i386_frameless_function_invocation (struct frame_info *frame);
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
+/* Return the saved program counter for FRAME. */
-#define FRAME_SAVED_PC(FRAME) \
- (((FRAME)->signal_handler_caller \
- ? sigtramp_saved_pc (FRAME) \
- : read_memory_unsigned_integer ((FRAME)->frame + 4, 4)) \
- )
-
-extern CORE_ADDR sigtramp_saved_pc (struct frame_info *);
+#define FRAME_SAVED_PC(frame) i386_frame_saved_pc (frame)
+extern CORE_ADDR i386_frame_saved_pc (struct frame_info *frame);
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
reply other threads:[~2001-05-09 9:18 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=200105091617.f49GHes00392@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