2003-06-08 Andrew Cagney <cagney@redhat.com>

* gdbarch.sh (UNWIND_SP): Add.
	* gdbarch.h, gdbarch.c: Re-generate.
	* frame.c (frame_sp_unwind): New function.
	(get_frame_sp): New function.
	* frame.h (get_frame_sp, frame_sp_unwind): Declare.
	* regcache.c (read_sp): Rewrite, try each of TARGET_READ_SP,
	gdbarch_unwind_sp and SP_REGNUM when looking for the SP register
	value.
	* d10v-tdep.c (d10v_unwind_sp): Replace d10v_read_sp.
	(d10v_gdbarch_init): Set unwind_sp instead of read_sp.

2003-06-08  Andrew Cagney  <cagney@redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Document
	"unwind_sp".  Cross reference "unwind_sp" and TARGET_READ_SP.
This commit is contained in:
Andrew Cagney
2003-06-09 01:02:07 +00:00
parent 5cf72d3591
commit a9e5fdc219
10 changed files with 138 additions and 11 deletions

View File

@ -3291,6 +3291,23 @@ return d10v_make_iaddr (pc);
@noindent
@xref{DEPRECATED_FRAME_SAVED_PC}, which this method replaces.
@item CORE_ADDR unwind_sp (struct frame_info *@var{this_frame})
@findex unwind_sp
@anchor{unwind_sp} Return the frame's inner most stack address. This is
commonly refered to as the frame's @dfn{stack pointer}.
The implementation, which must be frame agnostic (work with any frame),
is typically no more than:
@smallexample
ULONGEST sp;
frame_unwind_unsigned_register (this_frame, D10V_SP_REGNUM, &sp);
return d10v_make_daddr (sp);
@end smallexample
@noindent
@xref{TARGET_READ_SP}, which this method replaces.
@item FUNCTION_EPILOGUE_SIZE
@findex FUNCTION_EPILOGUE_SIZE
For some COFF targets, the @code{x_sym.x_misc.x_fsize} field of the
@ -3890,15 +3907,17 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}.
@findex write_pc
@findex read_sp
@findex read_fp
These change the behavior of @code{read_pc}, @code{write_pc},
@code{read_sp} and @code{deprecated_read_fp}. For most targets, these
may be left undefined. @value{GDBN} will call the read and write
register functions with the relevant @code{_REGNUM} argument.
@anchor{TARGET_READ_SP} These change the behavior of @code{read_pc},
@code{write_pc}, @code{read_sp} and @code{deprecated_read_fp}. For most
targets, these may be left undefined. @value{GDBN} will call the read
and write register functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
in an ordinary register.
@xref{unwind_sp}, which replaces @code{TARGET_READ_SP}.
@item TARGET_VIRTUAL_FRAME_POINTER(@var{pc}, @var{regp}, @var{offsetp})
@findex TARGET_VIRTUAL_FRAME_POINTER
Returns a @code{(register, offset)} pair representing the virtual frame