+2010-08-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * frame-unwind.c (frame_unwind_find_by_frame): Remove the return type
+ and returned value. New comment from frame-unwind.h.
+ * frame-unwind.h (frame_unwind_find_by_frame): Remove the return type.
+ Extend the comment.
+ * frame.c (get_frame_id, frame_unwind_register_value)
+ (create_new_frame, get_prev_frame_1, frame_unwinder_is)
+ (get_frame_type, frame_unwind_arch): Do not use the return value of
+ frame_unwind_find_by_frame.
+
2010-08-11 Phil Muldoon <pmuldoon@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com>
Tom Tromey <tromey@redhat.com>
(*ip)->unwinder = unwinder;
}
-const struct frame_unwind *
+/* Iterate through sniffers for THIS_FRAME frame until one returns with an
+ unwinder implementation. THIS_FRAME->UNWIND must be NULL, it will get set
+ by this function. Possibly initialize THIS_CACHE. */
+
+void
frame_unwind_find_by_frame (struct frame_info *this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
this_cache))
{
discard_cleanups (old_cleanup);
- return entry->unwinder;
+ return;
}
do_cleanups (old_cleanup);
}
extern void frame_unwind_append_unwinder (struct gdbarch *gdbarch,
const struct frame_unwind *unwinder);
-/* Iterate through sniffers for THIS frame until one returns with an
- unwinder implementation. Possibly initialize THIS_CACHE. */
+/* Iterate through sniffers for THIS_FRAME frame until one returns with an
+ unwinder implementation. THIS_FRAME->UNWIND must be NULL, it will get set
+ by this function. Possibly initialize THIS_CACHE. */
-extern const struct frame_unwind *frame_unwind_find_by_frame (struct frame_info *this_frame,
- void **this_cache);
+extern void frame_unwind_find_by_frame (struct frame_info *this_frame,
+ void **this_cache);
/* Helper functions for value-based register unwinding. These return
a (possibly lazy) value of the appropriate type. */
fi->level);
/* Find the unwinder. */
if (fi->unwind == NULL)
- fi->unwind = frame_unwind_find_by_frame (fi, &fi->prologue_cache);
+ frame_unwind_find_by_frame (fi, &fi->prologue_cache);
/* Find THIS frame's ID. */
/* Default to outermost if no ID is found. */
fi->this_id.value = outer_frame_id;
/* Find the unwinder. */
if (frame->unwind == NULL)
- frame->unwind = frame_unwind_find_by_frame (frame, &frame->prologue_cache);
+ frame_unwind_find_by_frame (frame, &frame->prologue_cache);
/* Ask this frame to unwind its register. */
value = frame->unwind->prev_register (frame, &frame->prologue_cache, regnum);
/* Select/initialize both the unwind function and the frame's type
based on the PC. */
- fi->unwind = frame_unwind_find_by_frame (fi, &fi->prologue_cache);
+ frame_unwind_find_by_frame (fi, &fi->prologue_cache);
fi->this_id.p = 1;
fi->this_id.value = frame_id_build (addr, pc);
sniffers will think that this frame's sniffer tried to unwind
further (see frame_cleanup_after_sniffer). */
if (this_frame->unwind == NULL)
- this_frame->unwind
- = frame_unwind_find_by_frame (this_frame, &this_frame->prologue_cache);
+ frame_unwind_find_by_frame (this_frame, &this_frame->prologue_cache);
this_frame->prev_p = 1;
this_frame->stop_reason = UNWIND_NO_REASON;
frame_unwinder_is (struct frame_info *fi, const struct frame_unwind *unwinder)
{
if (fi->unwind == NULL)
- fi->unwind = frame_unwind_find_by_frame (fi, &fi->prologue_cache);
+ frame_unwind_find_by_frame (fi, &fi->prologue_cache);
return fi->unwind == unwinder;
}
if (frame->unwind == NULL)
/* Initialize the frame's unwinder because that's what
provides the frame's type. */
- frame->unwind = frame_unwind_find_by_frame (frame, &frame->prologue_cache);
+ frame_unwind_find_by_frame (frame, &frame->prologue_cache);
return frame->unwind->type;
}
struct gdbarch *arch;
if (next_frame->unwind == NULL)
- next_frame->unwind
- = frame_unwind_find_by_frame (next_frame,
- &next_frame->prologue_cache);
+ frame_unwind_find_by_frame (next_frame, &next_frame->prologue_cache);
if (next_frame->unwind->prev_arch != NULL)
arch = next_frame->unwind->prev_arch (next_frame,