Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [patch] describe some frame unwinder functions
Date: Sun, 23 Sep 2007 21:57:00 -0000	[thread overview]
Message-ID: <1190584664.8479.2.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Hi,

This patch adds explanations to some functions in the frame unwinder. I
think they're very helpful (albeit somewhat concise), assuming I got
them right. :-)

What do you think?
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center

[-- Attachment #2: frame-unwinder-comments.patch --]
[-- Type: text/x-patch, Size: 1798 bytes --]

2007-09-23  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* frame.c (frame_pc_unwind): Add purpose explanation.
	(frame_func_unwind): Likewise.
	(frame_register_unwind): Likewise.
	(get_frame_pc): Likewise.

Index: src-git/gdb/frame.c
===================================================================
--- src-git.orig/gdb/frame.c	2007-09-14 18:45:28.000000000 -0300
+++ src-git/gdb/frame.c	2007-09-23 18:46:21.000000000 -0300
@@ -421,6 +421,8 @@ frame_find_by_id (struct frame_id id)
   return NULL;
 }
 
+/* Return the PC value at the time the caller of this frame was active.  */
+
 CORE_ADDR
 frame_pc_unwind (struct frame_info *this_frame)
 {
@@ -468,6 +470,9 @@ frame_pc_unwind (struct frame_info *this
   return this_frame->prev_pc.value;
 }
 
+/* Return the address of the first instruction in the function which
+ * called frame FI.  */
+
 CORE_ADDR
 frame_func_unwind (struct frame_info *fi, enum frame_type this_type)
 {
@@ -547,6 +552,16 @@ frame_pop (struct frame_info *this_frame
   reinit_frame_cache ();
 }
 
+/* Obtain value of REGNUM at the time FRAME was active.
+ *
+ * *OPTIMIZEDP is set to 1 if register value cannot be obtained.
+ * *LVALP is set to location in inferior where the value is saved.
+ * If it is saved in inferior memory, *ADDRP is set to its address.
+ * If it is saved in another register, *REALNUMP is set to the new
+ * register number.
+ *
+ * If BUFFERP is not NULL, save register value to *BUFFERP.  */
+
 void
 frame_register_unwind (struct frame_info *frame, int regnum,
 		       int *optimizedp, enum lval_type *lvalp,
@@ -1485,6 +1500,8 @@ get_prev_frame (struct frame_info *this_
   return get_prev_frame_1 (this_frame);
 }
 
+/* Return the PC value at the time this frame was active.  */
+
 CORE_ADDR
 get_frame_pc (struct frame_info *frame)
 {

             reply	other threads:[~2007-09-23 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-23 21:57 Thiago Jung Bauermann [this message]
2007-09-24 19:12 ` Jim Blandy

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=1190584664.8479.2.camel@localhost.localdomain \
    --to=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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