Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] Move find_frame_addr_in_frame_chain() to varobj.c
@ 2002-11-24  6:19 Andrew Cagney
  2002-11-25 10:42 ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2002-11-24  6:19 UTC (permalink / raw)
  To: gdb-patches

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

Simple cleanup.  Move a function out of blockframe.c to the file that 
uses it.

Also adds (another) comment noting the need to switch to frame IDs.

commited,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3372 bytes --]

2002-11-23  Andrew Cagney  <ac131313@redhat.com>

	* blockframe.c (find_frame_addr_in_frame_chain): Move function
	from here ...
	* varobj.c (find_frame_addr_in_frame_chain): ... to here.
	(varobj_create): Note that frame ID should be used.
	* frame.h (find_frame_addr_in_frame_chain): Delete declaration.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.51
diff -u -r1.51 blockframe.c
--- blockframe.c	18 Nov 2002 22:19:26 -0000	1.51
+++ blockframe.c	24 Nov 2002 14:11:33 -0000
@@ -643,27 +643,6 @@
     }
 }
 
-/* Return the full FRAME which corresponds to the given CORE_ADDR
-   or NULL if no FRAME on the chain corresponds to CORE_ADDR.  */
-
-struct frame_info *
-find_frame_addr_in_frame_chain (CORE_ADDR frame_addr)
-{
-  struct frame_info *frame = NULL;
-
-  if (frame_addr == (CORE_ADDR) 0)
-    return NULL;
-
-  while (1)
-    {
-      frame = get_prev_frame (frame);
-      if (frame == NULL)
-	return NULL;
-      if (FRAME_FP (frame) == frame_addr)
-	return frame;
-    }
-}
-
 /* Are we in a call dummy?  The code below which allows DECR_PC_AFTER_BREAK
    below is for infrun.c, which may give the macro a pc without that
    subtracted out.  */
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.35
diff -u -r1.35 frame.h
--- frame.h	18 Nov 2002 22:19:27 -0000	1.35
+++ frame.h	24 Nov 2002 14:11:33 -0000
@@ -412,8 +412,6 @@
 
 extern struct frame_info *block_innermost_frame (struct block *);
 
-extern struct frame_info *find_frame_addr_in_frame_chain (CORE_ADDR);
-
 /* NOTE: cagney/2002-09-13: There is no need for this function.
    Instead either of frame_unwind_signed_register() or
    frame_unwind_unsigned_register() can be used.  */
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.34
diff -u -r1.34 varobj.c
--- varobj.c	5 Nov 2002 22:31:00 -0000	1.34
+++ varobj.c	24 Nov 2002 14:11:35 -0000
@@ -396,6 +396,27 @@
 
 /* Creates a varobj (not its children) */
 
+/* Return the full FRAME which corresponds to the given CORE_ADDR
+   or NULL if no FRAME on the chain corresponds to CORE_ADDR.  */
+
+static struct frame_info *
+find_frame_addr_in_frame_chain (CORE_ADDR frame_addr)
+{
+  struct frame_info *frame = NULL;
+
+  if (frame_addr == (CORE_ADDR) 0)
+    return NULL;
+
+  while (1)
+    {
+      frame = get_prev_frame (frame);
+      if (frame == NULL)
+	return NULL;
+      if (FRAME_FP (frame) == frame_addr)
+	return frame;
+    }
+}
+
 struct varobj *
 varobj_create (char *objname,
 	       char *expression, CORE_ADDR frame, enum varobj_type type)
@@ -422,6 +443,12 @@
       if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
 	fi = selected_frame;
       else
+	/* FIXME: cagney/2002-11-23: This code should be doing a
+	   lookup using the frame ID and not just the frame's
+	   ``address''.  This, of course, means an interface change.
+	   However, with out that interface change ISAs, such as the
+	   ia64 with its two stacks, won't work.  Similar goes for the
+	   case where there is a frameless function.  */
 	fi = find_frame_addr_in_frame_chain (frame);
 
       /* frame = -2 means always use selected frame */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Move find_frame_addr_in_frame_chain() to varobj.c
  2002-11-24  6:19 [commit] Move find_frame_addr_in_frame_chain() to varobj.c Andrew Cagney
@ 2002-11-25 10:42 ` Michael Snyder
  2002-11-25 11:09   ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2002-11-25 10:42 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches


Say, is this a policy change?
Are we substituting [commit] for [PATCH]?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [commit] Move find_frame_addr_in_frame_chain() to varobj.c
  2002-11-25 10:42 ` Michael Snyder
@ 2002-11-25 11:09   ` Andrew Cagney
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2002-11-25 11:09 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches

> Say, is this a policy change?
> Are we substituting [commit] for [PATCH]?

There isn't a policy.

People have observed though that `patch' is pretty ambigous - some 
people use it when subitting something for aproval, others when 
committing a patch, others ...

So I'm just trying to avoid it.

Andrew



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-25 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-24  6:19 [commit] Move find_frame_addr_in_frame_chain() to varobj.c Andrew Cagney
2002-11-25 10:42 ` Michael Snyder
2002-11-25 11:09   ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox