From 7d8547c9602def946b932d1416593b8c44456d65 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 24 Nov 2002 14:16:38 +0000 Subject: 2002-11-23 Andrew Cagney * 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. --- gdb/varobj.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gdb/varobj.c') diff --git a/gdb/varobj.c b/gdb/varobj.c index cd15f7c..9b3e150 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -396,6 +396,27 @@ static struct vlist **varobj_table; /* 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 @@ varobj_create (char *objname, 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 */ -- cgit v1.1