From: Andrew Cagney <ac131313@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfc] Add get_frame_saved_regs() and get_frame_saved_regs_p()
Date: Fri, 13 Dec 2002 15:26:00 -0000 [thread overview]
Message-ID: <3DFA6B3F.4010207@redhat.com> (raw)
In-Reply-To: <3DF7A7C9.9040306@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
> Hello,
>
> This adds accessor methods for the `struct frame_info' field ->saved_regs. Since get_frame_saved_regs() and frame_saved_regs_zalloc() are almost equivalent, I also eliminated the latter.
>
> I'll look to commit in a few days,
> Andrew
Given the updated interface to `extra_info'. I've revised (and
seriously shrunk) this change down to the attached.
committed,
Andrew
[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2318 bytes --]
2002-12-13 Andrew Cagney <ac131313@redhat.com>
* frame.h (get_frame_saved_regs): Declare.
(frame_saved_regs_zalloc): Change return type to CORE_ADDR
pointer.
* frame.c (get_frame_saved_regs): New function.
(frame_saved_regs_zalloc): Return the allocated saved_regs.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.46
diff -u -r1.46 frame.c
--- frame.c 13 Dec 2002 21:57:40 -0000 1.46
+++ frame.c 13 Dec 2002 23:09:11 -0000
@@ -461,14 +461,20 @@
return obstack_alloc (&frame_cache_obstack, size);
}
-void
+CORE_ADDR *
frame_saved_regs_zalloc (struct frame_info *fi)
{
fi->saved_regs = (CORE_ADDR *)
frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
+ return fi->saved_regs;
}
+CORE_ADDR *
+get_frame_saved_regs (struct frame_info *fi)
+{
+ return fi->saved_regs;
+}
/* Return the innermost (currently executing) stack frame. */
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.51
diff -u -r1.51 frame.h
--- frame.h 13 Dec 2002 21:57:40 -0000 1.51
+++ frame.h 13 Dec 2002 23:09:11 -0000
@@ -473,7 +473,6 @@
(sizeof (CORE_ADDR) * (NUM_REGS+NUM_PSEUDO_REGS))
extern void *frame_obstack_alloc (unsigned long size);
-extern void frame_saved_regs_zalloc (struct frame_info *);
/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
@@ -653,6 +652,13 @@
extern struct frame_extra_info *frame_extra_info_zalloc (struct frame_info *fi,
long size);
extern struct frame_extra_info *get_frame_extra_info (struct frame_info *fi);
+
+/* Create/access the frame's `saved_regs'. The saved regs are used by
+ older code to store the address of each register (except for
+ SP_REGNUM where the value of the register in the previous frame is
+ stored). */
+extern CORE_ADDR *frame_saved_regs_zalloc (struct frame_info *);
+extern CORE_ADDR *get_frame_saved_regs (struct frame_info *);
/* FIXME: cagney/2002-12-06: Has the PC in the current frame changed?
"infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after
prev parent reply other threads:[~2002-12-13 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-11 13:11 Andrew Cagney
2002-12-11 13:24 ` Andrew Cagney
2002-12-11 22:43 ` Eli Zaretskii
2002-12-13 15:26 ` Andrew Cagney [this message]
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=3DFA6B3F.4010207@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