small get_prev_frame cleanup (don't allow a NULL this_frame anymore), plus caller adjustment

Pedro Alves pedro@codesourcery.com
Mon Jan 26 00:25:00 GMT 2009


I can only find one place currently where get_prev_frame can
be passed a NULL frame, so I think now is a good time to get rid of
the hack it has in place, the one of returning current_frame in that case.

Unfortunately, that place (``find_frame_addr_in_frame_chain'', which can be
read in the comments I'm moving around in the patch, is a hack itself
that should go, but it serves an MI interface, so, we have to leave that
cleanup for MI3), really expects that get_prev_frame would return NULL if the
target had no stack yet, and a valid current_frame otherwise.

To clean that up, the best seems to be to export ``has_stack_frames'',
which is also the predicate used by deprecated_get_selected_frame and
get_selected_frame, and use it at the get_prev_frame's and
deprecated_get_seleted_frame caller (varobj_create).  (This is not to
say that checks couldn't move yet closer to the top-level, but I'm
leaving that for another time --- focusing on get_prev_frame.)

WDYT?

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_prev_frame_cleanup.diff
Type: text/x-diff
Size: 6021 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20090126/d7acaffb/attachment.bin>


More information about the Gdb-patches mailing list