diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-05-05 01:55:37 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-05-05 01:55:37 +0000 |
commit | f621c63e01043dcc3a3e0e6db1ce26702cc667f2 (patch) | |
tree | ac85d28f583e870369d9f9cda245f43d22fbe02a | |
parent | 0f7d239c5ad7daea45f8b300b5308f90b76647a7 (diff) | |
download | gdb-f621c63e01043dcc3a3e0e6db1ce26702cc667f2.zip gdb-f621c63e01043dcc3a3e0e6db1ce26702cc667f2.tar.gz gdb-f621c63e01043dcc3a3e0e6db1ce26702cc667f2.tar.bz2 |
* sparc-tdep.c (sparc_get_saved_register): Comment why
get_prev_frame call is safe.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c7e3758..2147937 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2002-05-04 Andrew Cagney <ac131313@redhat.com> + * sparc-tdep.c (sparc_get_saved_register): Comment why + get_prev_frame call is safe. + +2002-05-04 Andrew Cagney <ac131313@redhat.com> + * frame.h (select_frame): Delete level parameter. * stack.c (select_frame): Update. Use frame_relative_level to obtain the frame's level. diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 28c51dc..6461ca0 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -855,10 +855,20 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE - (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE); else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8) + /* NOTE: cagney/2002-05-04: The call to get_prev_frame() + is safe/cheap - there will always be a prev frame. + This is because frame1 is initialized to frame->next + (frame1->prev == frame) and is then advanced towards + the innermost (next) frame. */ addr = (get_prev_frame (frame1)->extra_info->bottom + (regnum - I0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_I0); else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8) + /* NOTE: cagney/2002-05-04: The call to get_prev_frame() + is safe/cheap - there will always be a prev frame. + This is because frame1 is initialized to frame->next + (frame1->prev == frame) and is then advanced towards + the innermost (next) frame. */ addr = (get_prev_frame (frame1)->extra_info->bottom + (regnum - L0_REGNUM) * SPARC_INTREG_SIZE + FRAME_SAVED_L0); |