From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [patch/rfc] Add predicates to FRAME_CHAIN() and FRAME_SAVED_PC()
Date: Tue, 28 Jan 2003 21:59:00 -0000 [thread overview]
Message-ID: <3E36FD36.5080102@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]
Hello,
More unwind branch fallout. An architecture implementing the new frame
unwind mechanism doesn't need to provide these functions.
This patch changes them to functions with predicates.
I'll commit once I've got a few more test results back.
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3046 bytes --]
2003-01-28 Andrew Cagney <ac131313@redhat.com>
* frame.c (frame_saved_regs_id_unwind): Assert FRAME_CHAIN_P.
(legacy_get_prev_frame): Assert FRAME_CHAIN_P.
(get_prev_frame): When FRAME_CHAIN_P, call legacy_get_prev_frame.
(frame_saved_regs_pc_unwind): Assert FRAME_SAVED_PC_P.
* gdbarch.sh (FRAME_CHAIN): Change to a function with predicate.
(FRAME_SAVED_PC): Change to a function with predicate.
* gdbarch.h, gdbarch.c: Re-generate.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.63
diff -u -r1.63 frame.c
--- frame.c 27 Jan 2003 21:41:40 -0000 1.63
+++ frame.c 28 Jan 2003 21:55:57 -0000
@@ -665,6 +665,7 @@
static CORE_ADDR
frame_saved_regs_pc_unwind (struct frame_info *frame, void **cache)
{
+ gdb_assert (FRAME_SAVED_PC_P ());
return FRAME_SAVED_PC (frame);
}
@@ -713,6 +714,7 @@
this to after the ffi test; I'd rather have backtraces from
start go curfluy than have an abort called from main not show
main. */
+ gdb_assert (FRAME_CHAIN_P ());
base = FRAME_CHAIN (next_frame);
if (!frame_chain_valid (base, next_frame))
@@ -995,6 +997,7 @@
this to after the ffi test; I'd rather have backtraces from
start go curfluy than have an abort called from main not show
main. */
+ gdb_assert (FRAME_CHAIN_P ());
address = FRAME_CHAIN (next_frame);
if (!frame_chain_valid (address, next_frame))
@@ -1233,7 +1236,8 @@
frames use the new unwind code. */
if ((DEPRECATED_INIT_FRAME_PC_P ()
|| DEPRECATED_INIT_FRAME_PC_FIRST_P ()
- || INIT_EXTRA_FRAME_INFO_P ())
+ || INIT_EXTRA_FRAME_INFO_P ()
+ || FRAME_CHAIN_P ())
&& next_frame->level >= 0)
return legacy_get_prev_frame (next_frame);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.192
diff -u -r1.192 gdbarch.sh
--- gdbarch.sh 21 Jan 2003 19:43:47 -0000 1.192
+++ gdbarch.sh 28 Jan 2003 21:55:59 -0000
@@ -568,9 +568,9 @@
#
v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
-f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
+F:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0
-f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
+F:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0
f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0
f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0
next reply other threads:[~2003-01-28 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-28 21:59 Andrew Cagney [this message]
2003-01-29 18:08 ` Andrew Cagney
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=3E36FD36.5080102@redhat.com \
--to=ac131313@redhat.com \
--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