Re: [rfa/mips] Stop backtraces when we've lost the PC

Andrew Cagney
2004-03-08T00:56:24Z

> Here's an updated version of a little hack I've been using since GDB 6.0.
> If we are in a nested normal frame, i.e. something whose next frame is a
> function that it called in the normal way, and we didn't find a saved PC,
> we're going to be stuck in a loop. We might have been able to figure out
> the frame size, but not where the return address was stored; as the comment
> says, this happens in glibc's clone function. Of course the problem there
> is that it _doesn't_ save $ra in the normal fashion; it won't return.
>
> Without this patch schedlock.exp falls apart, because backtraces continue
> forever printing "clone()" on every line.
>
> OK?

No!

> + if (frame_relative_level (next_frame) >= 0
> + && get_frame_type (next_frame) == NORMAL_FRAME
> + && !trad_frame_addr_p (info->saved_regs, NUM_REGS + PC_REGNUM))

The whole point of this recursive code is that you don't need to add
hacks that look down the stack at the type of more inner frames :-/

Can you post the relevant assembler so that we can determine why the
prologue analyzer is failing.

Andrew