This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] describe some frame unwinder functions


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
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)
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]