From 75e3c1f98d4e0b3d89560b5981ade71c246b504b Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 9 Dec 2002 00:32:08 +0000 Subject: [PATCH] 2002-12-08 Andrew Cagney * stack.c (frame_info): Use get_prev_frame. * blockframe.c (frame_address_in_block): Ditto. * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. (rs6000_frameless_function_invocation): Ditto. (rs6000_frame_saved_pc): Ditto. (rs6000_frame_chain): Ditto. * arch-utils.c (init_frame_pc_default): Ditto. --- gdb/ChangeLog | 10 ++++++++++ gdb/arch-utils.c | 6 +++--- gdb/blockframe.c | 4 ++-- gdb/rs6000-tdep.c | 16 +++++++++------- gdb/stack.c | 8 ++++---- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 525b0069b18..630e43ea68f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2002-12-08 Andrew Cagney + + * stack.c (frame_info): Use get_prev_frame. + * blockframe.c (frame_address_in_block): Ditto. + * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto. + (rs6000_frameless_function_invocation): Ditto. + (rs6000_frame_saved_pc): Ditto. + (rs6000_frame_chain): Ditto. + * arch-utils.c (init_frame_pc_default): Ditto. + 2002-12-08 Andrew Cagney * config/mn10200/tm-mn10200.h (DEPRECATED_PC_IN_CALL_DUMMY): diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index a805dbc6b93..dfbbc211929 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -383,9 +383,9 @@ void init_frame_pc_default (int fromleaf, struct frame_info *prev) { if (fromleaf) - prev->pc = SAVED_PC_AFTER_CALL (prev->next); - else if (prev->next != NULL) - prev->pc = FRAME_SAVED_PC (prev->next); + prev->pc = SAVED_PC_AFTER_CALL (get_next_frame (prev)); + else if (get_next_frame (prev) != NULL) + prev->pc = FRAME_SAVED_PC (get_next_frame (prev)); else prev->pc = read_pc (); } diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 84b8cc48a16..caaecd48450 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -213,8 +213,8 @@ frame_address_in_block (struct frame_info *frame) /* FIXME: cagney/2002-11-10: Should this instead test for NORMAL_FRAME? A dummy frame (in fact all the abnormal frames) save the PC value in the block. */ - if (frame->next != 0 - && get_frame_type (frame->next) != SIGTRAMP_FRAME) + if (get_next_frame (frame) != 0 + && get_frame_type (get_next_frame (frame)) != SIGTRAMP_FRAME) --pc; return pc; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index b6e336bbb68..31b6cb1f621 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -169,7 +169,7 @@ rs6000_init_extra_frame_info (int fromleaf, struct frame_info *fi) fi->extra_info = (struct frame_extra_info *) frame_obstack_alloc (sizeof (struct frame_extra_info)); fi->extra_info->initial_sp = 0; - if (fi->next != (CORE_ADDR) 0 + if (get_next_frame (fi) != (CORE_ADDR) 0 && fi->pc < TEXT_SEGMENT_BASE) /* We're in get_prev_frame */ /* and this is a special signal frame. */ @@ -1477,7 +1477,8 @@ rs6000_frameless_function_invocation (struct frame_info *fi) /* Don't even think about framelessness except on the innermost frame or if the function was interrupted by a signal. */ - if (fi->next != NULL && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)) + if (get_next_frame (fi) != NULL + && !(get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) return 0; func_start = get_pc_function_start (fi->pc); @@ -1526,10 +1527,11 @@ rs6000_frame_saved_pc (struct frame_info *fi) (void) skip_prologue (func_start, fi->pc, &fdata); - if (fdata.lr_offset == 0 && fi->next != NULL) + if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL) { - if ((get_frame_type (fi->next) == SIGTRAMP_FRAME)) - return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET, + if ((get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME)) + return read_memory_addr (get_next_frame (fi)->frame + + SIG_FRAME_LR_OFFSET, wordsize); else if (DEPRECATED_PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0)) /* The link register wasn't saved by this frame and the next @@ -1756,8 +1758,8 @@ rs6000_frame_chain (struct frame_info *thisframe) if ((get_frame_type (thisframe) == SIGTRAMP_FRAME)) fp = read_memory_addr (thisframe->frame + SIG_FRAME_FP_OFFSET, wordsize); - else if (thisframe->next != NULL - && (get_frame_type (thisframe->next) == SIGTRAMP_FRAME) + else if (get_next_frame (thisframe) != NULL + && (get_frame_type (get_next_frame (thisframe)) == SIGTRAMP_FRAME) && FRAMELESS_FUNCTION_INVOCATION (thisframe)) /* A frameless function interrupted by a signal did not change the frame pointer. */ diff --git a/gdb/stack.c b/gdb/stack.c index 76cd4a58c36..d1dbd4eb607 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -837,15 +837,15 @@ frame_info (char *addr_exp, int from_tty) printf_filtered (" called by frame at "); print_address_numeric (calling_frame_info->frame, 1, gdb_stdout); } - if (fi->next && calling_frame_info) + if (get_next_frame (fi) && calling_frame_info) puts_filtered (","); wrap_here (" "); - if (fi->next) + if (get_next_frame (fi)) { printf_filtered (" caller of frame at "); - print_address_numeric (fi->next->frame, 1, gdb_stdout); + print_address_numeric (get_next_frame (fi)->frame, 1, gdb_stdout); } - if (fi->next || calling_frame_info) + if (get_next_frame (fi) || calling_frame_info) puts_filtered ("\n"); if (s) printf_filtered (" source language %s.\n", -- 2.30.2