int pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) { return (INNER_THAN ((sp), (pc)) && (frame_address != 0) && INNER_THAN ((pc), (frame_address))); }
void generic_push_dummy_frame (void) { struct dummy_frame *dummy_frame; CORE_ADDR fp = (get_current_frame ())->frame; /* check to see if there are stale dummy frames, perhaps left over from when a longjump took us out of a function that was called by the debugger */ dummy_frame = dummy_frame_stack; while (dummy_frame) if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */ { dummy_frame_stack = dummy_frame->next; xfree (dummy_frame->registers); xfree (dummy_frame); dummy_frame = dummy_frame_stack; } else dummy_frame = dummy_frame->next; dummy_frame = xmalloc (sizeof (struct dummy_frame)); dummy_frame->registers = xmalloc (REGISTER_BYTES); dummy_frame->pc = read_pc (); dummy_frame->sp = read_sp (); dummy_frame->top = dummy_frame->sp; dummy_frame->fp = fp; read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES); dummy_frame->next = dummy_frame_stack; dummy_frame_stack = dummy_frame; }
int generic_file_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { if (PC_IN_CALL_DUMMY (FRAME_SAVED_PC (fi), fp, fp)) return 1; /* don't prune CALL_DUMMY frames */ else /* fall back to default algorithm (see frame.h) */ return (fp != 0 && (INNER_THAN (fi->frame, fp) || fi->frame == fp) && !inside_entry_file (FRAME_SAVED_PC (fi))); }
int legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi) { /* Don't prune CALL_DUMMY frames. */ if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0)) return 1; /* If the new frame pointer is zero, then it isn't valid. */ if (fp == 0) return 0; /* If the new frame would be inside (younger than) the previous frame, then it isn't valid. */ if (INNER_THAN (fp, get_frame_base (fi))) return 0; /* If the architecture has a custom DEPRECATED_FRAME_CHAIN_VALID, call it now. */ if (DEPRECATED_FRAME_CHAIN_VALID_P ()) return DEPRECATED_FRAME_CHAIN_VALID (fp, fi); /* If we're already inside the entry function for the main objfile, then it isn't valid. */ if (legacy_inside_entry_func (get_frame_pc (fi))) return 0; /* If we're inside the entry file, it isn't valid. */ /* NOTE/drow 2002-12-25: should there be a way to disable this check? It assumes a single small entry file, and the way some debug readers (e.g. dbxread) figure out which object is the entry file is somewhat hokey. */ if (deprecated_inside_entry_file (frame_pc_unwind (fi))) return 0; return 1; }