This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: frame_id question


On Friday 11 November 2005 13:23, Jim Blandy wrote:
> Vladimir Prus <ghost@cs.msu.su> writes:
> > The question is: why frame id has to include program address at all? It
> > it ever possible for two frames to have the same stack address? If so,
> > when?
>
> Some functions don't need any stack space at all.  Such a function can
> even call other functions if it moves the return address to a
> callee-saved register while doing so.  

Do I understand correctly that this can happen only on architectures where
return address is not automatically pushed to the stack, but moved to a 
special register? Like MIPS's "jal" instructions that moves return address to 
$31

> Unwinding through such a call, 
> the caller's frame will have the same CFA as the callee, but a
> different function address.  Since the two frame ID's have different
> function addresses, frame_id_eq will declare them distinct, and GDB
> won't complain that it has gotten stuck trying to unwind the stack.

Does it mean that for architectures with automatic pushing of return address, 
using '0' as code address in frame_id will be safe? Or there are some corner 
cases?

Thanks,
Volodya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]