This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: frame_id question
- From: Jim Blandy <jimb at redhat dot com>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 11 Nov 2005 02:23:16 -0800
- Subject: Re: frame_id question
- References: <dkt7no$aan$1@sea.gmane.org>
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. 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.