2003-01-10  Andrew Cagney  <ac131313@redhat.com>

	* sentinel-frame.c (sentinel_frame_register_unwind): Correctly set
	LVALP and ADDRP.

	* frame.c: Include "ui-out.h".

	* frame.c (frame_type_from_pc): New function.
	(create_new_frame): Use.
	(set_unwind_by_pc): Drop unused frame parameter.
	(deprecated_get_prev_frame): Rename old get_prev_frame.
	(get_prev_frame): Rewrite.  Unwind the PC first.  Use
	frame_id_unwind.

	* dummy-frame.h (dummy_frame_id_unwind): Update.
	(dummy_frame_pc_unwind): Update.
	(dummy_frame_register_unwind): Update.
	* dummy-frame.c: Update.

	* frame.c (create_new_frame): Set next to a sentinal frame.
	(create_sentinel_frame): New function.
	(frame_id_unwind): Update id_unwind call.
	(frame_saved_regs_register_unwind): Update cache parameter.
	(frame_saved_regs_pc_unwind): Update cache parameter.
	(frame_saved_regs_id_unwind): Update cache and id parameters.

	* frame.h (frame_id_unwind_ftype): Return the frame ID using a
	reference parameter.
	(struct frame_unwind_cache): Declare.
	(frame_id_unwind_ftype, frame_pc_unwind_ftype,
	frame_register_unwind_ftype): Change the unwind cache_type to
	`struct frame_unwind_cache'.
	(struct frame_info): Change type of unwind_cache to `struct
	frame_unwind_cache'.

	* frame.c (get_next_frame): Don't go beyond the inner-most frame.
	(frame_register_unwind): Assume that there is always a next frame.
	(frame_register): Ditto.
	(generic_unwind_get_saved_register): Ditto.

	* frame.h (frame_type): Add SENTINEL_FRAME.

	* Makefile.in (frame.o): Update dependencies.

	* frame.h (FRAME_OBSTACK_ZALLOC): Define.

	* Makefile.in (sentinel-frame.o): Specify dependencies.
	(sentinel_frame_h): Define.
	(SFILES): Add sentinel-frame.c.
	(COMMON_OBS): Add sentinel-frame.o.
	* sentinel-frame.c: New file.
	* sentinel-frame.h: New file.
Move legacy frame code to legacy-frame.[hc].
2003-01-11  Andrew Cagney  <ac131313@redhat.com>

	* frame.c (deprecated_update_frame_pc_hack)
	(deprecated_update_frame_base_hack): Also update the next frame's
	ID/PC cache.
	(create_sentinel_frame): Link the sentinel frame to itself.
	* frame.h: Expand comments describing update PC and FP hacks.
	* frame.c (get_prev_frame): Add comment explaining why
	INIT_EXTRA_FRAME_INFO call is needed.
	(legacy_get_prev_frame): Use get_next_frame.
Import latest changes from mainline.
2003-01-13  Andrew Cagney  <ac131313@redhat.com>

	* d10v-tdep.c: Include "d10v-tdep.h".  Update to use D10V_
	prefixed enums.
	(do_d10v_pop_frame): Delete.  Use version in d10v-frame.c.

	* frame.c (frame_read_unsigned_register): Do not use
	get_next_frame.
	(frame_read_signed_register): Do not use get_next_frame.
	(get_frame_base): Use frame_id_unwind.

	* d10v-tdep.h: New file.
	* d10v-frame.h: New file.
	* d10v-frame.c: New file.

	* frame.c (frame_id_unwind): Update.
	(create_sentinel_frame): Update.
	(legacy_get_prev_frame): Use frame_unwind_find_by_pc.
	(get_prev_frame): Ditto.

	* frame.h (struct frame_info): Replace pc_unwind, id_unwind and
	register_unwind with unwind structure.

	* frame.c (set_unwind_by_pc): Delete function.
	(create_new_frame): Use frame_unwind_find_by_pc;

	* Makefile.in (frame_h): Add $(frame_unwind_h).
	* frame.h: Include "frame-unwind.h".
	(frame_register_unwind_ftype): Delete.
	(frame_id_unwind_ftype): Delete.
	(frame_pc_unwind_ftype): Delete.

	* Makefile.in (dummy-frame.o): Update dependencies.
	(legacy-frame.o): Update dependencies.

	* dummy-frame.c: Include "frame-unwind.h".
	(dummy_frame_unwind): New static variable.
	(dummy_frame_p): New function.
	* legacy-frame.c: Include "frame-unwind.h".
	(legacy_frame_unwind): New static variable.
	(legacy_frame_p): New function.
	* legacy-frame.h (legacy_frame_p): Declare.
	* dummy-frame.h (dummy_frame_p): Declare.

	* Makefile.in (frame_unwind_h): Define.
	* frame-unwind.h: New file.
	* frame-unwind.c: New file.
2003-01-13  Andrew Cagney  <ac131313@redhat.com>

	* gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with
	predicate.
	* gdbarch.h, gdbarch.c: Regenerate.
	* stack.c (frame_info): Only initialize the saved registers when
	FRAME_INIT_SAVED_REGS_P.
	* frame.c (frame_saved_regs_register_unwind): Assert
	FRAME_INIT_SAVED_REGS_P.
	(deprecated_generic_get_saved_register): Ditto.
2003-01-19  Andrew Cagney  <ac131313@redhat.com>

	* d10v-frame.c: Use D10V_RET1_REGNUM.
	(saved_regs_unwinder): Don't use get_frame_saved_regs.
	* frame.c (get_prev_frame): Always initialize frame.frame.
	(get_frame_base): Return frame.frame.
Merge branch with mainline:
POP_FRAME_P;
frame-unwind.h.
merge with mainline